From: Alan Knowles Date: Sat, 31 Jul 2010 10:40:13 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=14e429834c1036a625b2c22bceb990279bde7644;p=roojs1 sync --- diff --git a/docs/files.html b/docs/files.html index aaf4fed45a..7fac3a6ffd 100644 --- a/docs/files.html +++ b/docs/files.html @@ -1687,9 +1687,9 @@
- Documentation generated by Introspeciton Doc Generator undefined on Wed Jul 28 2010 13:02:13 GMT+0800 (HKT) + Documentation generated by Introspeciton Doc Generator undefined on Sat Jul 31 2010 18:30:11 GMT+0800 (HKT) Based on - JsDoc Toolkit on Wed Jul 28 2010 13:02:13 GMT+0800 (HKT) + JsDoc Toolkit on Sat Jul 31 2010 18:30:11 GMT+0800 (HKT)
\ No newline at end of file diff --git a/docs/json/roodata.json b/docs/json/roodata.json index 2e9b42960d..b318103488 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -976,6 +976,12 @@ "desc": "Calls {@link #setUrl} with this value", "memberOf": "" }, + { + "name": "region", + "type": "String", + "desc": "(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)", + "memberOf": "" + }, { "name": "params", "type": "String/Object", @@ -1628,6 +1634,12 @@ "desc": "Calls {@link #setUrl} with this value", "memberOf": "Roo.ContentPanel" }, + { + "name": "region", + "type": "String", + "desc": "(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)", + "memberOf": "Roo.ContentPanel" + }, { "name": "params", "type": "String/Object", @@ -1700,6 +1712,18 @@ "desc": "The empty text to show when nothing is loaded.", "memberOf": "Roo.View" }, + { + "name": "multiSelect", + "type": "Boolean", + "desc": "Allow multiple selection", + "memberOf": "Roo.View" + }, + { + "name": "singleSelect", + "type": "Boolean", + "desc": "Allow single selection", + "memberOf": "Roo.View" + }, { "name": "listeners", "type": "Object", @@ -2336,7 +2360,7 @@ "name": "removeMask", "type": "Boolean", "desc": "True to create a single-use mask that is automatically destroyed after loading (useful for page loads),\nFalse to persist the mask element reference for multiple uses (e.g., for paged data widgets). Defaults to false.", - "memberOf": "" + "memberOf": "Roo" }, { "name": "msg", @@ -2670,6 +2694,12 @@ "desc": "Calls {@link #setUrl} with this value", "memberOf": "Roo.ContentPanel" }, + { + "name": "region", + "type": "String", + "desc": "(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)", + "memberOf": "Roo.ContentPanel" + }, { "name": "params", "type": "String/Object", @@ -2752,7 +2782,7 @@ "name": "items", "type": "Roo.data.Store", "desc": "array of button configs or elements to add", - "memberOf": "Roo.Toolbar" + "memberOf": "Roo" } ], "events": [] @@ -2989,7 +3019,7 @@ "name": "mode", "type": "String", "desc": "The shadow display mode. Supports the following options:
\nsides: Shadow displays on both sides and bottom only
\nframe: Shadow displays equally on all four sides
\ndrop: Traditional bottom-right drop shadow (default)", - "memberOf": "" + "memberOf": "Roo" }, { "name": "offset", @@ -3547,7 +3577,7 @@ "name": "items", "type": "Roo.data.Store", "desc": "array of button configs or elements to add", - "memberOf": "" + "memberOf": "Roo" }, { "name": "container", @@ -3962,7 +3992,7 @@ "name": "tree", "type": "Roo.tree.TreePanel", "desc": "The tree TreePanel, with config etc.", - "memberOf": "" + "memberOf": "Roo" }, { "name": "fitToFrame", @@ -4030,6 +4060,12 @@ "desc": "Calls {@link #setUrl} with this value", "memberOf": "Roo.ContentPanel" }, + { + "name": "region", + "type": "String", + "desc": "(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)", + "memberOf": "Roo.ContentPanel" + }, { "name": "params", "type": "String/Object", @@ -4140,6 +4176,18 @@ "desc": "The empty text to show when nothing is loaded.", "memberOf": "" }, + { + "name": "multiSelect", + "type": "Boolean", + "desc": "Allow multiple selection", + "memberOf": "" + }, + { + "name": "singleSelect", + "type": "Boolean", + "desc": "Allow single selection", + "memberOf": "" + }, { "name": "listeners", "type": "Object", @@ -13416,6 +13464,12 @@ }, "Roo.menu.TextItem": { "props": [ + { + "name": "text", + "type": "Boolean", + "desc": "Text to show on item.", + "memberOf": "" + }, { "name": "hideOnClick", "type": "Boolean", diff --git a/docs/symbols/Array.html b/docs/symbols/Array.html index 805080898a..e14f829717 100644 --- a/docs/symbols/Array.html +++ b/docs/symbols/Array.html @@ -385,7 +385,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Date.html b/docs/symbols/Date.html index cf0426af22..3d4d8078ce 100644 --- a/docs/symbols/Date.html +++ b/docs/symbols/Date.html @@ -1743,7 +1743,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Function.html b/docs/symbols/Function.html index 8cdeffe720..c5b452afce 100644 --- a/docs/symbols/Function.html +++ b/docs/symbols/Function.html @@ -600,7 +600,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Number.html b/docs/symbols/Number.html index c0a1b96715..5d0d934073 100644 --- a/docs/symbols/Number.html +++ b/docs/symbols/Number.html @@ -267,7 +267,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Ajax.html b/docs/symbols/Roo.Ajax.html index 2faf7f6b9a..3bd34965c1 100644 --- a/docs/symbols/Roo.Ajax.html +++ b/docs/symbols/Roo.Ajax.html @@ -1573,7 +1573,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.BasicDialog.html b/docs/symbols/Roo.BasicDialog.html index a570da6ab2..db237d9c08 100644 --- a/docs/symbols/Roo.BasicDialog.html +++ b/docs/symbols/Roo.BasicDialog.html @@ -3821,7 +3821,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.BasicLayoutRegion.html b/docs/symbols/Roo.BasicLayoutRegion.html index 9d71578c27..7099841c1f 100644 --- a/docs/symbols/Roo.BasicLayoutRegion.html +++ b/docs/symbols/Roo.BasicLayoutRegion.html @@ -2251,7 +2251,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.BorderLayout.html b/docs/symbols/Roo.BorderLayout.html index 77fbfbb8ad..6818829e37 100644 --- a/docs/symbols/Roo.BorderLayout.html +++ b/docs/symbols/Roo.BorderLayout.html @@ -2227,7 +2227,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.BoxComponent.html b/docs/symbols/Roo.BoxComponent.html index b34931edfd..255b361888 100644 --- a/docs/symbols/Roo.BoxComponent.html +++ b/docs/symbols/Roo.BoxComponent.html @@ -3236,7 +3236,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Button.html b/docs/symbols/Roo.Button.html index 9962fdb96d..9c4e2ddeea 100644 --- a/docs/symbols/Roo.Button.html +++ b/docs/symbols/Roo.Button.html @@ -2641,7 +2641,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.ColorPalette.html b/docs/symbols/Roo.ColorPalette.html index 5c078e6805..7c929046c4 100644 --- a/docs/symbols/Roo.ColorPalette.html +++ b/docs/symbols/Roo.ColorPalette.html @@ -2551,7 +2551,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Component.html b/docs/symbols/Roo.Component.html index 8a04907f2c..9b902a618f 100644 --- a/docs/symbols/Roo.Component.html +++ b/docs/symbols/Roo.Component.html @@ -2344,7 +2344,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.ComponentMgr.html b/docs/symbols/Roo.ComponentMgr.html index f36c8790e2..cd65a19764 100644 --- a/docs/symbols/Roo.ComponentMgr.html +++ b/docs/symbols/Roo.ComponentMgr.html @@ -446,7 +446,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.CompositeElement.html b/docs/symbols/Roo.CompositeElement.html index 22aa2b137d..df78bdd7cf 100644 --- a/docs/symbols/Roo.CompositeElement.html +++ b/docs/symbols/Roo.CompositeElement.html @@ -1184,7 +1184,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.CompositeElementLite.html b/docs/symbols/Roo.CompositeElementLite.html index 19457188db..43bdabe059 100644 --- a/docs/symbols/Roo.CompositeElementLite.html +++ b/docs/symbols/Roo.CompositeElementLite.html @@ -1190,7 +1190,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.ContentPanel.html b/docs/symbols/Roo.ContentPanel.html index 5a79190097..451aeef34b 100644 --- a/docs/symbols/Roo.ContentPanel.html +++ b/docs/symbols/Roo.ContentPanel.html @@ -432,6 +432,36 @@ +   + + + +
+ region : String + + +
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ + + + + + + Roo.ContentPanel + + + + + +   @@ -461,7 +491,7 @@ - +   @@ -491,7 +521,7 @@ - +   @@ -521,7 +551,7 @@ - +   @@ -2357,7 +2387,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.DDView.html b/docs/symbols/Roo.DDView.html index 7b19da6378..8bdea75aa7 100644 --- a/docs/symbols/Roo.DDView.html +++ b/docs/symbols/Roo.DDView.html @@ -1036,7 +1036,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.DatePicker.html b/docs/symbols/Roo.DatePicker.html index 87c1ea80dd..e6bb000adc 100644 --- a/docs/symbols/Roo.DatePicker.html +++ b/docs/symbols/Roo.DatePicker.html @@ -3157,7 +3157,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.DialogManager.html b/docs/symbols/Roo.DialogManager.html index 0cdb36b930..d8a9ca45a2 100644 --- a/docs/symbols/Roo.DialogManager.html +++ b/docs/symbols/Roo.DialogManager.html @@ -515,7 +515,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.DomHelper.html b/docs/symbols/Roo.DomHelper.html index 90b1c1703e..30f0729e88 100644 --- a/docs/symbols/Roo.DomHelper.html +++ b/docs/symbols/Roo.DomHelper.html @@ -942,7 +942,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.DomQuery.html b/docs/symbols/Roo.DomQuery.html index ce2e84db11..8b1eb7d137 100644 --- a/docs/symbols/Roo.DomQuery.html +++ b/docs/symbols/Roo.DomQuery.html @@ -770,7 +770,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Editor.html b/docs/symbols/Roo.Editor.html index 02edbd5821..2e56ca5a25 100644 --- a/docs/symbols/Roo.Editor.html +++ b/docs/symbols/Roo.Editor.html @@ -3443,7 +3443,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Element.html b/docs/symbols/Roo.Element.html index f8e211ceb0..016eec2839 100644 --- a/docs/symbols/Roo.Element.html +++ b/docs/symbols/Roo.Element.html @@ -11071,7 +11071,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.EventManager.html b/docs/symbols/Roo.EventManager.html index 13d02e0539..34c40650c1 100644 --- a/docs/symbols/Roo.EventManager.html +++ b/docs/symbols/Roo.EventManager.html @@ -923,7 +923,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.EventObject.html b/docs/symbols/Roo.EventObject.html index fb9e8716b4..4b9a3a0968 100644 --- a/docs/symbols/Roo.EventObject.html +++ b/docs/symbols/Roo.EventObject.html @@ -1105,7 +1105,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Fx.html b/docs/symbols/Roo.Fx.html index c28fe258bf..1c268a355e 100644 --- a/docs/symbols/Roo.Fx.html +++ b/docs/symbols/Roo.Fx.html @@ -1876,7 +1876,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.GridPanel.html b/docs/symbols/Roo.GridPanel.html index 7a378d8f15..c5fb45d013 100644 --- a/docs/symbols/Roo.GridPanel.html +++ b/docs/symbols/Roo.GridPanel.html @@ -426,6 +426,36 @@ +   + + + +
+ region : String + + +
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ + + + + + + Roo.ContentPanel + + + + + +   @@ -455,7 +485,7 @@ - +   @@ -485,7 +515,7 @@ - +   @@ -515,7 +545,7 @@ - +   @@ -2405,7 +2435,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.JsonView.html b/docs/symbols/Roo.JsonView.html index 7ae031df80..4246732f40 100644 --- a/docs/symbols/Roo.JsonView.html +++ b/docs/symbols/Roo.JsonView.html @@ -83,7 +83,7 @@
- Shortcut class to create a JSON + {link Roo.UpdateManager} template view. Usage:

var view = new Roo.JsonView({
container: "my-element",
template: '<div id="{id}">{foo} - {bar}</div>', // auto create template
multiSelect: true,
jsonRoot: "data"
});

// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});

// direct load of JSON data
view.load("foobar.php");

// Example from my blog list
var tpl = new Roo.Template(
'<div class="entry">' +
'<a class="entry-title" href="{link}">{title}</a>' +
"<h4>{date} by {author} | {comments} Comments</h4>{description}" +
"</div><hr />"
);

var moreView = new Roo.JsonView({
container : "entry-list",
template : tpl,
jsonRoot: "posts"
});
moreView.on("beforerender", this.sortEntries, this);
moreView.load({
url: "/blog/get-posts.php",
params: "allposts=true",
text: "Loading Blog Entries..."
});


Note: old code is supported with arguments : (container, template, config) + Shortcut class to create a JSON + {link Roo.UpdateManager} template view. Usage:

var view = new Roo.JsonView({
container: "my-element",
tpl: '<div id="{id}">{foo} - {bar}</div>', // auto create template
multiSelect: true,
jsonRoot: "data"
});

// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});

// direct load of JSON data
view.load("foobar.php");

// Example from my blog list
var tpl = new Roo.Template(
'<div class="entry">' +
'<a class="entry-title" href="{link}">{title}</a>' +
"<h4>{date} by {author} | {comments} Comments</h4>{description}" +
"</div><hr />"
);

var moreView = new Roo.JsonView({
container : "entry-list",
template : tpl,
jsonRoot: "posts"
});
moreView.on("beforerender", this.sortEntries, this);
moreView.load({
url: "/blog/get-posts.php",
params: "allposts=true",
text: "Loading Blog Entries..."
});


Note: old code is supported with arguments : (container, template, config)
@@ -216,6 +216,36 @@ +   + + + +
+ multiSelect : Boolean + + +
+ +
+
Allow multiple selection
+
+ +
+
Allow multiple selection
+
+ + + + + + + Roo.View + + + + + +   @@ -245,6 +275,36 @@ + +   + + + +
+ singleSelect : Boolean + + +
+ +
+
Allow single selection
+
+ +
+
Allow single selection
+
+ + + + + + + Roo.View + + + + +   @@ -3163,7 +3223,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.KeyMap.html b/docs/symbols/Roo.KeyMap.html index 77c0931080..06e736f0cb 100644 --- a/docs/symbols/Roo.KeyMap.html +++ b/docs/symbols/Roo.KeyMap.html @@ -560,7 +560,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.KeyNav.html b/docs/symbols/Roo.KeyNav.html index 8c8404b01e..4d551f24b5 100644 --- a/docs/symbols/Roo.KeyNav.html +++ b/docs/symbols/Roo.KeyNav.html @@ -453,7 +453,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Layer.html b/docs/symbols/Roo.Layer.html index 4fb616c714..b3f54cb232 100644 --- a/docs/symbols/Roo.Layer.html +++ b/docs/symbols/Roo.Layer.html @@ -11215,7 +11215,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.LayoutDialog.html b/docs/symbols/Roo.LayoutDialog.html index 002137db3f..deb77aa844 100644 --- a/docs/symbols/Roo.LayoutDialog.html +++ b/docs/symbols/Roo.LayoutDialog.html @@ -4056,7 +4056,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.LayoutManager.html b/docs/symbols/Roo.LayoutManager.html index db69bf6989..2c1fe93ffa 100644 --- a/docs/symbols/Roo.LayoutManager.html +++ b/docs/symbols/Roo.LayoutManager.html @@ -1501,7 +1501,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.LayoutRegion.html b/docs/symbols/Roo.LayoutRegion.html index ca8073fae5..a06351e347 100644 --- a/docs/symbols/Roo.LayoutRegion.html +++ b/docs/symbols/Roo.LayoutRegion.html @@ -3516,7 +3516,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.LoadMask.html b/docs/symbols/Roo.LoadMask.html index 8698261cd8..77f546a639 100644 --- a/docs/symbols/Roo.LoadMask.html +++ b/docs/symbols/Roo.LoadMask.html @@ -171,11 +171,11 @@ - +   - +
removeMask : Boolean @@ -195,7 +195,7 @@ - Roo.LoadMask + Roo @@ -453,7 +453,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Login.html b/docs/symbols/Roo.Login.html index c56ff8f8f9..13e9a8fb88 100644 --- a/docs/symbols/Roo.Login.html +++ b/docs/symbols/Roo.Login.html @@ -4093,7 +4093,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.MasterTemplate.html b/docs/symbols/Roo.MasterTemplate.html index fee1028a52..a944bca0f1 100644 --- a/docs/symbols/Roo.MasterTemplate.html +++ b/docs/symbols/Roo.MasterTemplate.html @@ -1366,7 +1366,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.MessageBox.html b/docs/symbols/Roo.MessageBox.html index 6bceed6f94..cba7375e51 100644 --- a/docs/symbols/Roo.MessageBox.html +++ b/docs/symbols/Roo.MessageBox.html @@ -1063,7 +1063,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.NestedLayoutPanel.html b/docs/symbols/Roo.NestedLayoutPanel.html index 593193172e..829796a6e3 100644 --- a/docs/symbols/Roo.NestedLayoutPanel.html +++ b/docs/symbols/Roo.NestedLayoutPanel.html @@ -426,6 +426,36 @@ +   + + + +
+ region : String + + +
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ + + + + + + Roo.ContentPanel + + + + + +   @@ -455,7 +485,7 @@ - +   @@ -485,7 +515,7 @@ - +   @@ -515,7 +545,7 @@ - +   @@ -2405,7 +2435,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.PagingToolbar.html b/docs/symbols/Roo.PagingToolbar.html index d3248b41e7..b373394a6d 100644 --- a/docs/symbols/Roo.PagingToolbar.html +++ b/docs/symbols/Roo.PagingToolbar.html @@ -278,7 +278,7 @@   - +
items : Roo.data.Store @@ -298,7 +298,7 @@ - Roo.Toolbar + Roo @@ -1664,7 +1664,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.QuickTips.html b/docs/symbols/Roo.QuickTips.html index 932dab5252..351a1a5441 100644 --- a/docs/symbols/Roo.QuickTips.html +++ b/docs/symbols/Roo.QuickTips.html @@ -514,7 +514,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.ReaderLayout.html b/docs/symbols/Roo.ReaderLayout.html index 1478588621..bbecf93bb7 100644 --- a/docs/symbols/Roo.ReaderLayout.html +++ b/docs/symbols/Roo.ReaderLayout.html @@ -2153,7 +2153,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:04 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Resizable.html b/docs/symbols/Roo.Resizable.html index 8de7a5d416..b8063022a2 100644 --- a/docs/symbols/Roo.Resizable.html +++ b/docs/symbols/Roo.Resizable.html @@ -2103,7 +2103,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Shadow.html b/docs/symbols/Roo.Shadow.html index 465cc01cfe..5fa3f5084a 100644 --- a/docs/symbols/Roo.Shadow.html +++ b/docs/symbols/Roo.Shadow.html @@ -111,11 +111,11 @@ - +   - +
mode : String @@ -135,7 +135,7 @@ - Roo.Shadow + Roo @@ -621,7 +621,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.SplitBar.AbsoluteLayoutAdapter.html b/docs/symbols/Roo.SplitBar.AbsoluteLayoutAdapter.html index c20f6e5dbf..07338f6791 100644 --- a/docs/symbols/Roo.SplitBar.AbsoluteLayoutAdapter.html +++ b/docs/symbols/Roo.SplitBar.AbsoluteLayoutAdapter.html @@ -393,7 +393,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.SplitBar.BasicLayoutAdapter.html b/docs/symbols/Roo.SplitBar.BasicLayoutAdapter.html index 17ba888fc6..7aba8e5b7c 100644 --- a/docs/symbols/Roo.SplitBar.BasicLayoutAdapter.html +++ b/docs/symbols/Roo.SplitBar.BasicLayoutAdapter.html @@ -376,7 +376,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.SplitBar.html b/docs/symbols/Roo.SplitBar.html index 9236337413..75cc28874d 100644 --- a/docs/symbols/Roo.SplitBar.html +++ b/docs/symbols/Roo.SplitBar.html @@ -1847,7 +1847,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.SplitButton.html b/docs/symbols/Roo.SplitButton.html index 8efad7174b..a8cc912110 100644 --- a/docs/symbols/Roo.SplitButton.html +++ b/docs/symbols/Roo.SplitButton.html @@ -2837,7 +2837,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.SplitLayoutRegion.html b/docs/symbols/Roo.SplitLayoutRegion.html index d6d0bde0fc..696c3a8946 100644 --- a/docs/symbols/Roo.SplitLayoutRegion.html +++ b/docs/symbols/Roo.SplitLayoutRegion.html @@ -3576,7 +3576,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.TabPanel.html b/docs/symbols/Roo.TabPanel.html index f7fe6e1b2a..33c52c5874 100644 --- a/docs/symbols/Roo.TabPanel.html +++ b/docs/symbols/Roo.TabPanel.html @@ -2117,7 +2117,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.TabPanelItem.html b/docs/symbols/Roo.TabPanelItem.html index 7b9677599e..34246a0590 100644 --- a/docs/symbols/Roo.TabPanelItem.html +++ b/docs/symbols/Roo.TabPanelItem.html @@ -2060,7 +2060,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Template.html b/docs/symbols/Roo.Template.html index c7b2de4e73..66e43208d0 100644 --- a/docs/symbols/Roo.Template.html +++ b/docs/symbols/Roo.Template.html @@ -1076,7 +1076,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.Button.html b/docs/symbols/Roo.Toolbar.Button.html index 83cb4aed68..918a01ee75 100644 --- a/docs/symbols/Roo.Toolbar.Button.html +++ b/docs/symbols/Roo.Toolbar.Button.html @@ -2635,7 +2635,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.Fill.html b/docs/symbols/Roo.Toolbar.Fill.html index 4831ad475b..532a77b5f8 100644 --- a/docs/symbols/Roo.Toolbar.Fill.html +++ b/docs/symbols/Roo.Toolbar.Fill.html @@ -681,7 +681,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.Item.html b/docs/symbols/Roo.Toolbar.Item.html index cf6771321e..b5a2df9b1a 100644 --- a/docs/symbols/Roo.Toolbar.Item.html +++ b/docs/symbols/Roo.Toolbar.Item.html @@ -685,7 +685,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.Separator.html b/docs/symbols/Roo.Toolbar.Separator.html index af2dd89f84..aa63926124 100644 --- a/docs/symbols/Roo.Toolbar.Separator.html +++ b/docs/symbols/Roo.Toolbar.Separator.html @@ -680,7 +680,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.Spacer.html b/docs/symbols/Roo.Toolbar.Spacer.html index 5aea04fdde..43a1eeb79f 100644 --- a/docs/symbols/Roo.Toolbar.Spacer.html +++ b/docs/symbols/Roo.Toolbar.Spacer.html @@ -687,7 +687,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.SplitButton.html b/docs/symbols/Roo.Toolbar.SplitButton.html index 10a1d21f84..251e81a4b4 100644 --- a/docs/symbols/Roo.Toolbar.SplitButton.html +++ b/docs/symbols/Roo.Toolbar.SplitButton.html @@ -2825,7 +2825,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.TextItem.html b/docs/symbols/Roo.Toolbar.TextItem.html index d4310fe404..96ef830af3 100644 --- a/docs/symbols/Roo.Toolbar.TextItem.html +++ b/docs/symbols/Roo.Toolbar.TextItem.html @@ -691,7 +691,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.Toolbar.html b/docs/symbols/Roo.Toolbar.html index 909aa18dcb..42670eaf1c 100644 --- a/docs/symbols/Roo.Toolbar.html +++ b/docs/symbols/Roo.Toolbar.html @@ -148,11 +148,11 @@ - +   - +
items : Roo.data.Store @@ -172,7 +172,7 @@ - Roo.Toolbar + Roo @@ -1384,7 +1384,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.TreePanel.html b/docs/symbols/Roo.TreePanel.html index 17c5669cb4..df95357082 100644 --- a/docs/symbols/Roo.TreePanel.html +++ b/docs/symbols/Roo.TreePanel.html @@ -426,6 +426,36 @@ +   + + + +
+ region : String + + +
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ +
+
(center|north|south|east|west) which region to put this panel on (when used with xtype constructors)
+
+ + + + + + + Roo.ContentPanel + + + + + +   @@ -455,7 +485,7 @@ - +   @@ -485,7 +515,7 @@ - +   @@ -515,11 +545,11 @@ - +   - +
tree : Roo.tree.TreePanel @@ -539,13 +569,13 @@ - Roo.TreePanel + Roo - +   @@ -2363,7 +2393,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.UpdateManager.BasicRenderer.html b/docs/symbols/Roo.UpdateManager.BasicRenderer.html index e14f251be4..57ca7ab7f0 100644 --- a/docs/symbols/Roo.UpdateManager.BasicRenderer.html +++ b/docs/symbols/Roo.UpdateManager.BasicRenderer.html @@ -313,7 +313,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.UpdateManager.defaults.html b/docs/symbols/Roo.UpdateManager.defaults.html index 431549476f..bb6a014c21 100644 --- a/docs/symbols/Roo.UpdateManager.defaults.html +++ b/docs/symbols/Roo.UpdateManager.defaults.html @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.UpdateManager.html b/docs/symbols/Roo.UpdateManager.html index 7232fb1597..daa13cc569 100644 --- a/docs/symbols/Roo.UpdateManager.html +++ b/docs/symbols/Roo.UpdateManager.html @@ -1883,7 +1883,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.View.html b/docs/symbols/Roo.View.html index 563bf2c158..6fa52483b1 100644 --- a/docs/symbols/Roo.View.html +++ b/docs/symbols/Roo.View.html @@ -89,7 +89,7 @@
- Create a "View" for an element based on a data model or UpdateManager and the supplied DomHelper template.
This class also supports single and multi selection modes.

Create a data model bound view:

var store = new Roo.data.Store(...);

var view = new Roo.View({
el : "my-element",
template : '<div id="{0}">{2} - {1}</div>', // auto create template

singleSelect: true,
selectedClass: "ydataview-selected",
store: store
});

// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});

// load XML data
dataModel.load("foobar.xml");

For an example of creating a JSON/UpdateManager view, see {link Roo.JsonView}.



Note: The root of your template must be a single node. Table/row implementations may work but are not supported due to
IE"s limited insertion support with tables and Opera"s faulty event bubbling.


Note: old style constructor is still suported (container, template, config) + Create a "View" for an element based on a data model or UpdateManager and the supplied DomHelper template.
This class also supports single and multi selection modes.

Create a data model bound view:

var store = new Roo.data.Store(...);

var view = new Roo.View({
el : "my-element",
tpl : '<div id="{0}">{2} - {1}</div>', // auto create template

singleSelect: true,
selectedClass: "ydataview-selected",
store: store
});

// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});

// load XML data
dataModel.load("foobar.xml");

For an example of creating a JSON/UpdateManager view, see {link Roo.JsonView}.



Note: The root of your template must be a single node. Table/row implementations may work but are not supported due to
IE"s limited insertion support with tables and Opera"s faulty event bubbling.


Note: old style constructor is still suported (container, template, config)
@@ -222,6 +222,36 @@ +   + + + +
+ multiSelect : Boolean + + +
+ +
+
Allow multiple selection
+
+ +
+
Allow multiple selection
+
+ + + + + + + Roo.View + + + + + +   @@ -251,6 +281,36 @@ + +   + + + +
+ singleSelect : Boolean + + +
+ +
+
Allow single selection
+
+ +
+
Allow single selection
+
+ + + + + + + Roo.View + + + + +   @@ -2496,7 +2556,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.XComponent.html b/docs/symbols/Roo.XComponent.html index 7010855096..37b939dfb1 100644 --- a/docs/symbols/Roo.XComponent.html +++ b/docs/symbols/Roo.XComponent.html @@ -1574,7 +1574,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.ArrayReader.html b/docs/symbols/Roo.data.ArrayReader.html index fd84e3cdd1..9a332ba0d9 100644 --- a/docs/symbols/Roo.data.ArrayReader.html +++ b/docs/symbols/Roo.data.ArrayReader.html @@ -458,7 +458,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.Connection.html b/docs/symbols/Roo.data.Connection.html index 064b6162d7..008c4a9ef4 100644 --- a/docs/symbols/Roo.data.Connection.html +++ b/docs/symbols/Roo.data.Connection.html @@ -1519,7 +1519,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.DataProxy.html b/docs/symbols/Roo.data.DataProxy.html index 688a737beb..c097905379 100644 --- a/docs/symbols/Roo.data.DataProxy.html +++ b/docs/symbols/Roo.data.DataProxy.html @@ -466,7 +466,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.DataReader.html b/docs/symbols/Roo.data.DataReader.html index 3fec475cf0..24d8cfdd8c 100644 --- a/docs/symbols/Roo.data.DataReader.html +++ b/docs/symbols/Roo.data.DataReader.html @@ -317,7 +317,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.HttpProxy.html b/docs/symbols/Roo.data.HttpProxy.html index ffa91fde01..18e99ee35d 100644 --- a/docs/symbols/Roo.data.HttpProxy.html +++ b/docs/symbols/Roo.data.HttpProxy.html @@ -843,7 +843,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.JsonReader.html b/docs/symbols/Roo.data.JsonReader.html index 23a3ae3673..f990436e8c 100644 --- a/docs/symbols/Roo.data.JsonReader.html +++ b/docs/symbols/Roo.data.JsonReader.html @@ -625,7 +625,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.JsonStore.html b/docs/symbols/Roo.data.JsonStore.html index 282a2c5fa2..d15a58e7bc 100644 --- a/docs/symbols/Roo.data.JsonStore.html +++ b/docs/symbols/Roo.data.JsonStore.html @@ -3640,7 +3640,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.MemoryProxy.html b/docs/symbols/Roo.data.MemoryProxy.html index 72275b7288..13ec8ac4e9 100644 --- a/docs/symbols/Roo.data.MemoryProxy.html +++ b/docs/symbols/Roo.data.MemoryProxy.html @@ -330,7 +330,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.Node.html b/docs/symbols/Roo.data.Node.html index 663449c45d..17dd333fe2 100644 --- a/docs/symbols/Roo.data.Node.html +++ b/docs/symbols/Roo.data.Node.html @@ -3027,7 +3027,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.Record.html b/docs/symbols/Roo.data.Record.html index c78f331848..2e01c74d55 100644 --- a/docs/symbols/Roo.data.Record.html +++ b/docs/symbols/Roo.data.Record.html @@ -636,7 +636,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.ScriptTagProxy.html b/docs/symbols/Roo.data.ScriptTagProxy.html index b64f187a85..48ff092861 100644 --- a/docs/symbols/Roo.data.ScriptTagProxy.html +++ b/docs/symbols/Roo.data.ScriptTagProxy.html @@ -512,7 +512,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.SimpleStore.html b/docs/symbols/Roo.data.SimpleStore.html index 46622bc882..e4cd2b6ee0 100644 --- a/docs/symbols/Roo.data.SimpleStore.html +++ b/docs/symbols/Roo.data.SimpleStore.html @@ -3670,7 +3670,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.SortTypes.html b/docs/symbols/Roo.data.SortTypes.html index ceb31b0ad4..9553a8bffd 100644 --- a/docs/symbols/Roo.data.SortTypes.html +++ b/docs/symbols/Roo.data.SortTypes.html @@ -783,7 +783,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.Store.html b/docs/symbols/Roo.data.Store.html index c9afaa9a50..45f62cc887 100644 --- a/docs/symbols/Roo.data.Store.html +++ b/docs/symbols/Roo.data.Store.html @@ -3616,7 +3616,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.Tree.html b/docs/symbols/Roo.data.Tree.html index 5839c80b0c..0284ca3015 100644 --- a/docs/symbols/Roo.data.Tree.html +++ b/docs/symbols/Roo.data.Tree.html @@ -1696,7 +1696,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.XmlReader.html b/docs/symbols/Roo.data.XmlReader.html index 7478837320..46cdb73b6e 100644 --- a/docs/symbols/Roo.data.XmlReader.html +++ b/docs/symbols/Roo.data.XmlReader.html @@ -625,7 +625,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.data.html b/docs/symbols/Roo.data.html index 366726d798..e9254f49b2 100644 --- a/docs/symbols/Roo.data.html +++ b/docs/symbols/Roo.data.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:data @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:05 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DD.html b/docs/symbols/Roo.dd.DD.html index e9cb363613..51ef8c013f 100644 --- a/docs/symbols/Roo.dd.DD.html +++ b/docs/symbols/Roo.dd.DD.html @@ -3266,7 +3266,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DDProxy.html b/docs/symbols/Roo.dd.DDProxy.html index 483ef136c9..29ca628ed1 100644 --- a/docs/symbols/Roo.dd.DDProxy.html +++ b/docs/symbols/Roo.dd.DDProxy.html @@ -3427,7 +3427,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DDTarget.html b/docs/symbols/Roo.dd.DDTarget.html index 061b413f93..17bdf83a74 100644 --- a/docs/symbols/Roo.dd.DDTarget.html +++ b/docs/symbols/Roo.dd.DDTarget.html @@ -2920,7 +2920,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DragDrop.html b/docs/symbols/Roo.dd.DragDrop.html index a482629369..21c0177245 100644 --- a/docs/symbols/Roo.dd.DragDrop.html +++ b/docs/symbols/Roo.dd.DragDrop.html @@ -2907,7 +2907,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DragDropMgr.html b/docs/symbols/Roo.dd.DragDropMgr.html index d61d9c1e46..bdaf1c81c2 100644 --- a/docs/symbols/Roo.dd.DragDropMgr.html +++ b/docs/symbols/Roo.dd.DragDropMgr.html @@ -2194,7 +2194,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DragSource.html b/docs/symbols/Roo.dd.DragSource.html index b2313108bb..f8468c435d 100644 --- a/docs/symbols/Roo.dd.DragSource.html +++ b/docs/symbols/Roo.dd.DragSource.html @@ -4272,7 +4272,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DragZone.html b/docs/symbols/Roo.dd.DragZone.html index 60d3ff0d56..ab8f35bf3b 100644 --- a/docs/symbols/Roo.dd.DragZone.html +++ b/docs/symbols/Roo.dd.DragZone.html @@ -4548,7 +4548,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DropTarget.html b/docs/symbols/Roo.dd.DropTarget.html index f03b4add64..318e507a71 100644 --- a/docs/symbols/Roo.dd.DropTarget.html +++ b/docs/symbols/Roo.dd.DropTarget.html @@ -3357,7 +3357,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.DropZone.html b/docs/symbols/Roo.dd.DropZone.html index 2b51ca70a0..b0c6d00e72 100644 --- a/docs/symbols/Roo.dd.DropZone.html +++ b/docs/symbols/Roo.dd.DropZone.html @@ -3956,7 +3956,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.Registry.html b/docs/symbols/Roo.dd.Registry.html index 7a30d8f7f6..1c97926cdf 100644 --- a/docs/symbols/Roo.dd.Registry.html +++ b/docs/symbols/Roo.dd.Registry.html @@ -624,7 +624,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.ScrollManager.html b/docs/symbols/Roo.dd.ScrollManager.html index 8413405cbb..e55c9e3bf5 100644 --- a/docs/symbols/Roo.dd.ScrollManager.html +++ b/docs/symbols/Roo.dd.ScrollManager.html @@ -361,7 +361,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.StatusProxy.html b/docs/symbols/Roo.dd.StatusProxy.html index 4a01603a76..710c857ebb 100644 --- a/docs/symbols/Roo.dd.StatusProxy.html +++ b/docs/symbols/Roo.dd.StatusProxy.html @@ -922,7 +922,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.dd.html b/docs/symbols/Roo.dd.html index f867233291..d76f94c440 100644 --- a/docs/symbols/Roo.dd.html +++ b/docs/symbols/Roo.dd.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:dd @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:10 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Action.html b/docs/symbols/Roo.form.Action.html index a3f8b24580..b6d82afcd4 100644 --- a/docs/symbols/Roo.form.Action.html +++ b/docs/symbols/Roo.form.Action.html @@ -425,7 +425,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.BasicForm.html b/docs/symbols/Roo.form.BasicForm.html index 2b5941771c..01415a58f3 100644 --- a/docs/symbols/Roo.form.BasicForm.html +++ b/docs/symbols/Roo.form.BasicForm.html @@ -2738,7 +2738,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Checkbox.html b/docs/symbols/Roo.form.Checkbox.html index a14956b85e..785e17cc83 100644 --- a/docs/symbols/Roo.form.Checkbox.html +++ b/docs/symbols/Roo.form.Checkbox.html @@ -3501,7 +3501,7 @@
setValue - (Boolean/String checked) + (Boolean/String value, Boolean/String suppressEvent) @@ -3514,7 +3514,7 @@
- Sets the checked state of the checkbox. + Sets the checked state of the checkbox.
On is always based on a string comparison between inputValue and the param. @@ -3525,10 +3525,16 @@
Parameters:
- Boolean/String checked + Boolean/String value
-
True, 'true', '1', or 'on' to check the checkbox, any other value will uncheck it.
+
- the value to set
+ +
+ Boolean/String suppressEvent + +
+
- whether to suppress the checkchange event.
@@ -5100,7 +5106,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:07 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Column.html b/docs/symbols/Roo.form.Column.html index 87d46ba6ac..69d046ef00 100644 --- a/docs/symbols/Roo.form.Column.html +++ b/docs/symbols/Roo.form.Column.html @@ -2641,7 +2641,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:07 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.ComboBox.html b/docs/symbols/Roo.form.ComboBox.html index d4a7d2404a..023ed1cea2 100644 --- a/docs/symbols/Roo.form.ComboBox.html +++ b/docs/symbols/Roo.form.ComboBox.html @@ -7663,7 +7663,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.DateField.html b/docs/symbols/Roo.form.DateField.html index 0926e88f85..055cd9cf0f 100644 --- a/docs/symbols/Roo.form.DateField.html +++ b/docs/symbols/Roo.form.DateField.html @@ -6134,7 +6134,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.FCKeditor.html b/docs/symbols/Roo.form.FCKeditor.html index decb32b4a6..3517936c32 100644 --- a/docs/symbols/Roo.form.FCKeditor.html +++ b/docs/symbols/Roo.form.FCKeditor.html @@ -5832,7 +5832,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Field.html b/docs/symbols/Roo.form.Field.html index 44185e3abc..2238ee299d 100644 --- a/docs/symbols/Roo.form.Field.html +++ b/docs/symbols/Roo.form.Field.html @@ -4918,7 +4918,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.FieldSet.html b/docs/symbols/Roo.form.FieldSet.html index db71cc1941..20b38beaf9 100644 --- a/docs/symbols/Roo.form.FieldSet.html +++ b/docs/symbols/Roo.form.FieldSet.html @@ -2641,7 +2641,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Form.html b/docs/symbols/Roo.form.Form.html index 5a2e7a8a68..24e639fcb2 100644 --- a/docs/symbols/Roo.form.Form.html +++ b/docs/symbols/Roo.form.Form.html @@ -3821,7 +3821,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.GridField.html b/docs/symbols/Roo.form.GridField.html index 9f5a839c4e..57723dd155 100644 --- a/docs/symbols/Roo.form.GridField.html +++ b/docs/symbols/Roo.form.GridField.html @@ -4972,7 +4972,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Hidden.html b/docs/symbols/Roo.form.Hidden.html index f2a01a05f1..2de9cab554 100644 --- a/docs/symbols/Roo.form.Hidden.html +++ b/docs/symbols/Roo.form.Hidden.html @@ -5710,7 +5710,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.HtmlEditor.ToolbarContext.html b/docs/symbols/Roo.form.HtmlEditor.ToolbarContext.html index 8b371e5aaa..434e8dbaa7 100644 --- a/docs/symbols/Roo.form.HtmlEditor.ToolbarContext.html +++ b/docs/symbols/Roo.form.HtmlEditor.ToolbarContext.html @@ -325,7 +325,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.HtmlEditor.ToolbarStandard.html b/docs/symbols/Roo.form.HtmlEditor.ToolbarStandard.html index 5b2eb5c259..20c2d35c98 100644 --- a/docs/symbols/Roo.form.HtmlEditor.ToolbarStandard.html +++ b/docs/symbols/Roo.form.HtmlEditor.ToolbarStandard.html @@ -415,7 +415,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.HtmlEditor.html b/docs/symbols/Roo.form.HtmlEditor.html index 2d2fbced2b..f2f4ba5ada 100644 --- a/docs/symbols/Roo.form.HtmlEditor.html +++ b/docs/symbols/Roo.form.HtmlEditor.html @@ -1366,7 +1366,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Layout.html b/docs/symbols/Roo.form.Layout.html index 98d63dac7b..3e4ab9c603 100644 --- a/docs/symbols/Roo.form.Layout.html +++ b/docs/symbols/Roo.form.Layout.html @@ -2617,7 +2617,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.NumberField.html b/docs/symbols/Roo.form.NumberField.html index 0059532137..d539b83479 100644 --- a/docs/symbols/Roo.form.NumberField.html +++ b/docs/symbols/Roo.form.NumberField.html @@ -5980,7 +5980,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Radio.html b/docs/symbols/Roo.form.Radio.html index 8bd40790ea..323f31bf0b 100644 --- a/docs/symbols/Roo.form.Radio.html +++ b/docs/symbols/Roo.form.Radio.html @@ -3561,7 +3561,7 @@
setValue - (Boolean/String checked) + (Boolean/String value, Boolean/String suppressEvent) @@ -3574,7 +3574,7 @@
- Sets the checked state of the checkbox. + Sets the checked state of the checkbox.
On is always based on a string comparison between inputValue and the param. @@ -3585,10 +3585,16 @@
Parameters:
- Boolean/String checked + Boolean/String value
-
True, 'true', '1', or 'on' to check the checkbox, any other value will uncheck it.
+
- the value to set
+ +
+ Boolean/String suppressEvent + +
+
- whether to suppress the checkchange event.
@@ -5160,7 +5166,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:08 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.Row.html b/docs/symbols/Roo.form.Row.html index 3c240ad00b..f88b8d8176 100644 --- a/docs/symbols/Roo.form.Row.html +++ b/docs/symbols/Roo.form.Row.html @@ -2671,7 +2671,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.TextArea.html b/docs/symbols/Roo.form.TextArea.html index c9c2dcb618..945fb6f11c 100644 --- a/docs/symbols/Roo.form.TextArea.html +++ b/docs/symbols/Roo.form.TextArea.html @@ -5747,7 +5747,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.TextField.html b/docs/symbols/Roo.form.TextField.html index 8ec8c3dea6..2f41d2ad6e 100644 --- a/docs/symbols/Roo.form.TextField.html +++ b/docs/symbols/Roo.form.TextField.html @@ -5716,7 +5716,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.TriggerField.html b/docs/symbols/Roo.form.TriggerField.html index 4bc0f16aa7..73ddd0ff75 100644 --- a/docs/symbols/Roo.form.TriggerField.html +++ b/docs/symbols/Roo.form.TriggerField.html @@ -5749,7 +5749,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.VTypes.html b/docs/symbols/Roo.form.VTypes.html index 420e7e368a..009d318e3e 100644 --- a/docs/symbols/Roo.form.VTypes.html +++ b/docs/symbols/Roo.form.VTypes.html @@ -434,7 +434,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.form.html b/docs/symbols/Roo.form.html index 00b858bed2..8d2fd67a6c 100644 --- a/docs/symbols/Roo.form.html +++ b/docs/symbols/Roo.form.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:form @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:06 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.AbstractGridView.html b/docs/symbols/Roo.grid.AbstractGridView.html index dc919aa195..43c83bedbf 100644 --- a/docs/symbols/Roo.grid.AbstractGridView.html +++ b/docs/symbols/Roo.grid.AbstractGridView.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:AbstractGridView @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.AbstractSelectionModel.html b/docs/symbols/Roo.grid.AbstractSelectionModel.html index 9c617a9025..a03037abf5 100644 --- a/docs/symbols/Roo.grid.AbstractSelectionModel.html +++ b/docs/symbols/Roo.grid.AbstractSelectionModel.html @@ -1043,7 +1043,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.CellSelectionModel.html b/docs/symbols/Roo.grid.CellSelectionModel.html index fc6886d12a..62f8be4ac6 100644 --- a/docs/symbols/Roo.grid.CellSelectionModel.html +++ b/docs/symbols/Roo.grid.CellSelectionModel.html @@ -1517,7 +1517,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.ColumnModel.html b/docs/symbols/Roo.grid.ColumnModel.html index 7803377fe7..1a86174ce6 100644 --- a/docs/symbols/Roo.grid.ColumnModel.html +++ b/docs/symbols/Roo.grid.ColumnModel.html @@ -3456,7 +3456,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.EditorGrid.html b/docs/symbols/Roo.grid.EditorGrid.html index e5af02f5bf..3b89940bb3 100644 --- a/docs/symbols/Roo.grid.EditorGrid.html +++ b/docs/symbols/Roo.grid.EditorGrid.html @@ -4220,7 +4220,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.Grid.html b/docs/symbols/Roo.grid.Grid.html index 9ff0915152..db3a129502 100644 --- a/docs/symbols/Roo.grid.Grid.html +++ b/docs/symbols/Roo.grid.Grid.html @@ -3899,7 +3899,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.GridEditor.html b/docs/symbols/Roo.grid.GridEditor.html index b0abfb82a5..93cc372c17 100644 --- a/docs/symbols/Roo.grid.GridEditor.html +++ b/docs/symbols/Roo.grid.GridEditor.html @@ -3461,7 +3461,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.GridView.html b/docs/symbols/Roo.grid.GridView.html index c76cff0b0d..018b89b842 100644 --- a/docs/symbols/Roo.grid.GridView.html +++ b/docs/symbols/Roo.grid.GridView.html @@ -1605,7 +1605,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.PropertyGrid.html b/docs/symbols/Roo.grid.PropertyGrid.html index 36746bbc72..a9f7af147b 100644 --- a/docs/symbols/Roo.grid.PropertyGrid.html +++ b/docs/symbols/Roo.grid.PropertyGrid.html @@ -4542,7 +4542,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.RowSelectionModel.html b/docs/symbols/Roo.grid.RowSelectionModel.html index bc9c2c5947..99356b1c41 100644 --- a/docs/symbols/Roo.grid.RowSelectionModel.html +++ b/docs/symbols/Roo.grid.RowSelectionModel.html @@ -2560,7 +2560,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.grid.html b/docs/symbols/Roo.grid.html index c544d84256..764134db97 100644 --- a/docs/symbols/Roo.grid.html +++ b/docs/symbols/Roo.grid.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:grid @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:11 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.html b/docs/symbols/Roo.html index 1f9b542f68..0352bf5907 100644 --- a/docs/symbols/Roo.html +++ b/docs/symbols/Roo.html @@ -2740,7 +2740,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:09 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:03 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.Adapter.html b/docs/symbols/Roo.menu.Adapter.html index 924240c2e5..0f0dab980b 100644 --- a/docs/symbols/Roo.menu.Adapter.html +++ b/docs/symbols/Roo.menu.Adapter.html @@ -2667,7 +2667,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.BaseItem.html b/docs/symbols/Roo.menu.BaseItem.html index 043a552d35..fc7016fa51 100644 --- a/docs/symbols/Roo.menu.BaseItem.html +++ b/docs/symbols/Roo.menu.BaseItem.html @@ -2666,7 +2666,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.CheckItem.html b/docs/symbols/Roo.menu.CheckItem.html index 00415667ee..f7a00f8197 100644 --- a/docs/symbols/Roo.menu.CheckItem.html +++ b/docs/symbols/Roo.menu.CheckItem.html @@ -3093,7 +3093,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.ColorItem.html b/docs/symbols/Roo.menu.ColorItem.html index 2e53546a28..71517058e3 100644 --- a/docs/symbols/Roo.menu.ColorItem.html +++ b/docs/symbols/Roo.menu.ColorItem.html @@ -2661,7 +2661,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.ColorMenu.html b/docs/symbols/Roo.menu.ColorMenu.html index db3c9f8c18..1f88508427 100644 --- a/docs/symbols/Roo.menu.ColorMenu.html +++ b/docs/symbols/Roo.menu.ColorMenu.html @@ -2583,7 +2583,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.DateItem.html b/docs/symbols/Roo.menu.DateItem.html index 69e176c9ef..9650198f89 100644 --- a/docs/symbols/Roo.menu.DateItem.html +++ b/docs/symbols/Roo.menu.DateItem.html @@ -2661,7 +2661,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.DateMenu.html b/docs/symbols/Roo.menu.DateMenu.html index 2a1722777f..045b5634e5 100644 --- a/docs/symbols/Roo.menu.DateMenu.html +++ b/docs/symbols/Roo.menu.DateMenu.html @@ -2583,7 +2583,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.Item.html b/docs/symbols/Roo.menu.Item.html index ccd0162c36..597021ef23 100644 --- a/docs/symbols/Roo.menu.Item.html +++ b/docs/symbols/Roo.menu.Item.html @@ -2819,7 +2819,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.Menu.html b/docs/symbols/Roo.menu.Menu.html index ab884f9128..310fdc1f75 100644 --- a/docs/symbols/Roo.menu.Menu.html +++ b/docs/symbols/Roo.menu.Menu.html @@ -2528,7 +2528,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.MenuMgr.html b/docs/symbols/Roo.menu.MenuMgr.html index 1b2c0a13c8..6bb9aa9b22 100644 --- a/docs/symbols/Roo.menu.MenuMgr.html +++ b/docs/symbols/Roo.menu.MenuMgr.html @@ -299,7 +299,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.Separator.html b/docs/symbols/Roo.menu.Separator.html index 0d10b523e0..b767a9b054 100644 --- a/docs/symbols/Roo.menu.Separator.html +++ b/docs/symbols/Roo.menu.Separator.html @@ -2690,7 +2690,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.TextItem.html b/docs/symbols/Roo.menu.TextItem.html index 86aca2ef73..0137ba30d0 100644 --- a/docs/symbols/Roo.menu.TextItem.html +++ b/docs/symbols/Roo.menu.TextItem.html @@ -84,7 +84,7 @@
- Adds a static text string to a menu, usually used as either a heading or group separator. + Adds a static text string to a menu, usually used as either a heading or group separator.
Note: old style constructor with text is still supported.
@@ -455,6 +455,36 @@ + + +   + + + +
+ text : Boolean + + +
+ +
+
Text to show on item.
+
+ +
+
Text to show on item.
+
+ + + + + + + Roo.menu.TextItem + + + + @@ -524,7 +554,7 @@
new Roo.menu.TextItem - (String text) + (Object cfg) @@ -546,10 +576,10 @@
Parameters:
- String text + Object cfg
-
The text to display
+
Configuration
@@ -2690,7 +2720,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.menu.html b/docs/symbols/Roo.menu.html index 7185fa0fe5..9c6930038f 100644 --- a/docs/symbols/Roo.menu.html +++ b/docs/symbols/Roo.menu.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:menu @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:09 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.state.CookieProvider.html b/docs/symbols/Roo.state.CookieProvider.html index 4a8199e410..a077422d4c 100644 --- a/docs/symbols/Roo.state.CookieProvider.html +++ b/docs/symbols/Roo.state.CookieProvider.html @@ -834,7 +834,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.state.Manager.html b/docs/symbols/Roo.state.Manager.html index c037da5529..00529d58ff 100644 --- a/docs/symbols/Roo.state.Manager.html +++ b/docs/symbols/Roo.state.Manager.html @@ -527,7 +527,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.state.Provider.html b/docs/symbols/Roo.state.Provider.html index 5571e0e7bc..1a0b783037 100644 --- a/docs/symbols/Roo.state.Provider.html +++ b/docs/symbols/Roo.state.Provider.html @@ -686,7 +686,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.state.html b/docs/symbols/Roo.state.html index f4816c0ade..281fa7b164 100644 --- a/docs/symbols/Roo.state.html +++ b/docs/symbols/Roo.state.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:state @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.AsyncTreeNode.html b/docs/symbols/Roo.tree.AsyncTreeNode.html index e019573725..cb7c73caf9 100644 --- a/docs/symbols/Roo.tree.AsyncTreeNode.html +++ b/docs/symbols/Roo.tree.AsyncTreeNode.html @@ -5370,7 +5370,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.ColumnTree.html b/docs/symbols/Roo.tree.ColumnTree.html index e75f8fc62f..3d5e28b73d 100644 --- a/docs/symbols/Roo.tree.ColumnTree.html +++ b/docs/symbols/Roo.tree.ColumnTree.html @@ -407,7 +407,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.DefaultSelectionModel.html b/docs/symbols/Roo.tree.DefaultSelectionModel.html index ed00c90f5c..3414471c41 100644 --- a/docs/symbols/Roo.tree.DefaultSelectionModel.html +++ b/docs/symbols/Roo.tree.DefaultSelectionModel.html @@ -1473,7 +1473,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.MultiSelectionModel.html b/docs/symbols/Roo.tree.MultiSelectionModel.html index 57f9ed471d..032e524488 100644 --- a/docs/symbols/Roo.tree.MultiSelectionModel.html +++ b/docs/symbols/Roo.tree.MultiSelectionModel.html @@ -1286,7 +1286,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreeEditor.html b/docs/symbols/Roo.tree.TreeEditor.html index 7d6cae4634..c98c2925f3 100644 --- a/docs/symbols/Roo.tree.TreeEditor.html +++ b/docs/symbols/Roo.tree.TreeEditor.html @@ -3527,7 +3527,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreeFilter.html b/docs/symbols/Roo.tree.TreeFilter.html index 658929ecf1..44e32c0fd1 100644 --- a/docs/symbols/Roo.tree.TreeFilter.html +++ b/docs/symbols/Roo.tree.TreeFilter.html @@ -443,7 +443,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreeLoader.html b/docs/symbols/Roo.tree.TreeLoader.html index 347c7d889b..a41823685f 100644 --- a/docs/symbols/Roo.tree.TreeLoader.html +++ b/docs/symbols/Roo.tree.TreeLoader.html @@ -1431,7 +1431,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreeNode.html b/docs/symbols/Roo.tree.TreeNode.html index 602709f2be..6386c8894f 100644 --- a/docs/symbols/Roo.tree.TreeNode.html +++ b/docs/symbols/Roo.tree.TreeNode.html @@ -5042,7 +5042,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreeNodeUI.html b/docs/symbols/Roo.tree.TreeNodeUI.html index 743eb85691..b64e23c474 100644 --- a/docs/symbols/Roo.tree.TreeNodeUI.html +++ b/docs/symbols/Roo.tree.TreeNodeUI.html @@ -244,7 +244,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreePanel.html b/docs/symbols/Roo.tree.TreePanel.html index b96c5ace02..11eeb8d1f7 100644 --- a/docs/symbols/Roo.tree.TreePanel.html +++ b/docs/symbols/Roo.tree.TreePanel.html @@ -4047,7 +4047,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.TreeSorter.html b/docs/symbols/Roo.tree.TreeSorter.html index 901f9d3c95..b6e308580e 100644 --- a/docs/symbols/Roo.tree.TreeSorter.html +++ b/docs/symbols/Roo.tree.TreeSorter.html @@ -441,7 +441,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.tree.html b/docs/symbols/Roo.tree.html index c1a3ade40b..e35ec88431 100644 --- a/docs/symbols/Roo.tree.html +++ b/docs/symbols/Roo.tree.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:tree @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.CSS.html b/docs/symbols/Roo.util.CSS.html index 675aa07153..f1a89a76e9 100644 --- a/docs/symbols/Roo.util.CSS.html +++ b/docs/symbols/Roo.util.CSS.html @@ -168,7 +168,7 @@
Roo.util.CSS.createStyleSheet - (String cssText, String id) + (String|Object cssText, String id) : @@ -200,7 +200,7 @@
Parameters:
- String cssText + String|Object cssText
The text containing the css rules
@@ -714,7 +714,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.ClickRepeater.html b/docs/symbols/Roo.util.ClickRepeater.html index 8767352a07..ceaee5221b 100644 --- a/docs/symbols/Roo.util.ClickRepeater.html +++ b/docs/symbols/Roo.util.ClickRepeater.html @@ -1272,7 +1272,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.DelayedTask.html b/docs/symbols/Roo.util.DelayedTask.html index e85ae10fc9..b2fa3826bc 100644 --- a/docs/symbols/Roo.util.DelayedTask.html +++ b/docs/symbols/Roo.util.DelayedTask.html @@ -256,7 +256,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.Format.html b/docs/symbols/Roo.util.Format.html index a0a5e3a9b5..e59ebee4e7 100644 --- a/docs/symbols/Roo.util.Format.html +++ b/docs/symbols/Roo.util.Format.html @@ -1211,7 +1211,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.JSON.html b/docs/symbols/Roo.util.JSON.html index 9dfdbff148..4ca367a80f 100644 --- a/docs/symbols/Roo.util.JSON.html +++ b/docs/symbols/Roo.util.JSON.html @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.MixedCollection.html b/docs/symbols/Roo.util.MixedCollection.html index e72212edcc..a271c5a517 100644 --- a/docs/symbols/Roo.util.MixedCollection.html +++ b/docs/symbols/Roo.util.MixedCollection.html @@ -3266,7 +3266,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.Observable.html b/docs/symbols/Roo.util.Observable.html index c5cfb02878..709f6a7401 100644 --- a/docs/symbols/Roo.util.Observable.html +++ b/docs/symbols/Roo.util.Observable.html @@ -1009,7 +1009,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.TextMetrics.Instance.html b/docs/symbols/Roo.util.TextMetrics.Instance.html index e2b318240b..519e64fe0a 100644 --- a/docs/symbols/Roo.util.TextMetrics.Instance.html +++ b/docs/symbols/Roo.util.TextMetrics.Instance.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:Instance @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.TextMetrics.html b/docs/symbols/Roo.util.TextMetrics.html index ce530b580c..c2c6257b14 100644 --- a/docs/symbols/Roo.util.TextMetrics.html +++ b/docs/symbols/Roo.util.TextMetrics.html @@ -358,7 +358,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/Roo.util.html b/docs/symbols/Roo.util.html index 30b65b1e60..6eaedbac14 100644 --- a/docs/symbols/Roo.util.html +++ b/docs/symbols/Roo.util.html @@ -56,7 +56,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:util @@ -175,7 +175,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/String.html b/docs/symbols/String.html index c14a4483e8..8109220f76 100644 --- a/docs/symbols/String.html +++ b/docs/symbols/String.html @@ -520,7 +520,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/_global_.html b/docs/symbols/_global_.html index 923ec8a30d..0908c2dbd9 100644 --- a/docs/symbols/_global_.html +++ b/docs/symbols/_global_.html @@ -641,7 +641,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/docs/symbols/src/Roo_ContentPanel.js.html b/docs/symbols/src/Roo_ContentPanel.js.html index 4310e88100..f0a3c4f122 100644 --- a/docs/symbols/src/Roo_ContentPanel.js.html +++ b/docs/symbols/src/Roo_ContentPanel.js.html @@ -23,6 +23,7 @@ * @cfg {String} title The title for this panel * @cfg {Array} adjustments Values to <b>add</b> to the width/height when doing a {@link #fitToFrame} (default is [0, 0]) * @cfg {String} url Calls {@link #setUrl} with this value + * @cfg {String} region (center|north|south|east|west) which region to put this panel on (when used with xtype constructors) * @cfg {String/Object} params When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {Boolean} loadOnce When used with {@link #url}, calls {@link #setUrl} with this value * @constructor diff --git a/docs/symbols/src/Roo_JsonView.js.html b/docs/symbols/src/Roo_JsonView.js.html index 7d00bc316f..fdfda0594a 100644 --- a/docs/symbols/src/Roo_JsonView.js.html +++ b/docs/symbols/src/Roo_JsonView.js.html @@ -16,7 +16,7 @@ <pre><code> var view = new Roo.JsonView({ container: "my-element", - template: '&lt;div id="{id}"&gt;{foo} - {bar}&lt;/div&gt;', // auto create template + tpl: '&lt;div id="{id}"&gt;{foo} - {bar}&lt;/div&gt;', // auto create template multiSelect: true, jsonRoot: "data" }); diff --git a/docs/symbols/src/Roo_View.js.html b/docs/symbols/src/Roo_View.js.html index d5c9049b34..bc750b500a 100644 --- a/docs/symbols/src/Roo_View.js.html +++ b/docs/symbols/src/Roo_View.js.html @@ -20,7 +20,7 @@ var view = new Roo.View({ el : "my-element", - template : '&lt;div id="{0}"&gt;{2} - {1}&lt;/div&gt;', // auto create template + tpl : '&lt;div id="{0}"&gt;{2} - {1}&lt;/div&gt;', // auto create template singleSelect: true, selectedClass: "ydataview-selected", @@ -63,7 +63,10 @@ if(typeof(this.tpl) == "string"){ this.tpl = new Roo.Template(this.tpl); - } + } else { + // support xtype ctors.. + this.tpl = new Roo.factory(this.tpl, Roo); + } this.tpl.compile(); @@ -168,6 +171,16 @@ * @cfg {String} emptyText The empty text to show when nothing is loaded. */ emptyText : "", + /** + * @cfg {Boolean} multiSelect Allow multiple selection + */ + + multiSelect : false, + /** + * @cfg {Boolean} singleSelect Allow single selection + */ + singleSelect: false, + /** * Returns the element this view is bound to. * @return {Roo.Element} diff --git a/docs/symbols/src/Roo_XComponent.js.html b/docs/symbols/src/Roo_XComponent.js.html index ebf4429c44..4a312944f5 100644 --- a/docs/symbols/src/Roo_XComponent.js.html +++ b/docs/symbols/src/Roo_XComponent.js.html @@ -237,7 +237,7 @@ // add modules to their parents.. var addMod = function(m) { - // console.log(m.modKey); + // Roo.debug && Roo.log(m.modKey); mods.push(m); if (m.modules) { @@ -270,7 +270,7 @@ var mods = this.buildOrder(); //this.allmods = mods; - //console.log(mods); + //Roo.debug && Roo.log(mods); //return; if (!mods.length) { // should not happen throw "NO modules!!!"; @@ -294,14 +294,14 @@ var _this = this; var progressRun = function() { if (!mods.length) { - console.log('hide?'); + Roo.debug && Roo.log('hide?'); Roo.MessageBox.hide(); _this.topModule.fireEvent('buildcomplete', _this.topModule); return; } var m = mods.shift(); - console.log(m); + Roo.debug && Roo.log(m); if (typeof(m) == 'function') { // not sure if this is supported any more.. m.call(this); return progressRun.defer(10, _this); diff --git a/docs/symbols/src/Roo_form_BasicForm.js.html b/docs/symbols/src/Roo_form_BasicForm.js.html index a923d7b0ce..395b49415f 100644 --- a/docs/symbols/src/Roo_form_BasicForm.js.html +++ b/docs/symbols/src/Roo_form_BasicForm.js.html @@ -305,17 +305,25 @@ clientValidation Boolean Applies to submit only. Pass true to call fo * @param {Roo.form.Form} form to add. * */ - addForm : function(form){ + addForm : function(form) + { + if (this.childForms.indexOf(form) > -1) { + // already added.. + return; + } this.childForms.push(form); Roo.each(form.allItems, function (fe) { if (this.findField(fe.name)) { // already added.. return; } - this.add( new Roo.form.Hidden({ + var add = new Roo.form.Hidden({ name : fe.name - })); + }); + add.render(this.el); + + this.add( add ); }, this); }, @@ -413,13 +421,7 @@ clientValidation Boolean Applies to submit only. Pass true to call fo if (this.childForms) { // copy values from the child forms Roo.each(this.childForms, function (f) { - if (f.allFields) { - Roo.each(f.allFields, function (e) { - if (e.name && e.getValue && this.findField(e.name)) { - this.findField(e.name).setValue(e.getValue()); - } - }); - } + this.setValues(f.getValues()); }, this); } diff --git a/docs/symbols/src/Roo_form_Checkbox.js.html b/docs/symbols/src/Roo_form_Checkbox.js.html index fe560750e1..035d4f0d1c 100644 --- a/docs/symbols/src/Roo_form_Checkbox.js.html +++ b/docs/symbols/src/Roo_form_Checkbox.js.html @@ -155,15 +155,19 @@ /** * Sets the checked state of the checkbox. - * @param {Boolean/String} checked True, 'true', '1', or 'on' to check the checkbox, any other value will uncheck it. + * On is always based on a string comparison between inputValue and the param. + * @param {Boolean/String} value - the value to set + * @param {Boolean/String} suppressEvent - whether to suppress the checkchange event. */ setValue : function(v,suppressEvent){ + + //this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on'); //if(this.el && this.el.dom){ // this.el.dom.checked = this.checked; // this.el.dom.defaultChecked = this.checked; //} - this.setChecked(v === this.inputValue); + this.setChecked(String(v) === String(this.inputValue), suppressEvent); //this.fireEvent("check", this, this.checked); }, // private.. diff --git a/docs/symbols/src/Roo_menu_Menu.js.html b/docs/symbols/src/Roo_menu_Menu.js.html index b2cbf42100..4a1a123f91 100644 --- a/docs/symbols/src/Roo_menu_Menu.js.html +++ b/docs/symbols/src/Roo_menu_Menu.js.html @@ -362,6 +362,10 @@ var item = menu.add( var a = arguments, l = a.length, item; for(var i = 0; i < l; i++){ var el = a[i]; + if ((typeof(el) == "object") && el.xtype && el.xns) { + el = Roo.factory(el, Roo.menu); + } + if(el.render){ // some kind of Item item = this.addItem(el); }else if(typeof el == "string"){ // string @@ -446,7 +450,7 @@ var item = menu.add( * @return {Roo.menu.Item} The menu item that was added */ addText : function(text){ - return this.addItem(new Roo.menu.TextItem(text)); + return this.addItem(new Roo.menu.TextItem({ text : text })); }, /** diff --git a/docs/symbols/src/Roo_menu_TextItem.js.html b/docs/symbols/src/Roo_menu_TextItem.js.html index ac3a278fb5..c7128a10c2 100644 --- a/docs/symbols/src/Roo_menu_TextItem.js.html +++ b/docs/symbols/src/Roo_menu_TextItem.js.html @@ -13,16 +13,28 @@ * @class Roo.menu.TextItem * @extends Roo.menu.BaseItem * Adds a static text string to a menu, usually used as either a heading or group separator. + * Note: old style constructor with text is still supported. + * * @constructor * Creates a new TextItem - * @param {String} text The text to display + * @param {Object} cfg Configuration */ -Roo.menu.TextItem = function(text){ - this.text = text; +Roo.menu.TextItem = function(cfg){ + if (typeof(cfg) == 'string') { + this.text = cfg; + } else { + Roo.apply(this,cfg); + } + Roo.menu.TextItem.superclass.constructor.call(this); }; Roo.extend(Roo.menu.TextItem, Roo.menu.BaseItem, { + /** + * @cfg {Boolean} text Text to show on item. + */ + text : '', + /** * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false) */ diff --git a/docs/symbols/src/Roo_util_CSS.js.html b/docs/symbols/src/Roo_util_CSS.js.html index 287dde3c00..ca44e51fb9 100644 --- a/docs/symbols/src/Roo_util_CSS.js.html +++ b/docs/symbols/src/Roo_util_CSS.js.html @@ -26,30 +26,49 @@ /** * Very simple dynamic creation of stylesheets from a text blob of rules. The text will wrapped in a style * tag and appended to the HEAD of the document. - * @param {String} cssText The text containing the css rules + * @param {String|Object} cssText The text containing the css rules * @param {String} id An id to add to the stylesheet for later removal * @return {StyleSheet} */ - createStyleSheet : function(cssText, id){ - var ss; - var head = doc.getElementsByTagName("head")[0]; - var rules = doc.createElement("style"); - rules.setAttribute("type", "text/css"); - if(id){ - rules.setAttribute("id", id); - } + createStyleSheet : function(cssText, id){ + var ss; + var head = doc.getElementsByTagName("head")[0]; + var nrules = doc.createElement("style"); + nrules.setAttribute("type", "text/css"); + if(id){ + nrules.setAttribute("id", id); + } + if (typeof(cssText) != 'string') { + // support object maps.. + // not sure if this a good idea.. + // perhaps it should be merged with the general css handling + // and handle js style props. + var cssTextNew = []; + for(var n in cssText) { + var citems = []; + for(var k in cssText[n]) { + citems.push( k + ' : ' +cssText[n][k] + ';' ); + } + cssTextNew.push( n + ' { ' + citems.join(' ') + '} '); + + } + cssText = cssTextNew.join("\n"); + + } + + if(Roo.isIE){ - head.appendChild(rules); - ss = rules.styleSheet; + head.appendChild(nrules); + ss = nrules.styleSheet; ss.cssText = cssText; }else{ try{ - rules.appendChild(doc.createTextNode(cssText)); + nrules.appendChild(doc.createTextNode(cssText)); }catch(e){ - rules.cssText = cssText; + nrules.cssText = cssText; } - head.appendChild(rules); - ss = rules.styleSheet ? rules.styleSheet : (rules.sheet || doc.styleSheets[doc.styleSheets.length-1]); + head.appendChild(nrules); + ss = nrules.styleSheet ? nrules.styleSheet : (nrules.sheet || doc.styleSheets[doc.styleSheets.length-1]); } this.cacheStyleSheet(ss); return ss; @@ -90,12 +109,12 @@ }, // private - cacheStyleSheet : function(ss){ + cacheStyleSheet : function(stylesheet){ if(!rules){ rules = {}; } try{// try catch for cross domain access issue - var ssRules = ss.cssRules || ss.rules; + var ssRules = stylesheet.cssRules || stylesheet.rules; for(var j = ssRules.length-1; j >= 0; --j){ rules[ssRules[j].selectorText] = ssRules[j]; } diff --git a/docs/symbols/this.html b/docs/symbols/this.html index e6fd7eefb3..ddcbce1bcb 100644 --- a/docs/symbols/this.html +++ b/docs/symbols/this.html @@ -54,7 +54,7 @@ Defined In: - Roo/Template.js. + Roo/util/TextMetrics.js. Class:this @@ -173,7 +173,7 @@
- Documentation generated by Introspection Doc Generator on Wed Jul 28 2010 13:02:12 GMT+0800 (HKT) + Documentation generated by Introspection Doc Generator on Sat Jul 31 2010 18:30:10 GMT+0800 (HKT) Based on JsDoc Toolkit
diff --git a/roojs-all.js b/roojs-all.js index 7bd2b9167b..58e76eddbc 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1,64 +1,64 @@ -window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var B=0;var ua=navigator.userAgent.toLowerCase();var C=document.compatMode=="CSS1Compat",D=ua.indexOf("opera")>-1,E=(/webkit|khtml/).test(ua),F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=!E&&ua.indexOf("gecko")>-1,I=F&&!C,J=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),K=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),L=(ua.indexOf("linux")!=-1),M=window.location.href.toLowerCase().indexOf("https")===0;if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}} -Roo.apply(Roo,{isStrict:C,isSecure:M,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var N={};for(var b in o){var parts=b.split('@');if(parts[1]){var s=parts[0];if(!N[s]){N[s]=Roo.select(s);} -N[s].on(parts[1],o[b]);}} -N=null;},id:function(el,O){O=O||"roo-gen";el=Roo.getDom(el);var id=O+(++B);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,P){if(typeof sp=='object'){P=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp;} -sb.override=function(o){Roo.override(sb,o);};sbp.override=io;Roo.override(sb,P);return sb;};}(),override:function(P,Q){if(Q){var p=P.prototype;for(var method in Q){p[method]=Q[method];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("msie")>-1,F=ua.indexOf("msie 7")>-1,G=!D&&ua.indexOf("gecko")>-1,H=E&&!B,I=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),J=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),K=(ua.indexOf("linux")!=-1),L=window.location.href.toLowerCase().indexOf("https")===0;if(E&&!F){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}} +Roo.apply(Roo,{isStrict:B,isSecure:L,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var M={};for(var b in o){var parts=b.split('@');if(parts[1]){var s=parts[0];if(!M[s]){M[s]=Roo.select(s);} +M[s].on(parts[1],o[b]);}} +M=null;},id:function(el,M){M=M||"roo-gen";el=Roo.getDom(el);var id=M+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,M){if(typeof sp=='object'){M=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp;} +sb.override=function(o){Roo.override(sb,o);};sbp.override=io;Roo.override(sb,M);return sb;};}(),override:function(M,N){if(N){var p=M.prototype;for(var method in N){p[method]=N[method];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i>>0;if(typeof B!="function")throw new TypeError();var D=new Array(C);var E=arguments[1];for(var i=0;i 0) {";var Q="";var R=false;var ch='';for(var i=0;i= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"+"{v = new Date(y, m, d, h, i);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"+"{v = new Date(y, m, d, h);}\n"+"else if (y >= 0 && m >= 0 && d > 0)\n"+"{v = new Date(y, m, d);}\n"+"else if (y >= 0 && m >= 0)\n"+"{v = new Date(y, m);}\n"+"else if (y >= 0)\n"+"{v = new Date(y);}\n"+"}return (v && (z || o))?\n"+" ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"+" v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"+";}";Date.parseRegexes[N]=new RegExp("^"+Q+"$");eval(P);};Date.formatCodeToRegex=function(S,T){switch(S){case "D":return {g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case "j":return {g:1,c:"d = parseInt(results["+T+"], 10);\n",s:"(\\d{1,2})"};case "d":return {g:1,c:"d = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "l":return {g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case "S":return {g:0,c:null,s:"(?:st|nd|rd|th)"};case "w":return {g:0,c:null,s:"\\d"};case "z":return {g:0,c:null,s:"(?:\\d{1,3})"};case "W":return {g:0,c:null,s:"(?:\\d{2})"};case "F":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+T+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+T+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+T+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = parseInt(results["+T+"], 10) - 1;\n",s:"(\\d{2})"};case "t":return {g:0,c:null,s:"\\d{1,2}"};case "L":return {g:0,c:null,s:"(?:1|0)"};case "Y":return {g:1,c:"y = parseInt(results["+T+"], 10);\n",s:"(\\d{4})"};case "y":return {g:1,c:"var ty = parseInt(results["+T+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case "a":return {g:1,c:"if (results["+T+"] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case "A":return {g:1,c:"if (results["+T+"] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case "g":case "G":return {g:1,c:"h = parseInt(results["+T+"], 10);\n",s:"(\\d{1,2})"};case "h":case "H":return {g:1,c:"h = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "i":return {g:1,c:"i = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "s":return {g:1,c:"s = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "O":return {g:1,c:["o = results[",T,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n","var mn = o.substring(3,5) % 60;\n","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n"," (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"].join(""),s:"([+\-]\\d{4})"};case "T":return {g:0,c:null,s:"[A-Z]{1,4}"};case "Z":return {g:1,c:"z = results["+T+"];\n"+"z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+\-]?\\d{1,5})"};default:return {g:0,c:null,s:String.escape(S)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1");};Date.prototype.getGMTOffset=function(){return (this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+String.leftPad(this.getTimezoneOffset()%60,2,"0");};Date.prototype.getDayOfYear=function(){var U=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var i=0;i28){a=Math.min(a,this.getFirstDateOfMonth().add('mo',f).getLastDateOfMonth().getDate());} -d.setDate(a);d.setMonth(this.getMonth()+f);break;case Date.YEAR:d.setFullYear(this.getFullYear()+f);break;}return d;}; -Roo.lib.Dom={getViewWidth:function(A){return A?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(B){return B?this.getDocumentHeight():this.getViewportHeight();},getDocumentHeight:function(){var C=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(C,this.getViewportHeight());},getDocumentWidth:function(){var D=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(D,this.getViewportWidth());},getViewportHeight:function(){var E=self.innerHeight;var F=document.compatMode;if((F||Roo.isIE)&&!Roo.isOpera){E=(F=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return E;},getViewportWidth:function(){var G=self.innerWidth;var H=document.compatMode;if(H||Roo.isIE){G=(H=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;}return G;},isAncestor:function(p,c){p=Roo.getDom(p);c=Roo.getDom(c);if(!p||!c){return false;}if(p.contains&&!Roo.isSafari){return p.contains(c);}else if(p.compareDocumentPosition){return !!(p.compareDocumentPosition(c)&16);}else {var parent=c.parentNode;while(parent){if(parent==p){return true;}else if(!parent.tagName||parent.tagName.toUpperCase()=="HTML"){return false;} -parent=parent.parentNode;}return false;}},getRegion:function(el){return Roo.lib.Region.getRegion(el);},getY:function(el){return this.getXY(el)[1];},getX:function(el){return this.getXY(el)[0];},getXY:function(el){var p,pe,b,I,bd=document.body;el=Roo.getDom(el);var J=Roo.lib.AnimBase.fly;if(el.getBoundingClientRect){b=el.getBoundingClientRect();I=J(document).getScroll();return [b.left+I.left,b.top+I.top];}var x=0,y=0;p=el;var K=J(el).getStyle("position")=="absolute";while(p){x+=p.offsetLeft;y+=p.offsetTop;if(!K&&J(p).getStyle("position")=="absolute"){K=true;}if(Roo.isGecko){pe=J(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle('overflow')!='visible'){x+=bl;y+=bt;}} -p=p.offsetParent;}if(Roo.isSafari&&K){x-=bd.offsetLeft;y-=bd.offsetTop;}if(Roo.isGecko&&!K){var dbd=J(bd);x+=parseInt(dbd.getStyle("borderLeftWidth"),10)||0;y+=parseInt(dbd.getStyle("borderTopWidth"),10)||0;} -p=el.parentNode;while(p&&p!=bd){if(!Roo.isOpera||(p.tagName!='TR'&&J(p).getStyle("display")!="inline")){x-=p.scrollLeft;y-=p.scrollTop;} -p=p.parentNode;}return [x,y];},setXY:function(el,xy){el=Roo.fly(el,'_setXY');el.position();var L=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=L.left+"px";}if(xy[1]!==false){el.dom.style.top=L.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);},setY:function(el,y){this.setXY(el,[false,y]);}}; -Roo.lib.Event=function(){var A=false;var B=[];var C=[];var D=0;var E=[];var F=0;var G=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(h,k,m,n){E.push({id:h,fn:k,obj:m,override:n,checkReady:false});D=this.POLL_RETRYS;this.startInterval();},addListener:function(el,o,fn){el=Roo.getDom(el);if(!el||!fn){return false;}if("unload"==o){C[C.length]=[el,o,fn];return true;}var p=function(e){return fn(Roo.lib.Event.getEvent(e));};var li=[el,o,fn,p];var q=B.length;B[q]=li;this.doAdd(el,o,p,false);return true;},removeListener:function(el,r,fn){var i,s;el=Roo.getDom(el);if(!fn){return this.purgeElement(el,false,r);}if("unload"==r){for(i=0,s=C.length;i=0){u=B[v];}if(!el||!u){return false;} -this.doRemove(el,r,u[this.WFN],false);delete B[v][this.WFN];delete B[v][this.FN];B.splice(v,1);return true;},getTarget:function(ev,w){ev=ev.browserEvent||ev;var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(z){if(Roo.isSafari&&z&&3==z.nodeType){return z.parentNode;}else {return z;}},getPageX:function(ev){ev=ev.browserEvent||ev;var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(Roo.isIE){x+=this.getScroll()[1];}}return x;},getPageY:function(ev){ev=ev.browserEvent||ev;var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(Roo.isIE){y+=this.getScroll()[0];}}return y;},getXY:function(ev){ev=ev.browserEvent||ev;return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}return this.resolveTextNode(t);},getTime:function(ev){ev=ev.browserEvent||ev;if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){ev=ev.browserEvent||ev;if(ev.stopPropagation){ev.stopPropagation();}else {ev.cancelBubble=true;}},preventDefault:function(ev){ev=ev.browserEvent||ev;if(ev.preventDefault){ev.preventDefault();}else {ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;} -c=c.caller;}}return ev;},getCharCode:function(ev){ev=ev.browserEvent||ev;return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,AA,fn){for(var i=0,s=B.length;i0);}var AC=[];for(var i=0,s=E.length;i0){for(var i=0,s=searchList.length;i>>0;if(typeof A!="function")throw new TypeError();var C=new Array(B);var D=arguments[1];for(var i=0;i 0) {";var F="";var G=false;var ch='';for(var i=0;i= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"+"{v = new Date(y, m, d, h, i);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"+"{v = new Date(y, m, d, h);}\n"+"else if (y >= 0 && m >= 0 && d > 0)\n"+"{v = new Date(y, m, d);}\n"+"else if (y >= 0 && m >= 0)\n"+"{v = new Date(y, m);}\n"+"else if (y >= 0)\n"+"{v = new Date(y);}\n"+"}return (v && (z || o))?\n"+" ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"+" v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"+";}";Date.parseRegexes[C]=new RegExp("^"+F+"$");eval(E);};Date.formatCodeToRegex=function(A,B){switch(A){case "D":return {g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case "j":return {g:1,c:"d = parseInt(results["+B+"], 10);\n",s:"(\\d{1,2})"};case "d":return {g:1,c:"d = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "l":return {g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case "S":return {g:0,c:null,s:"(?:st|nd|rd|th)"};case "w":return {g:0,c:null,s:"\\d"};case "z":return {g:0,c:null,s:"(?:\\d{1,3})"};case "W":return {g:0,c:null,s:"(?:\\d{2})"};case "F":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+B+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+B+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{2})"};case "t":return {g:0,c:null,s:"\\d{1,2}"};case "L":return {g:0,c:null,s:"(?:1|0)"};case "Y":return {g:1,c:"y = parseInt(results["+B+"], 10);\n",s:"(\\d{4})"};case "y":return {g:1,c:"var ty = parseInt(results["+B+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case "a":return {g:1,c:"if (results["+B+"] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case "A":return {g:1,c:"if (results["+B+"] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case "g":case "G":return {g:1,c:"h = parseInt(results["+B+"], 10);\n",s:"(\\d{1,2})"};case "h":case "H":return {g:1,c:"h = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "i":return {g:1,c:"i = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "s":return {g:1,c:"s = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "O":return {g:1,c:["o = results[",B,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n","var mn = o.substring(3,5) % 60;\n","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n"," (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"].join(""),s:"([+\-]\\d{4})"};case "T":return {g:0,c:null,s:"[A-Z]{1,4}"};case "Z":return {g:1,c:"z = results["+B+"];\n"+"z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+\-]?\\d{1,5})"};default:return {g:0,c:null,s:String.escape(A)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1");};Date.prototype.getGMTOffset=function(){return (this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+String.leftPad(this.getTimezoneOffset()%60,2,"0");};Date.prototype.getDayOfYear=function(){var A=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var i=0;i28){day=Math.min(day,this.getFirstDateOfMonth().add('mo',B).getLastDateOfMonth().getDate());} +d.setDate(day);d.setMonth(this.getMonth()+B);break;case Date.YEAR:d.setFullYear(this.getFullYear()+B);break;}return d;}; +Roo.lib.Dom={getViewWidth:function(A){return A?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(A){return A?this.getDocumentHeight():this.getViewportHeight();},getDocumentHeight:function(){var A=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(A,this.getViewportHeight());},getDocumentWidth:function(){var A=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(A,this.getViewportWidth());},getViewportHeight:function(){var A=self.innerHeight;var B=document.compatMode;if((B||Roo.isIE)&&!Roo.isOpera){A=(B=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return A;},getViewportWidth:function(){var A=self.innerWidth;var B=document.compatMode;if(B||Roo.isIE){A=(B=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;}return A;},isAncestor:function(p,c){p=Roo.getDom(p);c=Roo.getDom(c);if(!p||!c){return false;}if(p.contains&&!Roo.isSafari){return p.contains(c);}else if(p.compareDocumentPosition){return !!(p.compareDocumentPosition(c)&16);}else {var parent=c.parentNode;while(parent){if(parent==p){return true;}else if(!parent.tagName||parent.tagName.toUpperCase()=="HTML"){return false;} +parent=parent.parentNode;}return false;}},getRegion:function(el){return Roo.lib.Region.getRegion(el);},getY:function(el){return this.getXY(el)[1];},getX:function(el){return this.getXY(el)[0];},getXY:function(el){var p,pe,b,A,bd=document.body;el=Roo.getDom(el);var B=Roo.lib.AnimBase.fly;if(el.getBoundingClientRect){b=el.getBoundingClientRect();A=B(document).getScroll();return [b.left+A.left,b.top+A.top];}var x=0,y=0;p=el;var C=B(el).getStyle("position")=="absolute";while(p){x+=p.offsetLeft;y+=p.offsetTop;if(!C&&B(p).getStyle("position")=="absolute"){C=true;}if(Roo.isGecko){pe=B(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle('overflow')!='visible'){x+=bl;y+=bt;}} +p=p.offsetParent;}if(Roo.isSafari&&C){x-=bd.offsetLeft;y-=bd.offsetTop;}if(Roo.isGecko&&!C){var dbd=B(bd);x+=parseInt(dbd.getStyle("borderLeftWidth"),10)||0;y+=parseInt(dbd.getStyle("borderTopWidth"),10)||0;} +p=el.parentNode;while(p&&p!=bd){if(!Roo.isOpera||(p.tagName!='TR'&&B(p).getStyle("display")!="inline")){x-=p.scrollLeft;y-=p.scrollTop;} +p=p.parentNode;}return [x,y];},setXY:function(el,xy){el=Roo.fly(el,'_setXY');el.position();var A=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=A.left+"px";}if(xy[1]!==false){el.dom.style.top=A.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);},setY:function(el,y){this.setXY(el,[false,y]);}}; +Roo.lib.Event=function(){var A=false;var B=[];var C=[];var D=0;var E=[];var F=0;var G=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(H,I,J,K){E.push({id:H,fn:I,obj:J,override:K,checkReady:false});D=this.POLL_RETRYS;this.startInterval();},addListener:function(el,H,fn){el=Roo.getDom(el);if(!el||!fn){return false;}if("unload"==H){C[C.length]=[el,H,fn];return true;}var I=function(e){return fn(Roo.lib.Event.getEvent(e));};var li=[el,H,fn,I];var J=B.length;B[J]=li;this.doAdd(el,H,I,false);return true;},removeListener:function(el,H,fn){var i,I;el=Roo.getDom(el);if(!fn){return this.purgeElement(el,false,H);}if("unload"==H){for(i=0,I=C.length;i=0){J=B[K];}if(!el||!J){return false;} +this.doRemove(el,H,J[this.WFN],false);delete B[K][this.WFN];delete B[K][this.FN];B.splice(K,1);return true;},getTarget:function(ev,H){ev=ev.browserEvent||ev;var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(H){if(Roo.isSafari&&H&&3==H.nodeType){return H.parentNode;}else {return H;}},getPageX:function(ev){ev=ev.browserEvent||ev;var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(Roo.isIE){x+=this.getScroll()[1];}}return x;},getPageY:function(ev){ev=ev.browserEvent||ev;var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(Roo.isIE){y+=this.getScroll()[0];}}return y;},getXY:function(ev){ev=ev.browserEvent||ev;return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}return this.resolveTextNode(t);},getTime:function(ev){ev=ev.browserEvent||ev;if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){ev=ev.browserEvent||ev;if(ev.stopPropagation){ev.stopPropagation();}else {ev.cancelBubble=true;}},preventDefault:function(ev){ev=ev.browserEvent||ev;if(ev.preventDefault){ev.preventDefault();}else {ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;} +c=c.caller;}}return ev;},getCharCode:function(ev){ev=ev.browserEvent||ev;return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,H,fn){for(var i=0,len=B.length;i0);}var I=[];for(var i=0,len=E.length;i0){for(var i=0,len=searchList.length;i0){j=B.length;while(j){AK=j-1;l=B[AK];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],AK);} +C=null;if(B&&B.length>0){j=B.length;while(j){I=j-1;l=B[I];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],I);} 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,AL,fn,AM){el.addEventListener(AL,fn,(AM));};}else if(window.attachEvent){return function(el,AL,fn,AM){el.attachEvent("on"+AL,fn);};}else {return function(){};}}(),doRemove:function(){if(window.removeEventListener){return function(el,AL,fn,AM){el.removeEventListener(AL,fn,(AM));};}else if(window.detachEvent){return function(el,AL,fn){el.detachEvent("on"+AL,fn);};}else {return function(){};}}()};}();(function(){var E=Roo.lib.Event;E.on=E.addListener;E.un=E.removeListener;if(document&&document.body){E._load();}else {E.doAdd(window,"load",E._load);} +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,H,fn,I){el.addEventListener(H,fn,(I));};}else if(window.attachEvent){return function(el,H,fn,I){el.attachEvent("on"+H,fn);};}else {return function(){};}}(),doRemove:function(){if(window.removeEventListener){return function(el,H,fn,I){el.removeEventListener(H,fn,(I));};}else if(window.detachEvent){return function(el,H,fn){el.detachEvent("on"+H,fn);};}else {return function(){};}}()};}();(function(){var E=Roo.lib.Event;E.on=E.addListener;E.un=E.removeListener;if(document&&document.body){E._load();}else {E.doAdd(window,"load",E._load);} E.doAdd(window,"unload",E._unload);E._tryPreloadAttach();})(); -(function(){Roo.lib.Ajax={request:function(A,B,cb,C,D){if(D){var hs=D.headers;if(hs){for(var h in hs){if(hs.hasOwnProperty(h)){this.initHeader(h,hs[h],false);}}}if(D.xmlData){this.initHeader('Content-Type','text/xml',false);A='POST';C=D.xmlData;}}return this.asyncRequest(A,B,cb,C);},serializeForm:function(E){if(typeof E=='string'){E=(document.getElementById(E)||document.forms[E]);}var el,F,G,H,I='',J=false;for(var i=0;i=200&&W<300){X=this.createResponseObject(o,U.argument);if(U.success){if(!U.scope){U.success(X);}else {U.success.apply(U.scope,[X]);}}}else {switch(W){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:X=this.createExceptionObject(o.tId,U.argument,(V?V:false));if(U.failure){if(!U.scope){U.failure(X);}else {U.failure.apply(U.scope,[X]);}}break;default:X=this.createResponseObject(o,U.argument);if(U.failure){if(!U.scope){U.failure(X);}else {U.failure.apply(U.scope,[X]);}}}} -this.releaseObject(o);X=null;},createResponseObject:function(o,Y){var Z={};var a={};try{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);},getArea:function(){return ((this.bottom-this.top)*(this.right-this.left));},intersect:function(B){var t=Math.max(this.top,B.top);var r=Math.min(this.right,B.right);var b=Math.min(this.bottom,B.bottom);var l=Math.max(this.left,B.left);if(b>=t&&r>=l){return new Roo.lib.Region(t,r,b,l);}else {return null;}},union:function(C){var t=Math.min(this.top,C.top);var r=Math.max(this.right,C.right);var b=Math.max(this.bottom,C.bottom);var l=Math.min(this.left,C.left);return new Roo.lib.Region(t,r,b,l);},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;}};Roo.lib.Region.getRegion=function(el){var p=Roo.lib.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Roo.lib.Region(t,r,b,l);}; +(function(){Roo.lib.Ajax={request:function(A,B,cb,C,D){if(D){var hs=D.headers;if(hs){for(var h in hs){if(hs.hasOwnProperty(h)){this.initHeader(h,hs[h],false);}}}if(D.xmlData){this.initHeader('Content-Type','text/xml',false);A='POST';C=D.xmlData;}}return this.asyncRequest(A,B,cb,C);},serializeForm:function(A){if(typeof A=='string'){A=(document.getElementById(A)||document.forms[A]);}var el,B,C,D,E='',F=false;for(var i=0;i=200&&C<300){D=this.createResponseObject(o,A.argument);if(A.success){if(!A.scope){A.success(D);}else {A.success.apply(A.scope,[D]);}}}else {switch(C){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:D=this.createExceptionObject(o.tId,A.argument,(B?B:false));if(A.failure){if(!A.scope){A.failure(D);}else {A.failure.apply(A.scope,[D]);}}break;default:D=this.createResponseObject(o,A.argument);if(A.failure){if(!A.scope){A.failure(D);}else {A.failure.apply(A.scope,[D]);}}}} +this.releaseObject(o);D=null;},createResponseObject:function(o,A){var B={};var C={};try{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);},getArea:function(){return ((this.bottom-this.top)*(this.right-this.left));},intersect:function(A){var t=Math.max(this.top,A.top);var r=Math.min(this.right,A.right);var b=Math.min(this.bottom,A.bottom);var l=Math.max(this.left,A.left);if(b>=t&&r>=l){return new Roo.lib.Region(t,r,b,l);}else {return null;}},union:function(A){var t=Math.min(this.top,A.top);var r=Math.max(this.right,A.right);var b=Math.max(this.bottom,A.bottom);var l=Math.min(this.left,A.left);return new Roo.lib.Region(t,r,b,l);},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;}};Roo.lib.Region.getRegion=function(el){var p=Roo.lib.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Roo.lib.Region(t,r,b,l);}; Roo.lib.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];} this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};Roo.lib.Point.prototype=new Roo.lib.Region(); -(function(){Roo.lib.Anim={scroll:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.Scroll);},motion:function(el,E,F,G,cb,H){this.run(el,E,F,G,cb,H,Roo.lib.Motion);},color:function(el,I,J,K,cb,L){this.run(el,I,J,K,cb,L,Roo.lib.ColorAnim);},run:function(el,M,N,O,cb,P,Q){Q=Q||Roo.lib.AnimBase;if(typeof O=="string"){O=Roo.lib.Easing[O];}var R=new Q(el,M,N,O);R.animateX(function(){Roo.callback(cb,P);});return R;}};})(); +(function(){Roo.lib.Anim={scroll:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.Scroll);},motion:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.Motion);},color:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.ColorAnim);},run:function(el,A,B,C,cb,D,E){E=E||Roo.lib.AnimBase;if(typeof C=="string"){C=Roo.lib.Easing[C];}var F=new E(el,A,B,C);F.animateX(function(){Roo.callback(cb,D);});return F;}};})(); (function(){var A;function B(el){if(!A){A=new Roo.Element.Flyweight();} A.dom=el;return A;} -Roo.lib.AnimBase=function(el,C,D,E){if(el){this.init(el,C,D,E);}};Roo.lib.AnimBase.fly=B;Roo.lib.AnimBase.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return ("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,D,E){return this.method(this.currentFrame,D,E-D,this.totalFrames);},setAttribute:function(F,G,H){if(this.patterns.noNegatives.test(F)){G=(G>0)?G:0;} -Roo.fly(this.getEl(),'_anim').setStyle(F,G+H);},getAttribute:function(I){var el=this.getEl();var J=B(el).getStyle(I);if(J!=='auto'&&!this.patterns.offsetUnit.test(J)){return parseFloat(J);}var a=this.patterns.offsetAttribute.exec(I)||[];var K=!!(a[3]);var L=!!(a[2]);if(L||(B(el).getStyle('position')=='absolute'&&K)){J=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else {J=0;}return J;},getDefaultUnit:function(M){if(this.patterns.defaultUnit.test(M)){return 'px';}return '';},animateX:function(N,O){var f=function(){this.onComplete.removeListener(f);if(typeof N=="function"){N.call(O||this,this);}};this.onComplete.addListener(f,this);this.animate();},setRuntimeAttribute:function(P){var Q;var R;var S=this.attributes;this.runtimeAttributes[P]={};var T=function(U){return (typeof U!=='undefined');};if(!T(S[P]['to'])&&!T(S[P]['by'])){return false;} -Q=(T(S[P]['from']))?S[P]['from']:this.getAttribute(P);if(T(S[P]['to'])){R=S[P]['to'];}else if(T(S[P]['by'])){if(Q.constructor==Array){R=[];for(var i=0,len=Q.length;i0)?D:0;} +Roo.fly(this.getEl(),'_anim').setStyle(C,D+E);},getAttribute:function(C){var el=this.getEl();var D=B(el).getStyle(C);if(D!=='auto'&&!this.patterns.offsetUnit.test(D)){return parseFloat(D);}var a=this.patterns.offsetAttribute.exec(C)||[];var E=!!(a[3]);var F=!!(a[2]);if(F||(B(el).getStyle('position')=='absolute'&&E)){D=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else {D=0;}return D;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return 'px';}return '';},animateX:function(C,D){var f=function(){this.onComplete.removeListener(f);if(typeof C=="function"){C.call(D||this,this);}};this.onComplete.addListener(f,this);this.animate();},setRuntimeAttribute:function(C){var D;var E;var F=this.attributes;this.runtimeAttributes[C]={};var G=function(H){return (typeof H!=='undefined');};if(!G(F[C]['to'])&&!G(F[C]['by'])){return false;} +D=(G(F[C]['from']))?F[C]['from']:this.getAttribute(C);if(G(F[C]['to'])){E=F[C]['to'];}else if(G(F[C]['by'])){if(D.constructor==Array){E=[];for(var i=0,len=D.length;i "'+d+'"';}var f=el.ownerDocument.createRange();var g;switch(d){case "beforebegin":f.setStartBefore(el);g=f.createContextualFragment(e);el.parentNode.insertBefore(g,el);return el.previousSibling;case "afterbegin":if(el.firstChild){f.setStartBefore(el.firstChild);g=f.createContextualFragment(e);el.insertBefore(g,el.firstChild);return el.firstChild;}else {el.innerHTML=e;return el.firstChild;}case "beforeend":if(el.lastChild){f.setStartAfter(el.lastChild);g=f.createContextualFragment(e);el.appendChild(g);return el.lastChild;}else {el.innerHTML=e;return el.lastChild;}case "afterend":f.setStartAfter(el);g=f.createContextualFragment(e);el.parentNode.insertBefore(g,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+d+'"';},insertBefore:function(el,o,h){return this.doInsert(el,o,h,"beforeBegin");},insertAfter:function(el,o,j){return this.doInsert(el,o,j,"afterEnd","nextSibling");},insertFirst:function(el,o,k){return this.doInsert(el,o,k,"afterBegin");},doInsert:function(el,o,l,m,n){el=Roo.getDom(el);var p;if(this.useDom||o.ns){p=F(o,null);el.parentNode.insertBefore(p,n?el[n]:el);}else {var e=E(o);p=this.insertHtml(m,el,e);}return l?Roo.get(p,true):p;},append:function(el,o,q){el=Roo.getDom(el);var r;if(this.useDom||o.ns){r=F(o,null);el.appendChild(r);}else {var e=E(o);r=this.insertHtml("beforeEnd",el,e);}return q?Roo.get(r,true):r;},overwrite:function(el,o,t){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);} -F(o,el);}else {el.innerHTML=E(o);}return t?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var u=E(o);return new Roo.Template(u);}};}(); -Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}if(typeof(A)=='object'){Roo.apply(this,A)}else {this.html=A;}};Roo.Template.prototype={html:'',applyTemplate:function(values){try{if(this.compiled){return this.compiled(values);}var useF=this.disableFormats!==true;var fm=Roo.util.Format,tpl=this;var fn=function(m,E,F,G){if(F&&useF){if(F.substr(0,5)=="this."){return tpl.call(F.substr(5),values[E],values);}else {if(G){var re=/^\s*['"](.*)["']\s*$/;G=G.split(',');for(var i=0,len=G.length;i "'+M+'"';}var O=el.ownerDocument.createRange();var P;switch(M){case "beforebegin":O.setStartBefore(el);P=O.createContextualFragment(N);el.parentNode.insertBefore(P,el);return el.previousSibling;case "afterbegin":if(el.firstChild){O.setStartBefore(el.firstChild);P=O.createContextualFragment(N);el.insertBefore(P,el.firstChild);return el.firstChild;}else {el.innerHTML=N;return el.firstChild;}case "beforeend":if(el.lastChild){O.setStartAfter(el.lastChild);P=O.createContextualFragment(N);el.appendChild(P);return el.lastChild;}else {el.innerHTML=N;return el.lastChild;}case "afterend":O.setStartAfter(el);P=O.createContextualFragment(N);el.parentNode.insertBefore(P,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+M+'"';},insertBefore:function(el,o,M){return this.doInsert(el,o,M,"beforeBegin");},insertAfter:function(el,o,M){return this.doInsert(el,o,M,"afterEnd","nextSibling");},insertFirst:function(el,o,M){return this.doInsert(el,o,M,"afterBegin");},doInsert:function(el,o,M,N,O){el=Roo.getDom(el);var P;if(this.useDom||o.ns){P=F(o,null);el.parentNode.insertBefore(P,O?el[O]:el);}else {var html=E(o);P=this.insertHtml(N,el,html);}return M?Roo.get(P,true):P;},append:function(el,o,M){el=Roo.getDom(el);var N;if(this.useDom||o.ns){N=F(o,null);el.appendChild(N);}else {var html=E(o);N=this.insertHtml("beforeEnd",el,html);}return M?Roo.get(N,true):N;},overwrite:function(el,o,M){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);} +F(o,el);}else {el.innerHTML=E(o);}return M?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var M=E(o);return new Roo.Template(M);}};}(); +Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}if(typeof(A)=='object'){Roo.apply(this,A)}else {this.html=A;}};Roo.Template.prototype={html:'',applyTemplate:function(A){try{if(this.compiled){return this.compiled(A);}var useF=this.disableFormats!==true;var fm=Roo.util.Format,tpl=this;var fn=function(m,B,C,D){if(C&&useF){if(C.substr(0,5)=="this."){return tpl.call(C.substr(5),A[B],A);}else {if(D){var re=/^\s*['"](.*)["']\s*$/;D=D.split(',');for(var i=0,len=D.length;i+~]\s?|\s|$)/;var F=/^(#)?([\w-\*]+)/;var G=/(\d*)n\+?(\d*)/,H=/\D/;function I(p,T){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==T){return n;}} n=n.nextSibling;}return null;};function J(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function K(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function L(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!B.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,T){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];}if(!n){return null;}if(T=="for"){return n.htmlFor;}if(T=="class"||T=="className"){return n.className;}return n.getAttribute(T)||n[T];};function getNodes(ns,T,U){var V=[],ri=-1,cs;if(!ns){return V;} U=U||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns];}if(!T){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(U);for(var j=0,ci;ci=cs[j];j++){V[++ri]=ci;}}}else if(T=="/"||T==">"){var utag=U.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==U||U=='*'){V[++ri]=cj;}}}}else if(T=="+"){var utag=U.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);if(n&&(n.nodeName==utag||n.nodeName==U||U=='*')){V[++ri]=n;}}}else if(T=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(U=='*'||n.tagName.toLowerCase()!=U)));if(n){V[++ri]=n;}}}return V;};function M(a,b){if(b.slice){return a.concat(b);}for(var i=0,l=b.length;i1){return nodup(AJ);}return AJ;},selectNode:function(AK,AL){return Roo.DomQuery.select(AK,AL)[0];},selectValue:function(AM,AN,AO){AM=AM.replace(C,"");if(!valueCache[AM]){valueCache[AM]=Roo.DomQuery.compile(AM,"select");}var n=valueCache[AM](AN);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return ((v===null||v===undefined||v==='')?AO:v);},selectNumber:function(AP,AQ,AR){var v=Roo.DomQuery.selectValue(AP,AQ,AR||0);return parseFloat(v);},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var AS=(el instanceof Array);var AT=Roo.DomQuery.filter(AS?el:[el],ss);return AS?(AT.length==el.length):(AT.length>0);},filter:function(AU,ss,AV){ss=ss.replace(C,"");if(!simpleCache[ss]){simpleCache[ss]=Roo.DomQuery.compile(ss,"simple");}var AW=simpleCache[ss](AU);return AV?S(AW,AU):AW;},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}")}};'}],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;}},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=G.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!H.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;}} +q=q.replace(tm[0],"");}}while(!(mm=q.match(E))){var matched=false;for(var j=0;j1){return nodup(X);}return X;},selectNode:function(T,U){return Roo.DomQuery.select(T,U)[0];},selectValue:function(T,U,V){T=T.replace(C,"");if(!valueCache[T]){valueCache[T]=Roo.DomQuery.compile(T,"select");}var n=valueCache[T](U);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return ((v===null||v===undefined||v==='')?V:v);},selectNumber:function(T,U,V){var v=Roo.DomQuery.selectValue(T,U,V||0);return parseFloat(v);},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var T=(el instanceof Array);var U=Roo.DomQuery.filter(T?el:[el],ss);return T?(U.length==el.length):(U.length>0);},filter:function(T,ss,U){ss=ss.replace(C,"");if(!simpleCache[ss]){simpleCache[ss]=Roo.DomQuery.compile(ss,"simple");}var V=simpleCache[ss](T);return U?S(V,T):V;},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}")}};'}],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;}},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=G.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!H.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(!K(ci)&&!J(ci)){r[++ri]=ci;}}return r;},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break;}}if(empty){r[++ri]=ci;}}return r;},"contains":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||'').indexOf(v)!=-1){r[++ri]=ci;}}return r;},"nodeValue":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci;}}return r;},"checked":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci;}}return r;},"not":function(c,ss){return Roo.DomQuery.filter(c,ss,true);},"odd":function(c){return this["nth-child"](c,"odd");},"even":function(c){return this["nth-child"](c,"even");},"nth":function(c,a){return c[a-1]||[];},"first":function(c){return c[0]||[];},"last":function(c){return c[c.length-1]||[];},"has":function(c,ss){var s=Roo.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci;}}return r;},"next":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=J(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;},"prev":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=K(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;}}};}();Roo.query=Roo.DomQuery.select; Roo.util.Observable=function(A){A=A||{};this.addEvents(A.events||{});if(A.events){delete A.events;} -Roo.apply(this,A);if(this.listeners){this.on(this.listeners);delete this.listeners;}};Roo.util.Observable.prototype={fireEvent:function(){var ce=this.events[arguments[0].toLowerCase()];if(typeof ce=="object"){return ce.fire.apply(ce,Array.prototype.slice.call(arguments,1));}else {return true;}},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(B,fn,C,o){if(typeof B=="object"){o=B;for(var e in o){if(this.filterOptRe.test(e)){continue;}if(typeof o[e]=="function"){this.addListener(e,o[e],o.scope,o);}else {this.addListener(e,o[e].fn,o[e].scope,o[e]);}}return;} -o=(!o||typeof o=="boolean")?{}:o;B=B.toLowerCase();var ce=this.events[B]||true;if(typeof ce=="boolean"){ce=new Roo.util.Event(this,B);this.events[B]=ce;} -ce.addListener(fn,C,o);},removeListener:function(D,fn,E){var ce=this.events[D.toLowerCase()];if(typeof ce=="object"){ce.removeListener(fn,E);}},purgeListeners:function(){for(var evt in this.events){if(typeof this.events[evt]=="object"){this.events[evt].clearListeners();}}},relayEvents:function(o,F){var G=function(H){return function(){return this.fireEvent.apply(this,Roo.combine(H,Array.prototype.slice.call(arguments,0)));};};for(var i=0,len=F.length;i0;}};Roo.util.Observable.prototype.on=Roo.util.Observable.prototype.addListener;Roo.util.Observable.prototype.un=Roo.util.Observable.prototype.removeListener;Roo.util.Observable.capture=function(o,fn,I){o.fireEvent=o.fireEvent.createInterceptor(fn,I);};Roo.util.Observable.releaseCapture=function(o){o.fireEvent=Roo.util.Observable.prototype.fireEvent;};(function(){var J=function(h,o,M){var N=new Roo.util.DelayedTask();return function(){N.delay(o.buffer,h,M,Array.prototype.slice.call(arguments,0));};};var K=function(h,e,fn,M){return function(){e.removeListener(fn,M);return h.apply(M,arguments);};};var L=function(h,o,M){return function(){var N=Array.prototype.slice.call(arguments,0);setTimeout(function(){h.apply(M,N);},o.delay||10);};};Roo.util.Event=function(M,N){this.name=N;this.obj=M;this.listeners=[];};Roo.util.Event.prototype={addListener:function(fn,M,N){var o=N||{};M=M||this.obj;if(!this.isListening(fn,M)){var l={fn:fn,scope:M,options:o};var h=fn;if(o.delay){h=L(h,o,M);}if(o.single){h=K(h,this,fn,M);}if(o.buffer){h=J(h,o,M);} -l.fireFn=h;if(!this.firing){this.listeners.push(l);}else {this.listeners=this.listeners.slice(0);this.listeners.push(l);}}},findListener:function(fn,O){O=O||this.obj;var ls=this.listeners;for(var i=0,len=ls.length;i0){this.firing=true;var args=Array.prototype.slice.call(arguments,0);for(var i=0;i0;}};Roo.util.Observable.prototype.on=Roo.util.Observable.prototype.addListener;Roo.util.Observable.prototype.un=Roo.util.Observable.prototype.removeListener;Roo.util.Observable.capture=function(o,fn,A){o.fireEvent=o.fireEvent.createInterceptor(fn,A);};Roo.util.Observable.releaseCapture=function(o){o.fireEvent=Roo.util.Observable.prototype.fireEvent;};(function(){var A=function(h,o,D){var E=new Roo.util.DelayedTask();return function(){E.delay(o.buffer,h,D,Array.prototype.slice.call(arguments,0));};};var B=function(h,e,fn,D){return function(){e.removeListener(fn,D);return h.apply(D,arguments);};};var C=function(h,o,D){return function(){var E=Array.prototype.slice.call(arguments,0);setTimeout(function(){h.apply(D,E);},o.delay||10);};};Roo.util.Event=function(D,E){this.name=E;this.obj=D;this.listeners=[];};Roo.util.Event.prototype={addListener:function(fn,D,E){var o=E||{};D=D||this.obj;if(!this.isListening(fn,D)){var l={fn:fn,scope:D,options:o};var h=fn;if(o.delay){h=C(h,o,D);}if(o.single){h=B(h,this,fn,D);}if(o.buffer){h=A(h,o,D);} +l.fireFn=h;if(!this.firing){this.listeners.push(l);}else {this.listeners=this.listeners.slice(0);this.listeners.push(l);}}},findListener:function(fn,D){D=D||this.obj;var ls=this.listeners;for(var i=0,len=ls.length;i0){this.firing=true;var args=Array.prototype.slice.call(arguments,0);for(var i=0;i");var defer=document.getElementById("ie-deferred-loader");defer.onreadystatechange=function(){if(this.readyState=="complete"){J();}};}else if(Roo.isSafari){B=setInterval(function(){var rs=document.readyState;if(rs=="complete"){J();}},10);} E.on(window,"load",J);};var L=function(h,o){var S=new Roo.util.DelayedTask(h);return function(e){e=new Roo.EventObjectImpl(e);S.delay(o.buffer,h,null,[e]);};};var M=function(h,el,S,fn){return function(e){Roo.EventManager.removeListener(el,S,fn);h(e);};};var N=function(h,o){return function(e){e=new Roo.EventObjectImpl(e);setTimeout(function(){h(e);},o.delay||10);};};var O=function(S,T,U,fn,V){var o=(!U||typeof U=="boolean")?{}:U;fn=fn||o.fn;V=V||o.scope;var el=Roo.getDom(S);if(!el){throw "Error listening for \""+T+'\". Element "'+S+'" doesn\'t exist.';}var h=function(e){e=Roo.EventObject.setEvent(e);var t;if(o.delegate){t=e.getTarget(o.delegate,el);if(!t){return;}}else {t=e.target;}if(o.stopEvent===true){e.stopEvent();}if(o.preventDefault===true){e.preventDefault();}if(o.stopPropagation===true){e.stopPropagation();}if(o.normalized===false){e=e.browserEvent;} fn.call(V||el,e,t,o);};if(o.delay){h=N(h,o);}if(o.single){h=M(h,el,T,fn);}if(o.buffer){h=L(h,o);} fn._handlers=fn._handlers||[];fn._handlers.push([Roo.id(el),T,h]);E.on(el,T,h);if(T=="mousewheel"&&el.addEventListener){el.addEventListener("DOMMouseScroll",h,false);E.on(window,'unload',function(){el.removeEventListener("DOMMouseScroll",h,false);});}if(T=="mousedown"&&el==document){Roo.EventManager.stoppedMouseDownEvent.addListener(h);}return h;};var P=function(el,S,fn){var id=Roo.id(el),T=fn._handlers,hd=fn;if(T){for(var i=0,len=T.length;i=33&&k<=40)||k==this.RETURN ||k==this.TAB||k==this.ESC;},isSpecialKey:function(){var k=this.keyCode;return (this.type=='keypress'&&this.ctrlKey)||k==9||k==13||k==40||k==27||(k==16)||(k==17)||(k>=18&&k<=20)||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45);},stopPropagation:function(){if(this.browserEvent){if(this.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);} -E.stopPropagation(this.browserEvent);}},getCharCode:function(){return this.charCode||this.keyCode;},getKey:function(){var k=this.keyCode||this.charCode;return Roo.isSafari?(T[k]||k):k;},getPageX:function(){return this.xy[0];},getPageY:function(){return this.xy[1];},getTime:function(){if(this.browserEvent){return E.getTime(this.browserEvent);}return null;},getXY:function(){return this.xy;},getTarget:function(V,W,X){return V?Roo.fly(this.target).findParent(V,W,X):this.target;},getRelatedTarget:function(){if(this.browserEvent){return E.getRelatedTarget(this.browserEvent);}return null;},getWheelDelta:function(){var e=this.browserEvent;var Y=0;if(e.wheelDelta){Y=e.wheelDelta/120;}else if(e.detail){Y=-e.detail/3;}return Y;},hasModifier:function(){return !!((this.ctrlKey||this.altKey)||this.shiftKey);},within:function(el,Z){var t=this[Z?"getRelatedTarget":"getTarget"]();return t&&Roo.fly(el).contains(t);},getPoint:function(){return new Roo.lib.Point(this.xy[0],this.xy[1]);}};return new Roo.EventObjectImpl();}(); +E.stopEvent(this.browserEvent);}},preventDefault:function(){if(this.browserEvent){E.preventDefault(this.browserEvent);}},isNavKeyPress:function(){var k=this.keyCode;k=Roo.isSafari?(A[k]||k):k;return (k>=33&&k<=40)||k==this.RETURN ||k==this.TAB||k==this.ESC;},isSpecialKey:function(){var k=this.keyCode;return (this.type=='keypress'&&this.ctrlKey)||k==9||k==13||k==40||k==27||(k==16)||(k==17)||(k>=18&&k<=20)||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45);},stopPropagation:function(){if(this.browserEvent){if(this.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);} +E.stopPropagation(this.browserEvent);}},getCharCode:function(){return this.charCode||this.keyCode;},getKey:function(){var k=this.keyCode||this.charCode;return Roo.isSafari?(A[k]||k):k;},getPageX:function(){return this.xy[0];},getPageY:function(){return this.xy[1];},getTime:function(){if(this.browserEvent){return E.getTime(this.browserEvent);}return null;},getXY:function(){return this.xy;},getTarget:function(C,D,F){return C?Roo.fly(this.target).findParent(C,D,F):this.target;},getRelatedTarget:function(){if(this.browserEvent){return E.getRelatedTarget(this.browserEvent);}return null;},getWheelDelta:function(){var e=this.browserEvent;var C=0;if(e.wheelDelta){C=e.wheelDelta/120;}else if(e.detail){C=-e.detail/3;}return C;},hasModifier:function(){return !!((this.ctrlKey||this.altKey)||this.shiftKey);},within:function(el,C){var t=this[C?"getRelatedTarget":"getTarget"]();return t&&Roo.fly(el).contains(t);},getPoint:function(){return new Roo.lib.Point(this.xy[0],this.xy[1]);}};return new Roo.EventObjectImpl();}(); (function(){var D=Roo.lib.Dom;var E=Roo.lib.Event;var A=Roo.lib.Anim;var B={};var C=/(-[a-z])/gi;var F=function(m,a){return a.charAt(1).toUpperCase();};var G=document.defaultView;Roo.Element=function(J,K){var L=typeof J=="string"?document.getElementById(J):J;if(!L){return null;}var id=L.id;if(K!==true&&id&&Roo.Element.cache[id]){return Roo.Element.cache[id];} -this.dom=L;this.id=id||Roo.id(L);};var El=Roo.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(J){this.visibilityMode=J;return this;},enableDisplayMode:function(K){this.setVisibilityMode(El.DISPLAY);if(typeof K!="undefined")this.originalDisplay=K;return this;},findParent:function(L,M,N){var p=this.dom,b=document.body,O=0,dq=Roo.DomQuery,P;M=M||50;if(typeof M!="number"){P=Roo.getDom(M);M=10;}while(p&&p.nodeType==1&&Ocb){c.scrollTop=b-ch;}if(v!==false){if(lcr){c.scrollLeft=r-c.clientWidth;}}return this;},scrollChildIntoView:function(w,z){Roo.fly(w,'_scrollChildIntoView').scrollIntoView(this,z);},autoHeight:function(AA,AB,AC,AD){var AE=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var AG=parseInt(this.dom.scrollHeight,10);if(!AA){this.setHeight(AG);this.unclip();if(typeof AC=="function"){AC();}}else {this.setHeight(AE);this.setHeight(AG,AA,AB,function(){this.unclip();if(typeof AC=="function")AC();}.createDelegate(this),AD);}}.createDelegate(this),0);return this;},contains:function(el){if(!el){return false;}return D.isAncestor(this.dom,el.dom?el.dom:el);},isVisible:function(AF){var AG=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(AF!==true||!AG){return AG;}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Roo.fly(p,'_isVisible').isVisible()){return false;} -p=p.parentNode;}return true;},select:function(AH,AI){return El.select(AH,AI,this.dom);},query:function(AJ,AK){return Roo.DomQuery.select(AJ,this.dom);},child:function(AL,AM){var n=Roo.DomQuery.selectNode(AL,this.dom);return AM?n:Roo.get(n);},down:function(AN,AO){var n=Roo.DomQuery.selectNode(" > "+AN,this.dom);return AO?n:Roo.get(n);},initDD:function(AP,AQ,AR){var dd=new Roo.dd.DD(Roo.id(this.dom),AP,AQ);return Roo.apply(dd,AR);},initDDProxy:function(AS,AT,AU){var dd=new Roo.dd.DDProxy(Roo.id(this.dom),AS,AT);return Roo.apply(dd,AU);},initDDTarget:function(AV,AW,AX){var dd=new Roo.dd.DDTarget(Roo.id(this.dom),AV,AW);return Roo.apply(dd,AX);},setVisible:function(AY,AZ){if(!AZ||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(AY);}else {this.fixDisplay();this.dom.style.visibility=AY?"visible":"hidden";}}else {var dom=this.dom;var J=this.visibilityMode;if(AY){this.setOpacity(.01);this.setVisible(true);} -this.anim({opacity:{to:(AY?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',function(){if(!AY){if(J==El.DISPLAY){dom.style.display="none";}else {dom.style.visibility="hidden";} -Roo.get(dom).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(Aa){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(Ab){if(typeof Ab=="boolean"){Ab=Ab?this.originalDisplay:"none";} -this.setStyle("display",Ab);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(Ac){if(Ac instanceof Array){for(var i=0,len=Ac.length;icb){c.scrollTop=b-ch;}if(K!==false){if(lcr){c.scrollLeft=r-c.clientWidth;}}return this;},scrollChildIntoView:function(J,K){Roo.fly(J,'_scrollChildIntoView').scrollIntoView(this,K);},autoHeight:function(J,K,L,M){var N=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var O=parseInt(this.dom.scrollHeight,10);if(!J){this.setHeight(O);this.unclip();if(typeof L=="function"){L();}}else {this.setHeight(N);this.setHeight(O,J,K,function(){this.unclip();if(typeof L=="function")L();}.createDelegate(this),M);}}.createDelegate(this),0);return this;},contains:function(el){if(!el){return false;}return D.isAncestor(this.dom,el.dom?el.dom:el);},isVisible:function(J){var K=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(J!==true||!K){return K;}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Roo.fly(p,'_isVisible').isVisible()){return false;} +p=p.parentNode;}return true;},select:function(J,K){return El.select(J,K,this.dom);},query:function(J,K){return Roo.DomQuery.select(J,this.dom);},child:function(J,K){var n=Roo.DomQuery.selectNode(J,this.dom);return K?n:Roo.get(n);},down:function(J,K){var n=Roo.DomQuery.selectNode(" > "+J,this.dom);return K?n:Roo.get(n);},initDD:function(J,K,L){var dd=new Roo.dd.DD(Roo.id(this.dom),J,K);return Roo.apply(dd,L);},initDDProxy:function(J,K,L){var dd=new Roo.dd.DDProxy(Roo.id(this.dom),J,K);return Roo.apply(dd,L);},initDDTarget:function(J,K,L){var dd=new Roo.dd.DDTarget(Roo.id(this.dom),J,K);return Roo.apply(dd,L);},setVisible:function(J,K){if(!K||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(J);}else {this.fixDisplay();this.dom.style.visibility=J?"visible":"hidden";}}else {var dom=this.dom;var visMode=this.visibilityMode;if(J){this.setOpacity(.01);this.setVisible(true);} +this.anim({opacity:{to:(J?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',function(){if(!J){if(visMode==El.DISPLAY){dom.style.display="none";}else {dom.style.visibility="hidden";} +Roo.get(dom).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(J){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(J){if(typeof J=="boolean"){J=J?this.originalDisplay:"none";} +this.setStyle("display",J);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(J){if(J instanceof Array){for(var i=0,len=J.length;idw+scrollX){x=swapX?r.left-w:dw+scrollX-w;}if(xdh+scrollY){y=swapY?r.top-h:dh+scrollY-h;}if(yvr){x=vr-w;Bi=true;}if((y+h)>vb){y=vb-h;Bi=true;}if(xdw+scrollX){x=swapX?r.left-w:dw+scrollX-w;}if(xdh+scrollY){y=swapY?r.top-h:dh+scrollY-h;}if(yvr){x=vr-w;M=true;}if((y+h)>vb){y=vb-h;M=true;}if(x
';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var B0=/\ssrc=([\'\"])(.*?)\1/i;var B1=/\stype=([\'\"])(.*?)\1/i;var B2;while(B2=re.exec(Bw)){var attrs=B2[1];var srcMatch=attrs?attrs.match(B0):false;if(srcMatch&&srcMatch[2]){var s=document.createElement("script");s.src=srcMatch[2];var typeMatch=attrs.match(B1);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2];} -hd.appendChild(s);}else if(B2[2]&&B2[2].length>0){if(window.execScript){window.execScript(B2[2]);}else {window.eval(B2[2]);}}}var el=document.getElementById(id);if(el){el.parentNode.removeChild(el);}if(typeof By=="function"){By();}});Bz.innerHTML=Bw.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this;},load:function(){var um=this.getUpdateManager();um.update.apply(um,arguments);return this;},getUpdateManager:function(){if(!this.updateManager){this.updateManager=new Roo.UpdateManager(this);}return this.updateManager;},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this;},getCenterXY:function(){return this.getAlignToXY(document,'c-c');},center:function(B0){this.alignTo(B0||document,'c-c');return this;},isBorderBox:function(){return I[this.dom.tagName.toLowerCase()]||Roo.isBorderBox;},getBox:function(B1,B2){var xy;if(!B2){xy=this.getXY();}else {var BY=parseInt(this.getStyle("left"),10)||0;var BZ=parseInt(this.getStyle("top"),10)||0;xy=[BY,BZ];}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!B1){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h};}else {var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)};} -bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx;},getFrameWidth:function(B3,B4){return B4&&Roo.isBorderBox?0:(this.getPadding(B3)+this.getBorderWidth(B3));},setBox:function(B5,B6,B7){var w=B5.width,h=B5.height;if((B6&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"));} -this.setBounds(B5.x,B5.y,w,h,this.preanim(arguments,2));return this;},repaint:function(){var B8=this.dom;this.addClass("x-repaint");setTimeout(function(){Roo.get(B8).removeClass("x-repaint");},1);return this;},getMargins:function(B9){if(!B9){return {top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0};}else {return this.addStyles(B9,El.margins);}},addStyles:function(CA,CB){var CC=0,v,w;for(var i=0,Ak=CA.length;iCn.clientHeight||Cn.scrollWidth>Cn.clientWidth;},scrollTo:function(Co,Cp,Cq){var Cr=Co.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!Cq||!A){this.dom[Cr]=Cp;}else {var to=Cr=="scrollLeft"?[Cp,this.dom.scrollTop]:[this.dom.scrollLeft,Cp];this.anim({scroll:{"to":to}},this.preanim(arguments,2),'scroll');}return this;},scroll:function(Cs,Ct,Cu){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;Cs=Cs.toLowerCase();var Cv=false;var a=this.preanim(arguments,2);switch(Cs){case "l":case "left":if(w-l>cw){var v=Math.min(l+Ct,w-cw);this.scrollTo("left",v,a);Cv=true;}break;case "r":case "right":if(l>0){var v=Math.max(l-Ct,0);this.scrollTo("left",v,a);Cv=true;}break;case "t":case "top":case "up":if(t>0){var v=Math.max(t-Ct,0);this.scrollTo("top",v,a);Cv=true;}break;case "b":case "bottom":case "down":if(h-t>ch){var v=Math.min(t+Ct,h-ch);this.scrollTo("top",v,a);Cv=true;}break;}return Cv;},translatePoints:function(x,y){if(typeof x=='object'||x instanceof Array){y=x[1];x=x[0];}var p=this.getStyle('position');var o=this.getXY();var l=parseInt(this.getStyle('left'),10);var t=parseInt(this.getStyle('top'),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft;}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop;}return {left:(x-o[0]+l),top:(y-o[1]+t)};},getScroll:function(){var d=this.dom,Cw=document;if(d==Cw||d==Cw.body){var l=window.pageXOffset||Cw.documentElement.scrollLeft||Cw.body.scrollLeft||0;var t=window.pageYOffset||Cw.documentElement.scrollTop||Cw.body.scrollTop||0;return {left:l,top:t};}else {return {left:d.scrollLeft,top:d.scrollTop};}},getColor:function(Cx,Cy,Cz){var v=this.getStyle(Cx);if(!v||v=="transparent"||v=="inherit"){return Cy;}var C0=typeof Cz=="undefined"?"#":Cz;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]).toString(16);if(h<16){h="0"+h;} -C0+=h;}}else {if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);C0+=c+c;}}else if(v.length==7){C0+=v.substr(1);}}}return (C0.length>5?C0.toLowerCase():Cy);},boxWrap:function(C1){C1=C1||'x-box';var el=Roo.get(this.insertHtml('beforeBegin',String.format('
'+El.boxMarkup+'
',C1)));el.child('.'+C1+'-mc').dom.appendChild(this.dom);return el;},getAttributeNS:Roo.isIE?function(ns,C2){var d=this.dom;var C3=typeof d[ns+":"+C2];if(C3!='undefined'&&C3!='unknown'){return d[ns+":"+C2];}return d[C2];}:function(ns,C4){var d=this.dom;return d.getAttributeNS(ns,C4)||d.getAttribute(ns+":"+C4)||d.getAttribute(C4)||d[C4];}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,J){if(v===""||v=="auto"){return v;}if(v===undefined){return '';}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(J||'px');}return v;};El.boxMarkup='
';El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var H;El.get=function(el){var ex,J,id;if(!el){return null;}if(typeof el=="string"){if(!(J=document.getElementById(el))){return null;}if(ex=El.cache[el]){ex.dom=J;}else {ex=El.cache[el]=new El(J);}return ex;}else if(el.tagName){if(!(id=el.id)){id=Roo.id(el);}if(ex=El.cache[id]){ex.dom=el;}else {ex=El.cache[id]=new El(el);}return ex;}else if(el instanceof El){if(el!=H){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el;}return el;}else if(el.isComposite){return el;}else if(el instanceof Array){return El.select(el);}else if(el==document){if(!H){var f=function(){};f.prototype=El.prototype;H=new f();H.dom=document;}return H;}return null;};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;i';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var N=/\ssrc=([\'\"])(.*?)\1/i;var O=/\stype=([\'\"])(.*?)\1/i;var P;while(P=re.exec(J)){var attrs=P[1];var srcMatch=attrs?attrs.match(N):false;if(srcMatch&&srcMatch[2]){var s=document.createElement("script");s.src=srcMatch[2];var typeMatch=attrs.match(O);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2];} +hd.appendChild(s);}else if(P[2]&&P[2].length>0){if(window.execScript){window.execScript(P[2]);}else {window.eval(P[2]);}}}var el=document.getElementById(id);if(el){el.parentNode.removeChild(el);}if(typeof L=="function"){L();}});M.innerHTML=J.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this;},load:function(){var um=this.getUpdateManager();um.update.apply(um,arguments);return this;},getUpdateManager:function(){if(!this.updateManager){this.updateManager=new Roo.UpdateManager(this);}return this.updateManager;},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this;},getCenterXY:function(){return this.getAlignToXY(document,'c-c');},center:function(J){this.alignTo(J||document,'c-c');return this;},isBorderBox:function(){return I[this.dom.tagName.toLowerCase()]||Roo.isBorderBox;},getBox:function(J,K){var xy;if(!K){xy=this.getXY();}else {var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top];}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!J){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h};}else {var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)};} +bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx;},getFrameWidth:function(J,K){return K&&Roo.isBorderBox?0:(this.getPadding(J)+this.getBorderWidth(J));},setBox:function(J,K,L){var w=J.width,h=J.height;if((K&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"));} +this.setBounds(J.x,J.y,w,h,this.preanim(arguments,2));return this;},repaint:function(){var J=this.dom;this.addClass("x-repaint");setTimeout(function(){Roo.get(J).removeClass("x-repaint");},1);return this;},getMargins:function(J){if(!J){return {top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0};}else {return this.addStyles(J,El.margins);}},addStyles:function(J,K){var L=0,v,w;for(var i=0,len=J.length;iJ.clientHeight||J.scrollWidth>J.clientWidth;},scrollTo:function(J,K,L){var M=J.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!L||!A){this.dom[M]=K;}else {var to=M=="scrollLeft"?[K,this.dom.scrollTop]:[this.dom.scrollLeft,K];this.anim({scroll:{"to":to}},this.preanim(arguments,2),'scroll');}return this;},scroll:function(J,K,L){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;J=J.toLowerCase();var M=false;var a=this.preanim(arguments,2);switch(J){case "l":case "left":if(w-l>cw){var v=Math.min(l+K,w-cw);this.scrollTo("left",v,a);M=true;}break;case "r":case "right":if(l>0){var v=Math.max(l-K,0);this.scrollTo("left",v,a);M=true;}break;case "t":case "top":case "up":if(t>0){var v=Math.max(t-K,0);this.scrollTo("top",v,a);M=true;}break;case "b":case "bottom":case "down":if(h-t>ch){var v=Math.min(t+K,h-ch);this.scrollTo("top",v,a);M=true;}break;}return M;},translatePoints:function(x,y){if(typeof x=='object'||x instanceof Array){y=x[1];x=x[0];}var p=this.getStyle('position');var o=this.getXY();var l=parseInt(this.getStyle('left'),10);var t=parseInt(this.getStyle('top'),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft;}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop;}return {left:(x-o[0]+l),top:(y-o[1]+t)};},getScroll:function(){var d=this.dom,J=document;if(d==J||d==J.body){var l=window.pageXOffset||J.documentElement.scrollLeft||J.body.scrollLeft||0;var t=window.pageYOffset||J.documentElement.scrollTop||J.body.scrollTop||0;return {left:l,top:t};}else {return {left:d.scrollLeft,top:d.scrollTop};}},getColor:function(J,K,L){var v=this.getStyle(J);if(!v||v=="transparent"||v=="inherit"){return K;}var M=typeof L=="undefined"?"#":L;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]).toString(16);if(h<16){h="0"+h;} +M+=h;}}else {if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);M+=c+c;}}else if(v.length==7){M+=v.substr(1);}}}return (M.length>5?M.toLowerCase():K);},boxWrap:function(J){J=J||'x-box';var el=Roo.get(this.insertHtml('beforeBegin',String.format('
'+El.boxMarkup+'
',J)));el.child('.'+J+'-mc').dom.appendChild(this.dom);return el;},getAttributeNS:Roo.isIE?function(ns,J){var d=this.dom;var K=typeof d[ns+":"+J];if(K!='undefined'&&K!='unknown'){return d[ns+":"+J];}return d[J];}:function(ns,J){var d=this.dom;return d.getAttributeNS(ns,J)||d.getAttribute(ns+":"+J)||d.getAttribute(J)||d[J];}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,J){if(v===""||v=="auto"){return v;}if(v===undefined){return '';}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(J||'px');}return v;};El.boxMarkup='
';El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var H;El.get=function(el){var ex,J,id;if(!el){return null;}if(typeof el=="string"){if(!(J=document.getElementById(el))){return null;}if(ex=El.cache[el]){ex.dom=J;}else {ex=El.cache[el]=new El(J);}return ex;}else if(el.tagName){if(!(id=el.id)){id=Roo.id(el);}if(ex=El.cache[id]){ex.dom=el;}else {ex=El.cache[id]=new El(el);}return ex;}else if(el instanceof El){if(el!=H){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el;}return el;}else if(el.isComposite){return el;}else if(el instanceof Array){return El.select(el);}else if(el==document){if(!H){var f=function(){};f.prototype=El.prototype;H=new f();H.dom=document;}return H;}return null;};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;i0){F.defer((duration/2)*1000,this);}else {el.afterFx(o);}};F.call(this);});return this;},pause:function(F){var el=this.getFxEl();var o={};el.queueFx(o,function(){setTimeout(function(){el.afterFx(o);},F*1000);});return this;},fadeIn:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility='visible';var to=o.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,.5,"easeOut",function(){if(to==1){this.clearOpacity();} +this.dom.style.visibility="visible";B.show();arguments.callee.anim=B.fxanim(a,o,'motion',.5,'easeOut',C);});return this;},slideOut:function(A,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"t";var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var B=this.fxWrap(r.pos,o,"visible");var st=this.dom.style;st.visibility="visible";st.position="absolute";B.setSize(b);var C=function(){if(o.useDisplay){el.setDisplayed(false);}else {el.hide();} +el.fxUnwrap(B,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o);};var a,D={to:0};switch(A.toLowerCase()){case "t":st.left=st.bottom="0";a={height:D};break;case "l":st.right=st.top="0";a={width:D};break;case "r":st.left=st.top="0";a={width:D,points:{to:[b.right,b.y]}};break;case "b":st.left=st.top="0";a={height:D,points:{to:[b.x,b.bottom]}};break;case "tl":st.right=st.bottom="0";a={width:D,height:D};break;case "bl":st.right=st.top="0";a={width:D,height:D,points:{to:[b.x,b.bottom]}};break;case "br":st.left=st.top="0";a={width:D,height:D,points:{to:[b.x+b.width,b.bottom]}};break;case "tr":st.left=st.bottom="0";a={width:D,height:D,points:{to:[b.right,b.y]}};break;} +arguments.callee.anim=B.fxanim(a,o,'motion',.5,"easeOut",C);});return this;},puff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.show();var r=this.getFxRestore();var st=this.dom.style;var A=function(){if(o.useDisplay){el.setDisplayed(false);}else {el.hide();} +el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;st.fontSize='';el.afterFx(o);};var B=this.getWidth();var C=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(B*2)},height:{to:this.adjustHeight(C*2)},points:{by:[-(B*.5),-(C*.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},o,'motion',.5,"easeOut",A);});return this;},switchOff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.clip();var r=this.getFxRestore();var st=this.dom.style;var A=function(){if(o.useDisplay){el.setDisplayed(false);}else {el.hide();} +el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o);};this.fxanim({opacity:{to:0.3}},null,null,.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*.5]}},o,'motion',0.3,'easeIn',A);}).defer(100,this);});});return this;},highlight:function(A,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"ffff9c";attr=o.attr||"backgroundColor";this.clearOpacity();this.show();var B=this.getColor(attr);var C=this.dom.style[attr];endColor=(o.endColor||B)||"ffffff";var D=function(){el.dom.style[attr]=C;el.afterFx(o);};var a={};a[attr]={from:A,to:endColor};arguments.callee.anim=this.fxanim(a,o,'color',1,'easeIn',D);});return this;},frame:function(A,B,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"#C3DAF9";if(A.length==6){A="#"+A;} +B=B||1;duration=o.duration||1;this.show();var b=this.getBox();var C=function(){var D=this.createProxy({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+A}});var E=Roo.isBorderBox?2:1;D.animate({top:{from:b.y,to:b.y-20},left:{from:b.x,to:b.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:b.height,to:(b.height+(20*E))},width:{from:b.width,to:(b.width+(20*E))}},duration,function(){D.remove();});if(--B>0){C.defer((duration/2)*1000,this);}else {el.afterFx(o);}};C.call(this);});return this;},pause:function(A){var el=this.getFxEl();var o={};el.queueFx(o,function(){setTimeout(function(){el.afterFx(o);},A*1000);});return this;},fadeIn:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility='visible';var to=o.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,.5,"easeOut",function(){if(to==1){this.clearOpacity();} el.afterFx(o);});});return this;},fadeOut:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){arguments.callee.anim=this.fxanim({opacity:{to:o.endOpacity||0}},o,null,.5,"easeOut",function(){if(this.visibilityMode==Roo.Element.DISPLAY||o.useDisplay){this.dom.style.display="none";}else {this.dom.style.visibility="hidden";} this.clearOpacity();el.afterFx(o);});});return this;},scale:function(w,h,o){this.shift(Roo.apply({},o,{width:w,height:h}));return this;},shift:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){var a={},w=o.width,h=o.height,x=o.x,y=o.y,op=o.opacity;if(w!==undefined){a.width={to:this.adjustWidth(w)};}if(h!==undefined){a.height={to:this.adjustHeight(h)};}if(x!==undefined||y!==undefined){a.points={to:[x!==undefined?x:this.getX(),y!==undefined?y:this.getY()]};}if(op!==undefined){a.opacity={to:op};}if(o.xy!==undefined){a.points={to:o.xy};} -arguments.callee.anim=this.fxanim(a,o,'motion',.35,"easeOut",function(){el.afterFx(o);});});return this;},ghost:function(G,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){G=G||"b";var r=this.getFxRestore();var w=this.getWidth(),h=this.getHeight();var st=this.dom.style;var H=function(){if(o.useDisplay){el.setDisplayed(false);}else {el.hide();} -el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o);};var a={opacity:{to:0},points:{}},pt=a.points;switch(G.toLowerCase()){case "t":pt.by=[0,-h];break;case "l":pt.by=[-w,0];break;case "r":pt.by=[w,0];break;case "b":pt.by=[0,h];break;case "tl":pt.by=[-w,-h];break;case "bl":pt.by=[-w,h];break;case "br":pt.by=[w,h];break;case "tr":pt.by=[w,-h];break;} -arguments.callee.anim=this.fxanim(a,o,'motion',.5,"easeOut",H);});return this;},syncFx:function(){this.fxDefaults=Roo.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this;},sequenceFx:function(){this.fxDefaults=Roo.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this;},nextFx:function(){var ef=this.fxQueue[0];if(ef){ef.call(this);}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0];},stopFx:function(){if(this.hasActiveFx()){var cur=this.fxQueue[0];if(cur&&cur.anim&&cur.anim.isAnimated()){this.fxQueue=[cur];cur.anim.stop(true);}}return this;},beforeFx:function(o){if(this.hasActiveFx()&&!o.concurrent){if(o.stopFx){this.stopFx();return true;}return false;}return true;},hasFxBlock:function(){var q=this.fxQueue;return q&&q[0]&&q[0].block;},queueFx:function(o,fn){if(!this.fxQueue){this.fxQueue=[];}if(!this.hasFxBlock()){Roo.applyIf(o,this.fxDefaults);if(!o.concurrent){var run=this.beforeFx(o);fn.block=o.block;this.fxQueue.push(fn);if(run){this.nextFx();}}else {fn.call(this);}}return this;},fxWrap:function(H,o,I){var J;if(!o.wrap||!(J=Roo.get(o.wrap))){var wrapXY;if(o.fixPosition){wrapXY=this.getXY();}var div=document.createElement("div");div.style.visibility=I;J=Roo.get(this.dom.parentNode.insertBefore(div,this.dom));J.setPositioning(H);if(J.getStyle("position")=="static"){J.position("relative");} -this.clearPositioning('auto');J.clip();J.dom.appendChild(this.dom);if(wrapXY){J.setXY(wrapXY);}}return J;},fxUnwrap:function(K,L,o){this.clearPositioning();this.setPositioning(L);if(!o.wrap){K.dom.parentNode.insertBefore(this.dom,K.dom);K.remove();}},getFxRestore:function(){var st=this.dom.style;return {pos:this.getPositioning(),width:st.width,height:st.height};},afterFx:function(o){if(o.afterStyle){this.applyStyles(o.afterStyle);}if(o.afterCls){this.addClass(o.afterCls);}if(o.remove===true){this.remove();} -Roo.callback(o.callback,o.scope,[this]);if(!o.concurrent){this.fxQueue.shift();this.nextFx();}},getFxEl:function(){return Roo.get(this.dom);},fxanim:function(M,N,O,P,Q,cb){O=O||'run';N=N||{};var R=Roo.lib.Anim[O](this.dom,M,(N.duration||P)||.35,(N.easing||Q)||'easeOut',function(){Roo.callback(cb,this);},this);N.anim=R;return R;}};Roo.Fx.resize=Roo.Fx.scale;Roo.apply(Roo.Element.prototype,Roo.Fx); -Roo.CompositeElement=function(A){this.elements=[];this.addElements(A);};Roo.CompositeElement.prototype={isComposite:true,addElements:function(B){if(!B)return this;if(typeof B=="string"){B=Roo.Element.selectorFunction(B);}var C=this.elements;var D=C.length-1;for(var i=0,len=B.length;i";};if(typeof cfg.scripts!="undefined"){this.loadScripts=cfg.scripts;};if(typeof cfg.timeout!="undefined"){this.timeout=cfg.timeout;};} -this.showLoading();if(!E){this.defaultUrl=B;}if(typeof B=="function"){B=B.call(this);} -method=method||(C?"POST":"GET");if(method=="GET"){B=this.prepareUrl(B);}var o=Roo.apply(cfg||{},{url:B,params:C,success:this.successDelegate,failure:this.failureDelegate,callback:undefined,timeout:(this.timeout*1000),argument:{"url":B,"form":null,"callback":D,"params":C}});this.transaction=Roo.Ajax.request(o);}},formUpdate:function(F,G,H,I){if(this.fireEvent("beforeupdate",this.el,F,G)!==false){if(typeof G=="function"){G=G.call(this);} -F=Roo.getDom(F);this.transaction=Roo.Ajax.request({form:F,url:G,success:this.successDelegate,failure:this.failureDelegate,timeout:(this.timeout*1000),argument:{"url":G,"form":F,"callback":I,"reset":H}});this.showLoading.defer(1,this);}},refresh:function(J){if(this.defaultUrl==null){return;} -this.update(this.defaultUrl,null,J,true);},startAutoRefresh:function(K,L,M,N,O){if(O){this.update(L||this.defaultUrl,M,N,true);}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);} -this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[L||this.defaultUrl,M,N,true]),K*1000);},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId;}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false;},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText);}},prepareUrl:function(P){if(this.disableCaching){var append="_dc="+(new Date().getTime());if(P.indexOf("?")!==-1){P+="&"+append;}else {P+="?"+append;}}return P;},processSuccess:function(Q){this.transaction=null;if(Q.argument.form&&Q.argument.reset){try{Q.argument.form.reset();}catch(e){}}if(this.loadScripts){this.renderer.render(this.el,Q,this,this.updateComplete.createDelegate(this,[Q]));}else {this.renderer.render(this.el,Q,this);this.updateComplete(Q);}},updateComplete:function(R){this.fireEvent("update",this.el,R);if(typeof R.argument.callback=="function"){R.argument.callback(this.el,true,R);}},processFailure:function(S){this.transaction=null;this.fireEvent("failure",this.el,S);if(typeof S.argument.callback=="function"){S.argument.callback(this.el,false,S);}},setRenderer:function(T){this.renderer=T;},getRenderer:function(){return this.renderer;},setDefaultUrl:function(U){this.defaultUrl=U;},abort:function(){if(this.transaction){Roo.Ajax.abort(this.transaction);}},isUpdating:function(){if(this.transaction){return Roo.Ajax.isLoading(this.transaction);}return false;}});Roo.UpdateManager.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Roo.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'
Loading...
'};Roo.UpdateManager.updateElement=function(el,V,W,X){var um=Roo.get(el,true).getUpdateManager();Roo.apply(um,X);um.update(V,W,X?X.callback:null);};Roo.UpdateManager.update=Roo.UpdateManager.updateElement;Roo.UpdateManager.BasicRenderer=function(){};Roo.UpdateManager.BasicRenderer.prototype={render:function(el,Y,Z,a){el.update(Y.responseText,Z.loadScripts,a);}}; +Roo.UpdateManager.superclass.constructor.call(this);};Roo.extend(Roo.UpdateManager,Roo.util.Observable,{getEl:function(){return this.el;},update:function(A,B,C,D){if(this.fireEvent("beforeupdate",this.el,A,B)!==false){var method=this.method,cfg;if(typeof A=="object"){cfg=A;A=cfg.url;B=B||cfg.params;C=C||cfg.callback;D=D||cfg.discardUrl;if(C&&cfg.scope){C=C.createDelegate(cfg.scope);}if(typeof cfg.method!="undefined"){method=cfg.method;};if(typeof cfg.nocache!="undefined"){this.disableCaching=cfg.nocache;};if(typeof cfg.text!="undefined"){this.indicatorText='
'+cfg.text+"
";};if(typeof cfg.scripts!="undefined"){this.loadScripts=cfg.scripts;};if(typeof cfg.timeout!="undefined"){this.timeout=cfg.timeout;};} +this.showLoading();if(!D){this.defaultUrl=A;}if(typeof A=="function"){A=A.call(this);} +method=method||(B?"POST":"GET");if(method=="GET"){A=this.prepareUrl(A);}var o=Roo.apply(cfg||{},{url:A,params:B,success:this.successDelegate,failure:this.failureDelegate,callback:undefined,timeout:(this.timeout*1000),argument:{"url":A,"form":null,"callback":C,"params":B}});this.transaction=Roo.Ajax.request(o);}},formUpdate:function(A,B,C,D){if(this.fireEvent("beforeupdate",this.el,A,B)!==false){if(typeof B=="function"){B=B.call(this);} +A=Roo.getDom(A);this.transaction=Roo.Ajax.request({form:A,url:B,success:this.successDelegate,failure:this.failureDelegate,timeout:(this.timeout*1000),argument:{"url":B,"form":A,"callback":D,"reset":C}});this.showLoading.defer(1,this);}},refresh:function(A){if(this.defaultUrl==null){return;} +this.update(this.defaultUrl,null,A,true);},startAutoRefresh:function(A,B,C,D,E){if(E){this.update(B||this.defaultUrl,C,D,true);}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);} +this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[B||this.defaultUrl,C,D,true]),A*1000);},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId;}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false;},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText);}},prepareUrl:function(A){if(this.disableCaching){var append="_dc="+(new Date().getTime());if(A.indexOf("?")!==-1){A+="&"+append;}else {A+="?"+append;}}return A;},processSuccess:function(A){this.transaction=null;if(A.argument.form&&A.argument.reset){try{A.argument.form.reset();}catch(e){}}if(this.loadScripts){this.renderer.render(this.el,A,this,this.updateComplete.createDelegate(this,[A]));}else {this.renderer.render(this.el,A,this);this.updateComplete(A);}},updateComplete:function(A){this.fireEvent("update",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback(this.el,true,A);}},processFailure:function(A){this.transaction=null;this.fireEvent("failure",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback(this.el,false,A);}},setRenderer:function(A){this.renderer=A;},getRenderer:function(){return this.renderer;},setDefaultUrl:function(A){this.defaultUrl=A;},abort:function(){if(this.transaction){Roo.Ajax.abort(this.transaction);}},isUpdating:function(){if(this.transaction){return Roo.Ajax.isLoading(this.transaction);}return false;}});Roo.UpdateManager.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Roo.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'
Loading...
'};Roo.UpdateManager.updateElement=function(el,A,B,C){var um=Roo.get(el,true).getUpdateManager();Roo.apply(um,C);um.update(A,B,C?C.callback:null);};Roo.UpdateManager.update=Roo.UpdateManager.updateElement;Roo.UpdateManager.BasicRenderer=function(){};Roo.UpdateManager.BasicRenderer.prototype={render:function(el,A,B,C){el.update(A.responseText,B.loadScripts,C);}}; Roo.util.DelayedTask=function(fn,A,B){var id=null,d,t;var C=function(){var D=new Date().getTime();if(D-t>=d){clearInterval(id);id=null;fn.apply(A,B||[]);}};this.delay=function(D,E,F,G){if(id&&D!=d){this.cancel();} d=D;t=new Date().getTime();fn=E||fn;A=F||A;B=G||B;if(!id){id=setInterval(C,d);}};this.cancel=function(){if(id){clearInterval(id);id=null;}};}; Roo.util.TaskRunner=function(A){A=A||10;var B=[],C=[];var id=0;var D=false;var E=function(){D=false;clearInterval(id);id=0;};var F=function(){if(!D){D=true;id=setInterval(H,A);}};var G=function(I){C.push(I);if(I.onStop){I.onStop();}};var H=function(){if(C.length>0){for(var i=0,len=C.length;i1||G instanceof Array){var args=arguments.length>1?arguments:G;for(var i=0,len=args.length;i=this.length){return this.add(M,o);} -this.length++;this.items.splice(L,0,o);if(typeof M!="undefined"&&M!=null){this.map[M]=o;} -this.keys.splice(L,0,M);this.fireEvent("add",L,o,M);return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(N){if(N=0){this.length--;var o=this.items[N];this.items.splice(N,1);var M=this.keys[N];if(typeof M!="undefined"){delete this.map[M];} -this.keys.splice(N,1);this.fireEvent("remove",o,M);}},removeKey:function(O){return this.removeAt(this.indexOfKey(O));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,len=this.items.length;i=d;i--){r[r.length]=e[i];}}return r;},filter:function(f,g){if(!g.exec){g=String(g);if(g.length==0){return this.clone();} -g=new RegExp("^"+Roo.escapeRe(g),"i");}return this.filterBy(function(o){return o&&g.test(o[f]);});},filterBy:function(fn,h){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,len=it.length;i1||A instanceof Array){var args=arguments.length>1?arguments:A;for(var i=0,len=args.length;i=this.length){return this.add(B,o);} +this.length++;this.items.splice(A,0,o);if(typeof B!="undefined"&&B!=null){this.map[B]=o;} +this.keys.splice(A,0,B);this.fireEvent("add",A,o,B);return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(A){if(A=0){this.length--;var o=this.items[A];this.items.splice(A,1);var key=this.keys[A];if(typeof key!="undefined"){delete this.map[key];} +this.keys.splice(A,1);this.fireEvent("remove",o,key);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,len=this.items.length;i=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B);if(B.length==0){return this.clone();} +B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,len=it.length;iS){return R.substr(0,S-3)+"...";}return R;},undef:function(T){return typeof T!="undefined"?T:"";},htmlEncode:function(U){return !U?U:String(U).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"');},trim:function(W){return String(W).replace(A,"");},substr:function(X,Y,Z){return String(X).substr(Y,Z);},lowercase:function(a){return String(a).toLowerCase();},uppercase:function(b){return String(b).toUpperCase();},capitalize:function(c){return !c?c:c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args);}else {return eval(fn).call(window,value);}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split('.');var d=ps[0];var e=ps[1]?'.'+ps[1]:'.00';var r=/(\d+)(\d{3})/;while(r.test(d)){d=d.replace(r,'$1'+','+'$2');}return "$"+d+e;},date:function(v,f){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(f||"m/d/Y");},dateRenderer:function(g){return function(v){return Roo.util.Format.date(v,g);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");}};}(); +Roo.util.Format=function(){var A=/^\s+|\s+$/g;return {ellipsis:function(B,C){if(B&&B.length>C){return B.substr(0,C-3)+"...";}return B;},undef:function(B){return typeof B!="undefined"?B:"";},htmlEncode:function(B){return !B?B:String(B).replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/</g,"<").replace(/"/g,'"');},trim:function(B){return String(B).replace(A,"");},substr:function(B,C,D){return String(B).substr(C,D);},lowercase:function(B){return String(B).toLowerCase();},uppercase:function(B){return String(B).toUpperCase();},capitalize:function(B){return !B?B:B.charAt(0).toUpperCase()+B.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args);}else {return eval(fn).call(window,value);}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split('.');var B=ps[0];var C=ps[1]?'.'+ps[1]:'.00';var r=/(\d+)(\d{3})/;while(r.test(B)){B=B.replace(r,'$1'+','+'$2');}return "$"+B+C;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||"m/d/Y");},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");}};}(); Roo.MasterTemplate=function(){Roo.MasterTemplate.superclass.constructor.apply(this,arguments);this.originalHtml=this.html;var st={};var m,re=this.subTemplateRe;re.lastIndex=0;var A=0;while(m=re.exec(this.html)){var name=m[1],content=m[2];st[A]={name:name,index:A,buffer:[],tpl:new Roo.Template(content)};if(name){st[name]=st[A];} st[A].tpl.compile();st[A].tpl.call=this.call.createDelegate(this);A++;} -this.subCount=A;this.subs=st;};Roo.extend(Roo.MasterTemplate,Roo.Template,{subTemplateRe:/((?:.|\n)*?)<\/tpl>/gi,add:function(B,C){if(arguments.length==1){C=arguments[0];B=0;}var s=this.subs[B];s.buffer[s.buffer.length]=s.tpl.apply(C);return this;},fill:function(D,E,F){var a=arguments;if(a.length==1||(a.length==2&&typeof a[1]=="boolean")){E=a[0];D=0;F=a[1];}if(F){this.reset();}for(var i=0,len=E.length;i((?:.|\n)*?)<\/tpl>/gi,add:function(A,B){if(arguments.length==1){B=arguments[0];A=0;}var s=this.subs[A];s.buffer[s.buffer.length]=s.tpl.apply(B);return this;},fill:function(A,B,C){var a=arguments;if(a.length==1||(a.length==2&&typeof a[1]=="boolean")){B=a[0];A=0;C=a[1];}if(C){this.reset();}for(var i=0,len=B.length;i=0;--j){A[ssRules[j].selectorText]=ssRules[j];}}catch(e){}},getRules:function(W){if(A==null||W){A={};var ds=B.styleSheets;for(var i=0,len=ds.length;i=0;--j){A[ssRules[j].selectorText]=ssRules[j];}}catch(e){}},getRules:function(E){if(A==null||E){A={};var ds=B.styleSheets;for(var i=0,len=ds.length;i=37&&k<=40){e.stopEvent();}},relay:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(h&&this[h]){if(this.doRelay(e,this[h],h)!==true){e[this.defaultEventAction]();}}},doRelay:function(e,h,B){return h.call(this.scope||this,e);},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Roo.isIE||Roo.isAir){this.el.on("keydown",this.relay,this);}else {this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this);} +Roo.KeyNav=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(!this.disabled){this.disabled=true;this.enable();}};Roo.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(Roo.isSafari&&h&&k>=37&&k<=40){e.stopEvent();}},relay:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(h&&this[h]){if(this.doRelay(e,this[h],h)!==true){e[this.defaultEventAction]();}}},doRelay:function(e,h,A){return h.call(this.scope||this,e);},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Roo.isIE||Roo.isAir){this.el.on("keydown",this.relay,this);}else {this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this);} this.disabled=false;}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Roo.isIE||Roo.isAir){this.el.un("keydown",this.relay);}else {this.el.un("keydown",this.prepareEvent);this.el.un("keypress",this.relay);} this.disabled=true;}}}; Roo.KeyMap=function(el,A,B){this.el=Roo.get(el);this.eventName=B||"keydown";this.bindings=[];if(A){this.addBinding(A);} -this.enable();};Roo.KeyMap.prototype={stopEvent:false,addBinding:function(C){if(C instanceof Array){for(var i=0,len=C.length;i=this.minX;i=i-k){if(!l[i]){this.xTicks[this.xTicks.length]=i;l[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+k){if(!l[i]){this.xTicks[this.xTicks.length]=i;l[i]=true;}} -this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(m,n){this.yTicks=[];this.yTickSize=n;var o={};for(var i=this.initPageY;i>=this.minY;i=i-n){if(!o[i]){this.yTicks[this.yTicks.length]=i;o[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+n){if(!o[i]){this.yTicks[this.yTicks.length]=i;o[i]=true;}} -this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(q,r,t){this.leftConstraint=q;this.rightConstraint=r;this.minX=this.initPageX-q;this.maxX=this.initPageX+r;if(t){this.setXTicks(this.initPageX,t);} -this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(u,v,w){this.topConstraint=u;this.bottomConstraint=v;this.minY=this.initPageY-u;this.maxY=this.initPageY+v;if(w){this.setYTicks(this.initPageY,w);} -this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else {this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(z,AA){if(!AA){return z;}else if(AA[0]>=z){return AA[0];}else {for(var i=0,len=AA.length;i=z){var diff1=z-AA[i];var diff2=AA[next]-z;return (diff2>diff1)?AA[i]:AA[next];}}return AA[AA.length-1];}},toString:function(){return ("DragDrop "+this.id);}};})(); -if(!Roo.dd.DragDropMgr){Roo.dd.DragDropMgr=function(){var A=Roo.EventManager;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(AG,AH){for(var i in this.ids){for(var j in this.ids[i]){var h=this.ids[i][j];if(!this.isTypeOfDD(h)){continue;} -h[AG].apply(h,AH);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(AI,AJ){if(!this.initialized){this.init();}if(!this.ids[AJ]){this.ids[AJ]={};} -this.ids[AJ][AI.id]=AI;},removeDDFromGroup:function(AK,AL){if(!this.ids[AL]){this.ids[AL]={};}var AM=this.ids[AL];if(AM&&AM[AK.id]){delete AM[AK.id];}},_remove:function(AN){for(var g in AN.groups){if(g&&this.ids[g][AN.id]){delete this.ids[g][AN.id];}}delete this.handleIds[AN.id];},regHandle:function(AO,AP){if(!this.handleIds[AO]){this.handleIds[AO]={};} -this.handleIds[AO][AP]=AP;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(AQ,AR){var AS=[];for(var i in AQ.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!AR||dd.isTarget){AS[AS.length]=dd;}}}return AS;},isLegalTarget:function(AT,AU){var AV=this.getRelated(AT,true);for(var i=0,d=AV.length;i=this.minX;i=i-D){if(!E[i]){this.xTicks[this.xTicks.length]=i;E[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+D){if(!E[i]){this.xTicks[this.xTicks.length]=i;E[i]=true;}} +this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(C,D){this.yTicks=[];this.yTickSize=D;var E={};for(var i=this.initPageY;i>=this.minY;i=i-D){if(!E[i]){this.yTicks[this.yTicks.length]=i;E[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+D){if(!E[i]){this.yTicks[this.yTicks.length]=i;E[i]=true;}} +this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(C,D,E){this.leftConstraint=C;this.rightConstraint=D;this.minX=this.initPageX-C;this.maxX=this.initPageX+D;if(E){this.setXTicks(this.initPageX,E);} +this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,D,E){this.topConstraint=C;this.bottomConstraint=D;this.minY=this.initPageY-C;this.maxY=this.initPageY+D;if(E){this.setYTicks(this.initPageY,E);} +this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else {this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(C,D){if(!D){return C;}else if(D[0]>=C){return D[0];}else {for(var i=0,len=D.length;i=C){var diff1=C-D[i];var diff2=D[next]-C;return (diff2>diff1)?D[i]:D[next];}}return D[D.length-1];}},toString:function(){return ("DragDrop "+this.id);}};})(); +if(!Roo.dd.DragDropMgr){Roo.dd.DragDropMgr=function(){var A=Roo.EventManager;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(B,C){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;} +oDD[B].apply(oDD,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(B,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};} +this.ids[C][B.id]=B;},removeDDFromGroup:function(B,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[B.id]){delete D[B.id];}},_remove:function(B){for(var g in B.groups){if(g&&this.ids[g][B.id]){delete this.ids[g][B.id];}}delete this.handleIds[B.id];},regHandle:function(B,C){if(!this.handleIds[B]){this.handleIds[B]={};} +this.handleIds[B][C]=C;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(B,C){var D=[];for(var i in B.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!C||dd.isTarget){D[D.length]=dd;}}}return D;},isLegalTarget:function(B,C){var D=this.getRelated(B,true);for(var i=0,len=D.length;ithis.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);if(!this.dragCurrent.moveOnly){this.fireEvents(e,false);}} -this.stopEvent(e);return true;},fireEvents:function(e,Aa){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var pt=e.getPoint();var Ab=[];var Ac=[];var Ad=[];var Ae=[];var Af=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){Ac.push(ddo);} -Ab[i]=true;delete this.dragOvers[i];}for(var AL in dc.groups){if("string"!=typeof AL){continue;}for(i in this.ids[AL]){var AZ=this.ids[AL][i];if(!this.isTypeOfDD(AZ)){continue;}if(AZ.isTarget&&!AZ.isLocked()&&AZ!=dc){if(this.isOverTarget(pt,AZ,this.mode)){if(Aa){Ae.push(AZ);}else {if(!Ab[AZ.id]){Af.push(AZ);}else {Ad.push(AZ);} -this.dragOvers[AZ.id]=AZ;}}}}}if(this.mode){if(Ac.length){dc.b4DragOut(e,Ac);dc.onDragOut(e,Ac);}if(Af.length){dc.onDragEnter(e,Af);}if(Ad.length){dc.b4DragOver(e,Ad);dc.onDragOver(e,Ad);}if(Ae.length){dc.b4DragDrop(e,Ae);dc.onDragDrop(e,Ae);}}else {var d=0;for(i=0,d=Ac.length;i2000){}else {setTimeout(Ay._addListeners,10);if(document&&document.body){Ay._timeoutCount+=1;}}}},handleWasClicked:function(Az,id){if(this.isHandle(id,Az.id)){return true;}else {var p=Az.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else {p=p.parentNode;}}}return false;}};}();Roo.dd.DDM=Roo.dd.DragDropMgr;Roo.dd.DDM._addListeners();} -Roo.dd.DD=function(id,A,B){if(id){this.init(id,A,B);}};Roo.extend(Roo.dd.DD,Roo.dd.DragDrop,{scroll:true,autoOffset:function(C,D){var x=C-this.startPageX;var y=D-this.startPageY;this.setDelta(x,y);},setDelta:function(E,F){this.deltaX=E;this.deltaY=F;},setDragElPos:function(G,H){var el=this.getDragEl();this.alignElWithMouse(el,G,H);},alignElWithMouse:function(el,I,J){var K=this.getTargetCoord(I,J);var L=el.dom?el:Roo.fly(el);if(!this.deltaSetXY){var aCoord=[K.x,K.y];L.setXY(aCoord);var newLeft=L.getLeft(true);var newTop=L.getTop(true);this.deltaSetXY=[newLeft-K.x,newTop-K.y];}else {L.setLeftTop(K.x+this.deltaSetXY[0],K.y+this.deltaSetXY[1]);} -this.cachePosition(K.x,K.y);this.autoScroll(K.x,K.y,el.offsetHeight,el.offsetWidth);return K;},cachePosition:function(M,N){if(M){this.lastPageX=M;this.lastPageY=N;}else {var aCoord=Roo.lib.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=Roo.lib.Dom.getViewWidth();var clientW=Roo.lib.Dom.getViewHeight();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot0&&y-stclientW&&toRight0&&x-slthis.maxX){x=this.maxX;}}if(this.constrainY){if(ythis.maxY){y=this.maxY;}} +this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var B=this.elementCache[id];if(!B||!B.el){B=this.elementCache[id]=new this.ElementWrapper(Roo.getDom(id));}return B;},getElement:function(id){return Roo.getDom(id);},getCss:function(id){var el=Roo.getDom(id);return (el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return Roo.lib.Dom.getX(el);},getPosY:function(el){return Roo.lib.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else {var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else {n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,B=document.documentElement,db=document.body;if(B&&(B.scrollTop||B.scrollLeft)){t=B.scrollTop;l=B.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else {}return {top:t,left:l};},getStyle:function(el,B){return Roo.fly(el).getStyle(B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,C){var D=Roo.lib.Dom.getXY(C);Roo.lib.Dom.setXY(B,D);},numericSort:function(a,b){return (a-b);},_timeoutCount:0,_addListeners:function(){var B=Roo.dd.DDM;if(Roo.lib.Event&&document){B._onLoad();}else {if(B._timeoutCount>2000){}else {setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,id){if(this.isHandle(id,B.id)){return true;}else {var p=B.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else {p=p.parentNode;}}}return false;}};}();Roo.dd.DDM=Roo.dd.DragDropMgr;Roo.dd.DDM._addListeners();} +Roo.dd.DD=function(id,A,B){if(id){this.init(id,A,B);}};Roo.extend(Roo.dd.DD,Roo.dd.DragDrop,{scroll:true,autoOffset:function(A,B){var x=A-this.startPageX;var y=B-this.startPageY;this.setDelta(x,y);},setDelta:function(A,B){this.deltaX=A;this.deltaY=B;},setDragElPos:function(A,B){var el=this.getDragEl();this.alignElWithMouse(el,A,B);},alignElWithMouse:function(el,A,B){var C=this.getTargetCoord(A,B);var D=el.dom?el:Roo.fly(el);if(!this.deltaSetXY){var aCoord=[C.x,C.y];D.setXY(aCoord);var newLeft=D.getLeft(true);var newTop=D.getTop(true);this.deltaSetXY=[newLeft-C.x,newTop-C.y];}else {D.setLeftTop(C.x+this.deltaSetXY[0],C.y+this.deltaSetXY[1]);} +this.cachePosition(C.x,C.y);this.autoScroll(C.x,C.y,el.offsetHeight,el.offsetWidth);return C;},cachePosition:function(A,B){if(A){this.lastPageX=A;this.lastPageY=B;}else {var aCoord=Roo.lib.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=Roo.lib.Dom.getViewWidth();var clientW=Roo.lib.Dom.getViewHeight();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot0&&y-stclientW&&toRight0&&x-slthis.maxX){x=this.maxX;}}if(this.constrainY){if(ythis.maxY){y=this.maxY;}} x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return {x:x,y:y};},applyConfig:function(){Roo.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(e.getPageX(),e.getPageY());},b4Drag:function(e){this.setDragElPos(e.getPageX(),e.getPageY());},toString:function(){return ("DD "+this.id);}}); -Roo.dd.DDProxy=function(id,A,B){if(id){this.init(id,A,B);this.initFrame();}};Roo.dd.DDProxy.dragElId="ygddfdiv";Roo.extend(Roo.dd.DDProxy,Roo.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var C=this;var D=document.body;if(!D||!D.firstChild){setTimeout(function(){C.createFrame();},50);return;}var E=this.getDragEl();if(!E){E=document.createElement("div");E.id=this.dragElId;var s=E.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;D.insertBefore(E,D.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){Roo.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Roo.dd.DDProxy.dragElId);},showFrame:function(F,G){var el=this.getEl();var H=this.getDragEl();var s=H.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));} -this.setDragElPos(F,G);Roo.fly(H).show();},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();Roo.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight);}},b4MouseDown:function(e){var x=e.getPageX();var y=e.getPageY();this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){Roo.fly(this.getDragEl()).hide();},endDrag:function(e){var I=this.getEl();var J=this.getDragEl();J.style.visibility="";this.beforeMove();I.style.visibility="hidden";Roo.dd.DDM.moveToEl(I,J);J.style.visibility="hidden";I.style.visibility="";this.afterDrag();},beforeMove:function(){},afterDrag:function(){},toString:function(){return ("DDProxy "+this.id);}}); +Roo.dd.DDProxy=function(id,A,B){if(id){this.init(id,A,B);this.initFrame();}};Roo.dd.DDProxy.dragElId="ygddfdiv";Roo.extend(Roo.dd.DDProxy,Roo.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var A=this;var B=document.body;if(!B||!B.firstChild){setTimeout(function(){A.createFrame();},50);return;}var C=this.getDragEl();if(!C){C=document.createElement("div");C.id=this.dragElId;var s=C.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;B.insertBefore(C,B.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){Roo.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Roo.dd.DDProxy.dragElId);},showFrame:function(A,B){var el=this.getEl();var C=this.getDragEl();var s=C.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));} +this.setDragElPos(A,B);Roo.fly(C).show();},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();Roo.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight);}},b4MouseDown:function(e){var x=e.getPageX();var y=e.getPageY();this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){Roo.fly(this.getDragEl()).hide();},endDrag:function(e){var A=this.getEl();var B=this.getDragEl();B.style.visibility="";this.beforeMove();A.style.visibility="hidden";Roo.dd.DDM.moveToEl(A,B);B.style.visibility="hidden";A.style.visibility="";this.afterDrag();},beforeMove:function(){},afterDrag:function(){},toString:function(){return ("DDProxy "+this.id);}}); Roo.dd.DDTarget=function(id,A,B){if(id){this.initTarget(id,A,B);}};Roo.extend(Roo.dd.DDTarget,Roo.dd.DragDrop,{toString:function(){return ("DDTarget "+this.id);}}); Roo.dd.ScrollManager=function(){var A=Roo.dd.DragDropMgr;var B={};var C=null;var D={};var E=function(e){C=null;H();};var F=function(){if(A.dragCurrent){A.refreshCache(A.dragCurrent.groups);}};var G=function(){if(A.dragCurrent){var dds=Roo.dd.ScrollManager;if(!dds.animate){if(D.el.scroll(D.dir,dds.increment)){F();}}else {D.el.scroll(D.dir,dds.increment,true,dds.animDuration,F);}}};var H=function(){if(D.id){clearInterval(D.id);} D.id=0;D.el=null;D.dir="";};var I=function(el,K){H();D.el=el;D.dir=K;D.id=setInterval(G,Roo.dd.ScrollManager.frequency);};var J=function(e,K){if(K||!A.dragCurrent){return;}var L=Roo.dd.ScrollManager;if(!C||C!=A.dragCurrent){C=A.dragCurrent;L.refreshCache();}var xy=Roo.lib.Event.getXY(e);var pt=new Roo.lib.Point(xy[0],xy[1]);for(var id in B){var el=B[id],r=el._region;if(r&&r.contains(pt)&&el.isScrollable()){if(r.bottom-pt.y<=L.thresh){if(D.el!=el){I(el,"down");}return;}else if(r.right-pt.x<=L.thresh){if(D.el!=el){I(el,"left");}return;}else if(pt.y-r.top<=L.thresh){if(D.el!=el){I(el,"up");}return;}else if(pt.x-r.left<=L.thresh){if(D.el!=el){I(el,"right");}return;}}} H();};A.fireEvents=A.fireEvents.createSequence(J,A);A.stopDrag=A.stopDrag.createSequence(E,A);return {register:function(el){if(el instanceof Array){for(var i=0,len=el.length;i]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase();},asDate:function(s){if(!s){return 0;}if(s instanceof Date){return s.getTime();}return Date.parse(String(s));},asFloat:function(s){var A=parseFloat(String(s).replace(/,/g,""));if(isNaN(A))A=0;return A;},asInt:function(s){var B=parseInt(String(s).replace(/,/g,""));if(isNaN(B))B=0;return B;}}; -Roo.data.Record=function(A,id){this.id=(id||id===0)?id:++Roo.data.Record.AUTO_ID;this.data=A;};Roo.data.Record.create=function(o){var f=function(){f.superclass.constructor.apply(this,arguments);};Roo.extend(f,Roo.data.Record);var p=f.prototype;p.fields=new Roo.util.MixedCollection(false,function(B){return B.name;});for(var i=0,len=o.length;i]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase();},asDate:function(s){if(!s){return 0;}if(s instanceof Date){return s.getTime();}return Date.parse(String(s));},asFloat:function(s){var A=parseFloat(String(s).replace(/,/g,""));if(isNaN(A))A=0;return A;},asInt:function(s){var A=parseInt(String(s).replace(/,/g,""));if(isNaN(A))A=0;return A;}}; +Roo.data.Record=function(A,id){this.id=(id||id===0)?id:++Roo.data.Record.AUTO_ID;this.data=A;};Roo.data.Record.create=function(o){var f=function(){f.superclass.constructor.apply(this,arguments);};Roo.extend(f,Roo.data.Record);var p=f.prototype;p.fields=new Roo.util.MixedCollection(false,function(A){return A.name;});for(var i=0,len=o.length;iv2?1:(v1v2?1:(v10;},appendChild:function(I){var J=false;if(I instanceof Array){J=I;}else if(arguments.length>1){J=arguments;}if(J){for(var i=0,len=J.length;i0){var sortFn=k?function(){fn.apply(k,arguments);}:fn;cs.sort(sortFn);for(var i=0;i0;},appendChild:function(A){var B=false;if(A instanceof Array){B=A;}else if(arguments.length>1){B=arguments;}if(B){for(var i=0,len=B.length;i0){var sortFn=A?function(){fn.apply(A,arguments);}:fn;cs.sort(sortFn);for(var i=0;ivw+s.left){x=vw-w-this.shadowOffset;moved=true;}if((y+h)>vh+s.top){y=vh-h-this.shadowOffset;moved=true;}if(x=ay){y=ay-h-5;}} xy=[x,y];this.storeXY(xy);A.setXY.call(this,xy);this.sync();}}},isVisible:function(){return this.visible;},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("");}else if(this.lastXY){A.setXY.call(this,this.lastXY);}else if(this.lastLT){A.setLeftTop.call(this,this.lastLT[0],this.lastLT[1]);}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false);}else {this.setLeftTop(-10000,-10000);}},setVisible:function(v,a,d,c,e){if(v){this.showAction();}if(a&&v){var cb=function(){this.sync(true);if(c){c();}}.createDelegate(this);A.setVisible.call(this,true,true,d,cb,e);}else {if(!v){this.hideUnders(true);}var cb=c;if(a){cb=function(){this.hideAction();if(c){c();}}.createDelegate(this);} -A.setVisible.call(this,v,a,d,cb,e);if(v){this.sync(true);}else if(!a){this.hideAction();}}},storeXY:function(xy){delete this.lastLT;this.lastXY=xy;},storeLeftTop:function(G,H){delete this.lastXY;this.lastLT=[G,H];},beforeFx:function(){this.beforeAction();return Roo.Layer.superclass.beforeFx.apply(this,arguments);},afterFx:function(){Roo.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible());},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide();}},setLeft:function(I){this.storeLeftTop(I,this.getTop(true));A.setLeft.apply(this,arguments);this.sync();},setTop:function(J){this.storeLeftTop(this.getLeft(true),J);A.setTop.apply(this,arguments);this.sync();},setLeftTop:function(K,L){this.storeLeftTop(K,L);A.setLeftTop.apply(this,arguments);this.sync();},setXY:function(xy,a,d,c,e){this.fixDisplay();this.beforeAction();this.storeXY(xy);var cb=this.createCB(c);A.setXY.call(this,xy,a,d,cb,e);if(!a){cb();}},createCB:function(c){var el=this;return function(){el.constrainXY();el.sync(true);if(c){c();}};},setX:function(x,a,d,c,e){this.setXY([x,this.getY()],a,d,c,e);},setY:function(y,a,d,c,e){this.setXY([this.getX(),y],a,d,c,e);},setSize:function(w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setSize.call(this,w,h,a,d,cb,e);if(!a){cb();}},setWidth:function(w,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setWidth.call(this,w,a,d,cb,e);if(!a){cb();}},setHeight:function(h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setHeight.call(this,h,a,d,cb,e);if(!a){cb();}},setBounds:function(x,y,w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);if(!a){this.storeXY([x,y]);A.setXY.call(this,[x,y]);A.setSize.call(this,w,h,a,d,cb,e);cb();}else {A.setBounds.call(this,x,y,w,h,a,d,cb,e);}return this;},setZIndex:function(M){this.zindex=M;this.setStyle("z-index",M+2);if(this.shadow){this.shadow.setZIndex(M+1);}if(this.shim){this.shim.setStyle("z-index",M);}}});})(); -Roo.Shadow=function(A){Roo.apply(this,A);if(typeof this.mode!="string"){this.mode=this.defaultMode;}var o=this.offset,a={h:0};var B=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":a.w=0;a.l=a.t=o;a.t-=1;if(Roo.isIE){a.l-=this.offset+B;a.t-=this.offset+B;a.w-=B;a.h-=B;a.t+=1;}break;case "sides":a.w=(o*2);a.l=-o;a.t=o-1;if(Roo.isIE){a.l-=(this.offset-B);a.t-=this.offset+B;a.l+=1;a.w-=(this.offset-B)*2;a.w-=B+1;a.h-=1;}break;case "frame":a.w=a.h=(o*2);a.l=a.t=-o;a.t+=1;a.h-=2;if(Roo.isIE){a.l-=(this.offset-B);a.t-=(this.offset-B);a.l+=1;a.w-=(this.offset+B+1);a.h-=(this.offset+B);a.h+=1;}break;};this.adjusts=a;};Roo.Shadow.prototype={offset:4,defaultMode:"drop",show:function(C){C=Roo.get(C);if(!this.el){this.el=Roo.Shadow.Pool.pull();if(this.el.dom.nextSibling!=C.dom){this.el.insertBefore(C);}} -this.el.setStyle("z-index",this.zIndex||parseInt(C.getStyle("z-index"),10)-1);if(Roo.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";} -this.realign(C.getLeft(true),C.getTop(true),C.getWidth(),C.getHeight());this.el.dom.style.display="block";},isVisible:function(){return this.el?true:false;},realign:function(l,t,w,h){if(!this.el){return;}var a=this.adjusts,d=this.el.dom,s=d.style;var D=0;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";var sw=(w+a.w),sh=(h+a.h),E=sw+"px",F=sh+"px";if(s.width!=E||s.height!=F){s.width=E;s.height=F;if(!Roo.isIE){var cn=d.childNodes;var sww=Math.max(0,(sw-12))+"px";cn[0].childNodes[1].style.width=sww;cn[1].childNodes[1].style.width=sww;cn[2].childNodes[1].style.width=sww;cn[1].style.height=Math.max(0,(sh-12))+"px";}}},hide:function(){if(this.el){this.el.dom.style.display="none";Roo.Shadow.Pool.push(this.el);delete this.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}}};Roo.Shadow.Pool=function(){var p=[];var G=Roo.isIE?'
':'
';return {pull:function(){var sh=p.shift();if(!sh){sh=Roo.get(Roo.DomHelper.insertHtml("beforeBegin",document.body.firstChild,G));sh.autoBoxAdjust=false;}return sh;},push:function(sh){p.push(sh);}};}(); +A.setVisible.call(this,v,a,d,cb,e);if(v){this.sync(true);}else if(!a){this.hideAction();}}},storeXY:function(xy){delete this.lastLT;this.lastXY=xy;},storeLeftTop:function(C,D){delete this.lastXY;this.lastLT=[C,D];},beforeFx:function(){this.beforeAction();return Roo.Layer.superclass.beforeFx.apply(this,arguments);},afterFx:function(){Roo.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible());},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide();}},setLeft:function(C){this.storeLeftTop(C,this.getTop(true));A.setLeft.apply(this,arguments);this.sync();},setTop:function(C){this.storeLeftTop(this.getLeft(true),C);A.setTop.apply(this,arguments);this.sync();},setLeftTop:function(C,D){this.storeLeftTop(C,D);A.setLeftTop.apply(this,arguments);this.sync();},setXY:function(xy,a,d,c,e){this.fixDisplay();this.beforeAction();this.storeXY(xy);var cb=this.createCB(c);A.setXY.call(this,xy,a,d,cb,e);if(!a){cb();}},createCB:function(c){var el=this;return function(){el.constrainXY();el.sync(true);if(c){c();}};},setX:function(x,a,d,c,e){this.setXY([x,this.getY()],a,d,c,e);},setY:function(y,a,d,c,e){this.setXY([this.getX(),y],a,d,c,e);},setSize:function(w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setSize.call(this,w,h,a,d,cb,e);if(!a){cb();}},setWidth:function(w,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setWidth.call(this,w,a,d,cb,e);if(!a){cb();}},setHeight:function(h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setHeight.call(this,h,a,d,cb,e);if(!a){cb();}},setBounds:function(x,y,w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);if(!a){this.storeXY([x,y]);A.setXY.call(this,[x,y]);A.setSize.call(this,w,h,a,d,cb,e);cb();}else {A.setBounds.call(this,x,y,w,h,a,d,cb,e);}return this;},setZIndex:function(C){this.zindex=C;this.setStyle("z-index",C+2);if(this.shadow){this.shadow.setZIndex(C+1);}if(this.shim){this.shim.setStyle("z-index",C);}}});})(); +Roo.Shadow=function(A){Roo.apply(this,A);if(typeof this.mode!="string"){this.mode=this.defaultMode;}var o=this.offset,a={h:0};var B=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":a.w=0;a.l=a.t=o;a.t-=1;if(Roo.isIE){a.l-=this.offset+B;a.t-=this.offset+B;a.w-=B;a.h-=B;a.t+=1;}break;case "sides":a.w=(o*2);a.l=-o;a.t=o-1;if(Roo.isIE){a.l-=(this.offset-B);a.t-=this.offset+B;a.l+=1;a.w-=(this.offset-B)*2;a.w-=B+1;a.h-=1;}break;case "frame":a.w=a.h=(o*2);a.l=a.t=-o;a.t+=1;a.h-=2;if(Roo.isIE){a.l-=(this.offset-B);a.t-=(this.offset-B);a.l+=1;a.w-=(this.offset+B+1);a.h-=(this.offset+B);a.h+=1;}break;};this.adjusts=a;};Roo.Shadow.prototype={offset:4,defaultMode:"drop",show:function(A){A=Roo.get(A);if(!this.el){this.el=Roo.Shadow.Pool.pull();if(this.el.dom.nextSibling!=A.dom){this.el.insertBefore(A);}} +this.el.setStyle("z-index",this.zIndex||parseInt(A.getStyle("z-index"),10)-1);if(Roo.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";} +this.realign(A.getLeft(true),A.getTop(true),A.getWidth(),A.getHeight());this.el.dom.style.display="block";},isVisible:function(){return this.el?true:false;},realign:function(l,t,w,h){if(!this.el){return;}var a=this.adjusts,d=this.el.dom,s=d.style;var A=0;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";var sw=(w+a.w),sh=(h+a.h),B=sw+"px",C=sh+"px";if(s.width!=B||s.height!=C){s.width=B;s.height=C;if(!Roo.isIE){var cn=d.childNodes;var sww=Math.max(0,(sw-12))+"px";cn[0].childNodes[1].style.width=sww;cn[1].childNodes[1].style.width=sww;cn[2].childNodes[1].style.width=sww;cn[1].style.height=Math.max(0,(sh-12))+"px";}}},hide:function(){if(this.el){this.el.dom.style.display="none";Roo.Shadow.Pool.push(this.el);delete this.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}}};Roo.Shadow.Pool=function(){var p=[];var A=Roo.isIE?'
':'
';return {pull:function(){var sh=p.shift();if(!sh){sh=Roo.get(Roo.DomHelper.insertHtml("beforeBegin",document.body.firstChild,A));sh.autoBoxAdjust=false;}return sh;},push:function(sh){p.push(sh);}};}(); Roo.BoxComponent=function(A){Roo.Component.call(this,A);this.addEvents({resize:true,move:true});};Roo.extend(Roo.BoxComponent,Roo.Component,{boxReady:false,deferHeight:false,setSize:function(w,h){if(typeof w=='object'){h=w.height;w=w.width;}if(!this.boxReady){this.width=w;this.height=h;return this;}if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return this;} -this.lastSize={width:w,height:h};var B=this.adjustSize(w,h);var aw=B.width,ah=B.height;if(aw!==undefined||ah!==undefined){var rz=this.getResizeEl();if(!this.deferHeight&&aw!==undefined&&ah!==undefined){rz.setSize(aw,ah);}else if(!this.deferHeight&&ah!==undefined){rz.setHeight(ah);}else if(aw!==undefined){rz.setWidth(aw);} -this.onResize(aw,ah,w,h);this.fireEvent('resize',this,aw,ah,w,h);}return this;},getSize:function(){return this.el.getSize();},getPosition:function(C){if(C===true){return [this.el.getLeft(true),this.el.getTop(true)];}return this.xy||this.el.getXY();},getBox:function(D){var s=this.el.getSize();if(D){s.x=this.el.getLeft(true);s.y=this.el.getTop(true);}else {var xy=this.xy||this.el.getXY();s.x=xy[0];s.y=xy[1];}return s;},updateBox:function(E){this.setSize(E.width,E.height);this.setPagePosition(E.x,E.y);return this;},getResizeEl:function(){return this.resizeEl||this.el;},getPositionEl:function(){return this.positionEl||this.el;},setPosition:function(x,y){this.x=x;this.y=y;if(!this.boxReady){return this;}var F=this.adjustPosition(x,y);var ax=F.x,ay=F.y;var el=this.getPositionEl();if(ax!==undefined||ay!==undefined){if(ax!==undefined&&ay!==undefined){el.setLeftTop(ax,ay);}else if(ax!==undefined){el.setLeft(ax);}else if(ay!==undefined){el.setTop(ay);} -this.onPosition(ax,ay);this.fireEvent('move',this,ax,ay);}return this;},setPagePosition:function(x,y){this.pageX=x;this.pageY=y;if(!this.boxReady){return;}if(x===undefined||y===undefined){return;}var p=this.el.translatePoints(x,y);this.setPosition(p.left,p.top);return this;},onRender:function(ct,G){Roo.BoxComponent.superclass.onRender.call(this,ct,G);if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl);}if(this.positionEl){this.positionEl=Roo.get(this.positionEl);}},afterRender:function(){Roo.BoxComponent.superclass.afterRender.call(this);this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y);}if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY);}},syncSize:function(){delete this.lastSize;this.setSize(this.el.getWidth(),this.el.getHeight());return this;},onResize:function(H,I,J,K){},onPosition:function(x,y){},adjustSize:function(w,h){if(this.autoWidth){w='auto';}if(this.autoHeight){h='auto';}return {width:w,height:h};},adjustPosition:function(x,y){return {x:x,y:y};}}); +this.lastSize={width:w,height:h};var A=this.adjustSize(w,h);var aw=A.width,ah=A.height;if(aw!==undefined||ah!==undefined){var rz=this.getResizeEl();if(!this.deferHeight&&aw!==undefined&&ah!==undefined){rz.setSize(aw,ah);}else if(!this.deferHeight&&ah!==undefined){rz.setHeight(ah);}else if(aw!==undefined){rz.setWidth(aw);} +this.onResize(aw,ah,w,h);this.fireEvent('resize',this,aw,ah,w,h);}return this;},getSize:function(){return this.el.getSize();},getPosition:function(A){if(A===true){return [this.el.getLeft(true),this.el.getTop(true)];}return this.xy||this.el.getXY();},getBox:function(A){var s=this.el.getSize();if(A){s.x=this.el.getLeft(true);s.y=this.el.getTop(true);}else {var xy=this.xy||this.el.getXY();s.x=xy[0];s.y=xy[1];}return s;},updateBox:function(A){this.setSize(A.width,A.height);this.setPagePosition(A.x,A.y);return this;},getResizeEl:function(){return this.resizeEl||this.el;},getPositionEl:function(){return this.positionEl||this.el;},setPosition:function(x,y){this.x=x;this.y=y;if(!this.boxReady){return this;}var A=this.adjustPosition(x,y);var ax=A.x,ay=A.y;var el=this.getPositionEl();if(ax!==undefined||ay!==undefined){if(ax!==undefined&&ay!==undefined){el.setLeftTop(ax,ay);}else if(ax!==undefined){el.setLeft(ax);}else if(ay!==undefined){el.setTop(ay);} +this.onPosition(ax,ay);this.fireEvent('move',this,ax,ay);}return this;},setPagePosition:function(x,y){this.pageX=x;this.pageY=y;if(!this.boxReady){return;}if(x===undefined||y===undefined){return;}var p=this.el.translatePoints(x,y);this.setPosition(p.left,p.top);return this;},onRender:function(ct,A){Roo.BoxComponent.superclass.onRender.call(this,ct,A);if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl);}if(this.positionEl){this.positionEl=Roo.get(this.positionEl);}},afterRender:function(){Roo.BoxComponent.superclass.afterRender.call(this);this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y);}if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY);}},syncSize:function(){delete this.lastSize;this.setSize(this.el.getWidth(),this.el.getHeight());return this;},onResize:function(A,B,C,D){},onPosition:function(x,y){},adjustSize:function(w,h){if(this.autoWidth){w='auto';}if(this.autoHeight){h='auto';}return {width:w,height:h};},adjustPosition:function(x,y){return {x:x,y:y};}}); Roo.SplitBar=function(A,B,C,D,E){this.el=Roo.get(A,true);this.el.dom.unselectable="on";this.resizingEl=Roo.get(B,true);this.orientation=C||Roo.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!E){this.proxy=Roo.SplitBar.createProxy(this.orientation);}else {this.proxy=Roo.get(E).dom;} this.dd=new Roo.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Roo.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Roo.SplitBar.HORIZONTAL){this.placement=D||(this.el.getX()>this.resizingEl.getX()?Roo.SplitBar.LEFT:Roo.SplitBar.RIGHT);this.el.addClass("x-splitbar-h");}else {this.placement=D||(this.el.getY()>this.resizingEl.getY()?Roo.SplitBar.TOP:Roo.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v");} this.addEvents({"resize":true,"moved":true,"beforeresize":true,"beforeapply":true});Roo.util.Observable.call(this);};Roo.extend(Roo.SplitBar,Roo.util.Observable,{onStartProxyDrag:function(x,y){this.fireEvent("beforeresize",this);if(!this.overlay){var o=Roo.DomHelper.insertFirst(document.body,{cls:"x-drag-overlay",html:" "},true);o.unselectable();o.enableDisplayMode("block");Roo.SplitBar.prototype.overlay=o;} -this.overlay.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.overlay.show();Roo.get(this.proxy).setDisplayed("block");var F=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();;this.activeMaxSize=this.getMaximumSize();;var c1=F-this.activeMinSize;var c2=Math.max(this.activeMaxSize-F,0);if(this.orientation==Roo.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Roo.SplitBar.LEFT?c1:c2,this.placement==Roo.SplitBar.LEFT?c2:c1);this.dd.setYConstraint(0,0);}else {this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Roo.SplitBar.TOP?c1:c2,this.placement==Roo.SplitBar.TOP?c2:c1);} -this.dragSpecs.startSize=F;this.dragSpecs.startPoint=[x,y];Roo.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y);},onEndProxyDrag:function(e){Roo.get(this.proxy).setDisplayed(false);var G=Roo.lib.Event.getXY(e);if(this.overlay){this.overlay.hide();}var H;if(this.orientation==Roo.SplitBar.HORIZONTAL){H=this.dragSpecs.startSize+(this.placement==Roo.SplitBar.LEFT?G[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-G[0]);}else {H=this.dragSpecs.startSize+(this.placement==Roo.SplitBar.TOP?G[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-G[1]);} -H=Math.min(Math.max(H,this.activeMinSize),this.activeMaxSize);if(H!=this.dragSpecs.startSize){if(this.fireEvent('beforeapply',this,H)!==false){this.adapter.setElementSize(this,H);this.fireEvent("moved",this,H);this.fireEvent("resize",this,H);}}},getAdapter:function(){return this.adapter;},setAdapter:function(I){this.adapter=I;this.adapter.init(this);},getMinimumSize:function(){return this.minSize;},setMinimumSize:function(J){this.minSize=J;},getMaximumSize:function(){return this.maxSize;},setMaximumSize:function(K){this.maxSize=K;},setCurrentSize:function(L){var M=this.animate;this.animate=false;this.adapter.setElementSize(this,L);this.animate=M;},destroy:function(N){if(this.shim){this.shim.remove();} -this.dd.unreg();this.proxy.parentNode.removeChild(this.proxy);if(N){this.el.remove();}}});Roo.SplitBar.createProxy=function(O){var P=new Roo.Element(document.createElement("div"));P.unselectable();var Q='x-splitbar-proxy';P.addClass(Q+' '+(O==Roo.SplitBar.HORIZONTAL?Q+'-h':Q+'-v'));document.body.appendChild(P.dom);return P.dom;};Roo.SplitBar.BasicLayoutAdapter=function(){};Roo.SplitBar.BasicLayoutAdapter.prototype={init:function(s){},getElementSize:function(s){if(s.orientation==Roo.SplitBar.HORIZONTAL){return s.resizingEl.getWidth();}else {return s.resizingEl.getHeight();}},setElementSize:function(s,R,S){if(s.orientation==Roo.SplitBar.HORIZONTAL){if(!s.animate){s.resizingEl.setWidth(R);if(S){S(s,R);}}else {s.resizingEl.setWidth(R,true,.1,S,'easeOut');}}else {if(!s.animate){s.resizingEl.setHeight(R);if(S){S(s,R);}}else {s.resizingEl.setHeight(R,true,.1,S,'easeOut');}}}};Roo.SplitBar.AbsoluteLayoutAdapter=function(T){this.basic=new Roo.SplitBar.BasicLayoutAdapter();this.container=Roo.get(T);};Roo.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(s){this.basic.init(s);},getElementSize:function(s){return this.basic.getElementSize(s);},setElementSize:function(s,U,V){this.basic.setElementSize(s,U,this.moveSplitter.createDelegate(this,[s]));},moveSplitter:function(s){var W=Roo.SplitBar;switch(s.placement){case W.LEFT:s.el.setX(s.resizingEl.getRight());break;case W.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case W.TOP:s.el.setY(s.resizingEl.getBottom());break;case W.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break;}}};Roo.SplitBar.VERTICAL=1;Roo.SplitBar.HORIZONTAL=2;Roo.SplitBar.LEFT=1;Roo.SplitBar.RIGHT=2;Roo.SplitBar.TOP=3;Roo.SplitBar.BOTTOM=4; +this.overlay.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.overlay.show();Roo.get(this.proxy).setDisplayed("block");var A=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();;this.activeMaxSize=this.getMaximumSize();;var c1=A-this.activeMinSize;var c2=Math.max(this.activeMaxSize-A,0);if(this.orientation==Roo.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Roo.SplitBar.LEFT?c1:c2,this.placement==Roo.SplitBar.LEFT?c2:c1);this.dd.setYConstraint(0,0);}else {this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Roo.SplitBar.TOP?c1:c2,this.placement==Roo.SplitBar.TOP?c2:c1);} +this.dragSpecs.startSize=A;this.dragSpecs.startPoint=[x,y];Roo.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y);},onEndProxyDrag:function(e){Roo.get(this.proxy).setDisplayed(false);var A=Roo.lib.Event.getXY(e);if(this.overlay){this.overlay.hide();}var B;if(this.orientation==Roo.SplitBar.HORIZONTAL){B=this.dragSpecs.startSize+(this.placement==Roo.SplitBar.LEFT?A[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-A[0]);}else {B=this.dragSpecs.startSize+(this.placement==Roo.SplitBar.TOP?A[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-A[1]);} +B=Math.min(Math.max(B,this.activeMinSize),this.activeMaxSize);if(B!=this.dragSpecs.startSize){if(this.fireEvent('beforeapply',this,B)!==false){this.adapter.setElementSize(this,B);this.fireEvent("moved",this,B);this.fireEvent("resize",this,B);}}},getAdapter:function(){return this.adapter;},setAdapter:function(A){this.adapter=A;this.adapter.init(this);},getMinimumSize:function(){return this.minSize;},setMinimumSize:function(A){this.minSize=A;},getMaximumSize:function(){return this.maxSize;},setMaximumSize:function(A){this.maxSize=A;},setCurrentSize:function(A){var B=this.animate;this.animate=false;this.adapter.setElementSize(this,A);this.animate=B;},destroy:function(A){if(this.shim){this.shim.remove();} +this.dd.unreg();this.proxy.parentNode.removeChild(this.proxy);if(A){this.el.remove();}}});Roo.SplitBar.createProxy=function(A){var B=new Roo.Element(document.createElement("div"));B.unselectable();var C='x-splitbar-proxy';B.addClass(C+' '+(A==Roo.SplitBar.HORIZONTAL?C+'-h':C+'-v'));document.body.appendChild(B.dom);return B.dom;};Roo.SplitBar.BasicLayoutAdapter=function(){};Roo.SplitBar.BasicLayoutAdapter.prototype={init:function(s){},getElementSize:function(s){if(s.orientation==Roo.SplitBar.HORIZONTAL){return s.resizingEl.getWidth();}else {return s.resizingEl.getHeight();}},setElementSize:function(s,A,B){if(s.orientation==Roo.SplitBar.HORIZONTAL){if(!s.animate){s.resizingEl.setWidth(A);if(B){B(s,A);}}else {s.resizingEl.setWidth(A,true,.1,B,'easeOut');}}else {if(!s.animate){s.resizingEl.setHeight(A);if(B){B(s,A);}}else {s.resizingEl.setHeight(A,true,.1,B,'easeOut');}}}};Roo.SplitBar.AbsoluteLayoutAdapter=function(A){this.basic=new Roo.SplitBar.BasicLayoutAdapter();this.container=Roo.get(A);};Roo.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(s){this.basic.init(s);},getElementSize:function(s){return this.basic.getElementSize(s);},setElementSize:function(s,A,B){this.basic.setElementSize(s,A,this.moveSplitter.createDelegate(this,[s]));},moveSplitter:function(s){var A=Roo.SplitBar;switch(s.placement){case A.LEFT:s.el.setX(s.resizingEl.getRight());break;case A.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case A.TOP:s.el.setY(s.resizingEl.getBottom());break;case A.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break;}}};Roo.SplitBar.VERTICAL=1;Roo.SplitBar.HORIZONTAL=2;Roo.SplitBar.LEFT=1;Roo.SplitBar.RIGHT=2;Roo.SplitBar.TOP=3;Roo.SplitBar.BOTTOM=4; Roo.View=function(A,B,C){if(typeof(B)=='undefined'){Roo.apply(this,A);this.el=Roo.get(this.el);}else {this.el=Roo.get(A);this.tpl=B;Roo.apply(this,C);}if(typeof(this.tpl)=="string"){this.tpl=new Roo.Template(this.tpl);}else {this.tpl=new Roo.factory(this.tpl,Roo);} this.tpl.compile();this.addEvents({"beforeclick":true,"click":true,"dblclick":true,"contextmenu":true,"selectionchange":true,"beforeselect":true});this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this});this.selections=[];this.nodes=[];this.cmp=new Roo.CompositeElementLite([]);if(this.store){this.store=Roo.factory(this.store,Roo.data);this.setStore(this.store,true);} -Roo.View.superclass.constructor.call(this);};Roo.extend(Roo.View,Roo.util.Observable,{store:false,el:'',tpl:false,selectedClass:"x-view-selected",emptyText:"",multiSelect:false,singleSelect:false,getEl:function(){return this.el;},refresh:function(){var t=this.tpl;this.clearSelections();this.el.update("");var D=[];var E=this.store.getRange();if(E.length<1){this.el.update(this.emptyText);return;}for(var i=0,len=E.length;i0){this.cmp.elements=this.selections;this.cmp.removeClass(this.selectedClass);this.selections=[];if(!Y){this.fireEvent("selectionchange",this,this.selections);}}},isSelected:function(Z){var s=this.selections;if(s.length<1){return false;} -Z=this.getNode(Z);return s.indexOf(Z)!==-1;},select:function(a,b,c){if(a instanceof Array){if(!b){this.clearSelections(true);}for(var i=0,len=a.length;i=h;i--){j.push(ns[i]);}}return j;},indexOf:function(k){k=this.getNode(k);if(typeof k.nodeIndex=="number"){return k.nodeIndex;}var ns=this.nodes;for(var i=0,len=ns.length;i0){for(var i=0,len=o.length;iv2){return dsc?-1:+1;}else {return 0;}};this.jsonData.sort(f);this.refresh();if(this.jsonData!=this.snapshot){this.snapshot.sort(f);}}}}); -Roo.ColorPalette=function(A){Roo.ColorPalette.superclass.constructor.call(this,A);this.addEvents({select:true});if(this.handler){this.on("select",this.handler,this.scope,true);}};Roo.extend(Roo.ColorPalette,Roo.Component,{itemCls:"x-color-palette",value:null,clickEvent:'click',ctype:"Roo.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(B,C){var t=new Roo.MasterTemplate(' ');var c=this.colors;for(var i=0,len=c.length;i0){this.cmp.elements=this.selections;this.cmp.removeClass(this.selectedClass);this.selections=[];if(!A){this.fireEvent("selectionchange",this,this.selections);}}},isSelected:function(A){var s=this.selections;if(s.length<1){return false;} +A=this.getNode(A);return s.indexOf(A)!==-1;},select:function(A,B,C){if(A instanceof Array){if(!B){this.clearSelections(true);}for(var i=0,len=A.length;i=B;i--){C.push(ns[i]);}}return C;},indexOf:function(A){A=this.getNode(A);if(typeof A.nodeIndex=="number"){return A.nodeIndex;}var ns=this.nodes;for(var i=0,len=ns.length;i0){for(var i=0,len=o.length;iv2){return dsc?-1:+1;}else {return 0;}};this.jsonData.sort(f);this.refresh();if(this.jsonData!=this.snapshot){this.snapshot.sort(f);}}}}); +Roo.ColorPalette=function(A){Roo.ColorPalette.superclass.constructor.call(this,A);this.addEvents({select:true});if(this.handler){this.on("select",this.handler,this.scope,true);}};Roo.extend(Roo.ColorPalette,Roo.Component,{itemCls:"x-color-palette",value:null,clickEvent:'click',ctype:"Roo.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(A,B){var t=new Roo.MasterTemplate(' ');var c=this.colors;for(var i=0,len=c.length;i','  ',''];var dn=this.dayNames;for(var i=0;i<7;i++){var d=this.startDay+i;if(d>6){d=d-7;} +this.disabledDatesRE=new RegExp(re+")");}};Roo.extend(Roo.DatePicker,Roo.Component,{todayText:"Today",okText:" OK ",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minDate:null,maxDate:null,minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDays:null,disabledDaysText:"",disabledDatesRE:null,disabledDatesText:"",constrainToViewport:true,monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:'Next Month (Control+Right)',prevText:'Previous Month (Control+Left)',monthYearText:'Choose a month (Control+Up/Down to move years)',startDay:0,showClear:false,setValue:function(A){var B=this.value;this.value=A.clearTime(true);if(this.el){this.update(this.value);}},getValue:function(){return this.value;},focus:function(){if(this.el){this.update(this.activeDate);}},onRender:function(A,B){var m=['
','',''+'
  
'];var dn=this.dayNames;for(var i=0;i<7;i++){var d=this.startDay+i;if(d>6){d=d-7;} m.push("");} m[m.length]="";for(var i=0;i<42;i++){if(i%7==0&&i!=0){m[m.length]="";} m[m.length]='';} -m[m.length]='
",dn[d].substr(0,1),"
';var el=document.createElement("div");el.className="x-date-picker";el.innerHTML=m.join("");D.dom.insertBefore(el,E);this.el=Roo.get(el);this.eventEl=Roo.get(el.firstChild);new Roo.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});new Roo.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.eventEl.on("mousewheel",this.handleMouseWheel,this);this.monthPicker=this.el.down('div.x-date-mp');this.monthPicker.enableDisplayMode('block');var kn=new Roo.KeyNav(this.eventEl,{"left":function(e){e.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1));},"right":function(e){e.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1));},"up":function(e){e.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7));},"down":function(e){e.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7));},"pageUp":function(e){this.showNextMonth();},"pageDown":function(e){this.showPrevMonth();},"enter":function(e){e.stopPropagation();return true;},scope:this});this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.eventEl.addKeyListener(Roo.EventObject.SPACE,this.selectToday,this);this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Roo.Button(this.el.child("td.x-date-middle",true),{text:" ",tooltip:this.monthYearText});this.mbtn.on('click',this.showMonthPicker,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");var F=(new Date()).dateFormat(this.format);var G=new Roo.Toolbar(this.el.child("td.x-date-bottom",true));G.add({text:String.format(this.todayText,F),tooltip:String.format(this.todayTip,F),handler:this.selectToday,scope:this});if(this.showClear){G.add(new Roo.Toolbar.Fill());G.add({text:' ',cls:'x-btn-icon x-btn-clear',handler:function(){this.fireEvent("select",this,'');},scope:this});}if(Roo.isIE){this.el.repaint();} +m[m.length]=''+'
';var el=document.createElement("div");el.className="x-date-picker";el.innerHTML=m.join("");A.dom.insertBefore(el,B);this.el=Roo.get(el);this.eventEl=Roo.get(el.firstChild);new Roo.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});new Roo.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.eventEl.on("mousewheel",this.handleMouseWheel,this);this.monthPicker=this.el.down('div.x-date-mp');this.monthPicker.enableDisplayMode('block');var kn=new Roo.KeyNav(this.eventEl,{"left":function(e){e.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1));},"right":function(e){e.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1));},"up":function(e){e.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7));},"down":function(e){e.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7));},"pageUp":function(e){this.showNextMonth();},"pageDown":function(e){this.showPrevMonth();},"enter":function(e){e.stopPropagation();return true;},scope:this});this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.eventEl.addKeyListener(Roo.EventObject.SPACE,this.selectToday,this);this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Roo.Button(this.el.child("td.x-date-middle",true),{text:" ",tooltip:this.monthYearText});this.mbtn.on('click',this.showMonthPicker,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");var C=(new Date()).dateFormat(this.format);var D=new Roo.Toolbar(this.el.child("td.x-date-bottom",true));D.add({text:String.format(this.todayText,C),tooltip:String.format(this.todayTip,C),handler:this.selectToday,scope:this});if(this.showClear){D.add(new Roo.Toolbar.Fill());D.add({text:' ',cls:'x-btn-icon x-btn-clear',handler:function(){this.fireEvent("select",this,'');},scope:this});}if(Roo.isIE){this.el.repaint();} this.update(this.value);},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var buf=[''];for(var i=0;i<6;i++){buf.push('','',i==0?'':'');} -buf.push('','
',this.monthNames[i].substr(0,3),'',this.monthNames[i+6].substr(0,3),'
');this.monthPicker.update(buf.join(''));this.monthPicker.on('click',this.onMonthClick,this);this.monthPicker.on('dblclick',this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select('td.x-date-mp-month');this.mpYears=this.monthPicker.select('td.x-date-mp-year');this.mpMonths.each(function(m,a,i){i+=1;if((i%2)==0){m.dom.xmonth=5+Math.round(i*.5);}else {m.dom.xmonth=Math.round((i-1)*.5);}});}},showMonthPicker:function(){this.createMonthPicker();var H=this.el.getSize();this.monthPicker.setSize(H);this.monthPicker.child('table').setSize(H);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn('t',{duration:.2});},updateMPYear:function(y){this.mpyear=y;var ys=this.mpYears.elements;for(var i=1;i<=10;i++){var td=ys[i-1],y2;if((i%2)==0){y2=y+Math.round(i*.5);td.firstChild.innerHTML=y2;td.xyear=y2;}else {y2=y-(5-Math.round(i*.5));td.firstChild.innerHTML=y2;td.xyear=y2;} -this.mpYears.item(i-1)[y2==this.mpSelYear?'addClass':'removeClass']('x-date-mp-sel');}},updateMPMonth:function(sm){this.mpMonths.each(function(m,a,i){m[m.dom.xmonth==sm?'addClass':'removeClass']('x-date-mp-sel');});},selectMPMonth:function(m){},onMonthClick:function(e,t){e.stopEvent();var el=new Roo.Element(t),pn;if(el.is('button.x-date-mp-cancel')){this.hideMonthPicker();}else if(el.is('button.x-date-mp-ok')){this.update(new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker();}else if(pn=el.up('td.x-date-mp-month',2)){this.mpMonths.removeClass('x-date-mp-sel');pn.addClass('x-date-mp-sel');this.mpSelMonth=pn.dom.xmonth;}else if(pn=el.up('td.x-date-mp-year',2)){this.mpYears.removeClass('x-date-mp-sel');pn.addClass('x-date-mp-sel');this.mpSelYear=pn.dom.xyear;}else if(el.is('a.x-date-mp-prev')){this.updateMPYear(this.mpyear-10);}else if(el.is('a.x-date-mp-next')){this.updateMPYear(this.mpyear+10);}},onMonthDblClick:function(e,t){e.stopEvent();var el=new Roo.Element(t),pn;if(pn=el.up('td.x-date-mp-month',2)){this.update(new Date(this.mpSelYear,pn.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker();}else if(pn=el.up('td.x-date-mp-year',2)){this.update(new Date(pn.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker();}},hideMonthPicker:function(I){if(this.monthPicker){if(I===true){this.monthPicker.hide();}else {this.monthPicker.slideOut('t',{duration:.2});}}},showPrevMonth:function(e){this.update(this.activeDate.add("mo",-1));},showNextMonth:function(e){this.update(this.activeDate.add("mo",1));},showPrevYear:function(){this.update(this.activeDate.add("y",-1));},showNextYear:function(){this.update(this.activeDate.add("y",1));},handleMouseWheel:function(e){var J=e.getWheelDelta();if(J>0){this.showPrevMonth();e.stopEvent();}else if(J<0){this.showNextMonth();e.stopEvent();}},handleDateClick:function(e,t){e.stopEvent();if(t.dateValue&&!Roo.fly(t.parentNode).hasClass("x-date-disabled")){this.setValue(new Date(t.dateValue));this.fireEvent("select",this,this.value);}},selectToday:function(){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value);},update:function(K){var vd=this.activeDate;this.activeDate=K;if(vd&&this.el){var t=K.getTime();if(vd.getMonth()==K.getMonth()&&vd.getFullYear()==K.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(c){if(c.dom.firstChild.dateValue==t){c.addClass("x-date-selected");setTimeout(function(){try{c.dom.firstChild.focus();}catch(e){}},50);return false;}});return;}}var L=K.getDaysInMonth();var M=K.getFirstDateOfMonth();var N=M.getDay()-this.startDay;if(N<=this.startDay){N+=7;}var pm=K.add("mo",-1);var O=pm.getDaysInMonth()-N;var P=this.cells.elements;var Q=this.textNodes;L+=N;var R=86400000;var d=(new Date(pm.getFullYear(),pm.getMonth(),O)).clearTime();var S=new Date().clearTime().getTime();var T=K.clearTime().getTime();var U=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var V=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var W=this.disabledDatesRE;var X=this.disabledDatesText;var Y=this.disabledDays?this.disabledDays.join(""):false;var Z=this.disabledDaysText;var a=this.format;var b=function(f,g){g.title="";var t=d.getTime();g.firstChild.dateValue=t;if(t==S){g.className+=" x-date-today";g.title=f.todayText;}if(t==T){g.className+=" x-date-selected";setTimeout(function(){try{g.firstChild.focus();}catch(e){}},50);}if(tV){g.className=" x-date-disabled";g.title=f.maxText;return;}if(Y){if(Y.indexOf(d.getDay())!=-1){g.title=Z;g.className=" x-date-disabled";}}if(W&&a){var fvalue=d.dateFormat(a);if(W.test(fvalue)){g.title=X.replace("%0",fvalue);g.className=" x-date-disabled";}}};var i=0;for(;i','');this.monthPicker.update(buf.join(''));this.monthPicker.on('click',this.onMonthClick,this);this.monthPicker.on('dblclick',this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select('td.x-date-mp-month');this.mpYears=this.monthPicker.select('td.x-date-mp-year');this.mpMonths.each(function(m,a,i){i+=1;if((i%2)==0){m.dom.xmonth=5+Math.round(i*.5);}else {m.dom.xmonth=Math.round((i-1)*.5);}});}},showMonthPicker:function(){this.createMonthPicker();var A=this.el.getSize();this.monthPicker.setSize(A);this.monthPicker.child('table').setSize(A);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn('t',{duration:.2});},updateMPYear:function(y){this.mpyear=y;var ys=this.mpYears.elements;for(var i=1;i<=10;i++){var td=ys[i-1],y2;if((i%2)==0){y2=y+Math.round(i*.5);td.firstChild.innerHTML=y2;td.xyear=y2;}else {y2=y-(5-Math.round(i*.5));td.firstChild.innerHTML=y2;td.xyear=y2;} +this.mpYears.item(i-1)[y2==this.mpSelYear?'addClass':'removeClass']('x-date-mp-sel');}},updateMPMonth:function(sm){this.mpMonths.each(function(m,a,i){m[m.dom.xmonth==sm?'addClass':'removeClass']('x-date-mp-sel');});},selectMPMonth:function(m){},onMonthClick:function(e,t){e.stopEvent();var el=new Roo.Element(t),pn;if(el.is('button.x-date-mp-cancel')){this.hideMonthPicker();}else if(el.is('button.x-date-mp-ok')){this.update(new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker();}else if(pn=el.up('td.x-date-mp-month',2)){this.mpMonths.removeClass('x-date-mp-sel');pn.addClass('x-date-mp-sel');this.mpSelMonth=pn.dom.xmonth;}else if(pn=el.up('td.x-date-mp-year',2)){this.mpYears.removeClass('x-date-mp-sel');pn.addClass('x-date-mp-sel');this.mpSelYear=pn.dom.xyear;}else if(el.is('a.x-date-mp-prev')){this.updateMPYear(this.mpyear-10);}else if(el.is('a.x-date-mp-next')){this.updateMPYear(this.mpyear+10);}},onMonthDblClick:function(e,t){e.stopEvent();var el=new Roo.Element(t),pn;if(pn=el.up('td.x-date-mp-month',2)){this.update(new Date(this.mpSelYear,pn.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker();}else if(pn=el.up('td.x-date-mp-year',2)){this.update(new Date(pn.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker();}},hideMonthPicker:function(A){if(this.monthPicker){if(A===true){this.monthPicker.hide();}else {this.monthPicker.slideOut('t',{duration:.2});}}},showPrevMonth:function(e){this.update(this.activeDate.add("mo",-1));},showNextMonth:function(e){this.update(this.activeDate.add("mo",1));},showPrevYear:function(){this.update(this.activeDate.add("y",-1));},showNextYear:function(){this.update(this.activeDate.add("y",1));},handleMouseWheel:function(e){var A=e.getWheelDelta();if(A>0){this.showPrevMonth();e.stopEvent();}else if(A<0){this.showNextMonth();e.stopEvent();}},handleDateClick:function(e,t){e.stopEvent();if(t.dateValue&&!Roo.fly(t.parentNode).hasClass("x-date-disabled")){this.setValue(new Date(t.dateValue));this.fireEvent("select",this,this.value);}},selectToday:function(){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value);},update:function(A){var vd=this.activeDate;this.activeDate=A;if(vd&&this.el){var t=A.getTime();if(vd.getMonth()==A.getMonth()&&vd.getFullYear()==A.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(c){if(c.dom.firstChild.dateValue==t){c.addClass("x-date-selected");setTimeout(function(){try{c.dom.firstChild.focus();}catch(e){}},50);return false;}});return;}}var B=A.getDaysInMonth();var C=A.getFirstDateOfMonth();var D=C.getDay()-this.startDay;if(D<=this.startDay){D+=7;}var pm=A.add("mo",-1);var E=pm.getDaysInMonth()-D;var F=this.cells.elements;var G=this.textNodes;B+=D;var H=86400000;var d=(new Date(pm.getFullYear(),pm.getMonth(),E)).clearTime();var I=new Date().clearTime().getTime();var J=A.clearTime().getTime();var K=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var L=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var M=this.disabledDatesRE;var N=this.disabledDatesText;var O=this.disabledDays?this.disabledDays.join(""):false;var P=this.disabledDaysText;var Q=this.format;var R=function(T,U){U.title="";var t=d.getTime();U.firstChild.dateValue=t;if(t==I){U.className+=" x-date-today";U.title=T.todayText;}if(t==J){U.className+=" x-date-selected";setTimeout(function(){try{U.firstChild.focus();}catch(e){}},50);}if(tL){U.className=" x-date-disabled";U.title=T.maxText;return;}if(O){if(O.indexOf(d.getDay())!=-1){U.title=P;U.className=" x-date-disabled";}}if(M&&Q){var fvalue=d.dateFormat(Q);if(M.test(fvalue)){U.title=N.replace("%0",fvalue);U.className=" x-date-disabled";}}};var i=0;for(;i1){var newTab=this.getNextAvailable(J);if(newTab)newTab.activate();} -this.stripEl.dom.removeChild(I.pnode.dom);if(I.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(I.bodyEl.dom);} -H.splice(J,1);delete this.items[I.id];I.fireEvent("close",I);I.purgeListeners();this.autoSizeTabs();},getNextAvailable:function(K){var L=this.items;var M=K;while(M=0){var G=L[--M];if(G&&!G.isHidden()){return G;}}return null;},disableTab:function(id){var N=this.items[id];if(N&&this.active!=N){N.disable();}},enableTab:function(id){var O=this.items[id];O.enable();},activate:function(id){var P=this.items[id];if(!P){return null;}if(P==this.active||P.disabled){return P;}var e={};this.fireEvent("beforetabchange",this,e,P);if(e.cancel!==true&&!P.disabled){if(this.active){this.active.hide();} -this.active=this.items[id];this.active.show();this.fireEvent("tabchange",this,this.active);}return P;},getActiveTab:function(){return this.active;},syncHeight:function(Q){var R=(Q||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var bm=this.bodyEl.getMargins();var S=R-(this.stripWrap.getHeight()||0)-(bm.top+bm.bottom);this.bodyEl.setHeight(S);return S;},onResize:function(){if(this.monitorResize){this.autoSizeTabs();}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs();},autoSizeTabs:function(){var T=this.items.length;var U=T-this.hiddenCount;if(!this.resizeTabs||T<1||U<1||this.updating)return;var w=Math.max(this.el.getWidth()-this.cpad,10);var V=Math.floor(w/U);var b=this.stripBody;if(b.getWidth()>w){var tabs=this.items;this.setTabWidth(Math.max(V,this.minTabWidth)-2);if(V1){var newTab=this.getNextAvailable(C);if(newTab)newTab.activate();} +this.stripEl.dom.removeChild(B.pnode.dom);if(B.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(B.bodyEl.dom);} +A.splice(C,1);delete this.items[B.id];B.fireEvent("close",B);B.purgeListeners();this.autoSizeTabs();},getNextAvailable:function(A){var B=this.items;var C=A;while(C=0){var item=B[--C];if(item&&!item.isHidden()){return item;}}return null;},disableTab:function(id){var A=this.items[id];if(A&&this.active!=A){A.disable();}},enableTab:function(id){var A=this.items[id];A.enable();},activate:function(id){var A=this.items[id];if(!A){return null;}if(A==this.active||A.disabled){return A;}var e={};this.fireEvent("beforetabchange",this,e,A);if(e.cancel!==true&&!A.disabled){if(this.active){this.active.hide();} +this.active=this.items[id];this.active.show();this.fireEvent("tabchange",this,this.active);}return A;},getActiveTab:function(){return this.active;},syncHeight:function(A){var B=(A||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var bm=this.bodyEl.getMargins();var C=B-(this.stripWrap.getHeight()||0)-(bm.top+bm.bottom);this.bodyEl.setHeight(C);return C;},onResize:function(){if(this.monitorResize){this.autoSizeTabs();}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs();},autoSizeTabs:function(){var A=this.items.length;var B=A-this.hiddenCount;if(!this.resizeTabs||A<1||B<1||this.updating)return;var w=Math.max(this.el.getWidth()-this.cpad,10);var C=Math.floor(w/B);var b=this.stripBody;if(b.getWidth()>w){var tabs=this.items;this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C
';return x.firstChild.firstChild.firstChild.firstChild;};Roo.TabPanel.prototype.createBody=function(y){var z=document.createElement("div");Roo.id(z,"tab-body");Roo.fly(z).addClass("x-tabs-body");y.appendChild(z);return z;};Roo.TabPanel.prototype.createItemBody=function(AA,id){var AB=Roo.getDom(id);if(!AB){AB=document.createElement("div");AB.id=id;} -Roo.fly(AB).addClass("x-tabs-item-body");AA.insertBefore(AB,AA.firstChild);return AB;};Roo.TabPanel.prototype.createStripElements=function(AC,AD,AE){var td=document.createElement("td");AC.appendChild(td);if(AE){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Roo.Template(''+'{text}'+'
 
');}var el=this.closeTpl.overwrite(td,{"text":AD});var close=el.getElementsByTagName("div")[0];var inner=el.getElementsByTagName("em")[0];return {"el":el,"close":close,"inner":inner};}else {if(!this.tabTpl){this.tabTpl=new Roo.Template(''+'{text}');}var el=this.tabTpl.overwrite(td,{"text":AD});var inner=el.getElementsByTagName("em")[0];return {"el":el,"inner":inner};}}; +this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else {this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(A){var B=A-this.pnode.getPadding("lr");this.inner.setWidth(B);this.textEl.setWidth(B-this.inner.getPadding("lr"));this.pnode.setWidth(A);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"));},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);} +this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var updater=this.bodyEl.getUpdateManager();updater.update(A,B,this._setLoaded.createDelegate(this));}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);}},closeText:"Close this tab"});Roo.TabPanel.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B;};Roo.TabPanel.prototype.createStripList=function(A){A.innerHTML='
';return A.firstChild.firstChild.firstChild.firstChild;};Roo.TabPanel.prototype.createBody=function(A){var B=document.createElement("div");Roo.id(B,"tab-body");Roo.fly(B).addClass("x-tabs-body");A.appendChild(B);return B;};Roo.TabPanel.prototype.createItemBody=function(A,id){var B=Roo.getDom(id);if(!B){B=document.createElement("div");B.id=id;} +Roo.fly(B).addClass("x-tabs-item-body");A.insertBefore(B,A.firstChild);return B;};Roo.TabPanel.prototype.createStripElements=function(A,B,C){var td=document.createElement("td");A.appendChild(td);if(C){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Roo.Template(''+'{text}'+'
 
');}var el=this.closeTpl.overwrite(td,{"text":B});var close=el.getElementsByTagName("div")[0];var inner=el.getElementsByTagName("em")[0];return {"el":el,"close":close,"inner":inner};}else {if(!this.tabTpl){this.tabTpl=new Roo.Template(''+'{text}');}var el=this.tabTpl.overwrite(td,{"text":B});var inner=el.getElementsByTagName("em")[0];return {"el":el,"inner":inner};}}; Roo.Button=function(A,B){if(!B){B=A;A=B.renderTo||false;} Roo.apply(this,B);this.addEvents({"click":true,"toggle":true,'mouseover':true,'mouseout':true,'render':true});if(this.menu){this.menu=Roo.menu.MenuMgr.get(this.menu);}if(A){this.render(A);} -Roo.util.Observable.call(this);};Roo.extend(Roo.Button,Roo.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:'button',menuClassTarget:'tr',clickEvent:'click',handleMouseEvents:true,tooltipType:'qtip',render:function(C){var D;if(this.hideParent){this.parentEl=Roo.get(C);}if(!this.dhconfig){if(!this.template){if(!Roo.Button.buttonTemplate){Roo.Button.buttonTemplate=new Roo.Template('','',"
  
");} +Roo.util.Observable.call(this);};Roo.extend(Roo.Button,Roo.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:'button',menuClassTarget:'tr',clickEvent:'click',handleMouseEvents:true,tooltipType:'qtip',render:function(A){var B;if(this.hideParent){this.parentEl=Roo.get(A);}if(!this.dhconfig){if(!this.template){if(!Roo.Button.buttonTemplate){Roo.Button.buttonTemplate=new Roo.Template('','',"
  
");} this.template=Roo.Button.buttonTemplate;} -D=this.template.append(C,[this.text||' ',this.type],true);var btnEl=D.child("button:first");btnEl.on('focus',this.onFocus,this);btnEl.on('blur',this.onBlur,this);if(this.cls){D.addClass(this.cls);}if(this.icon){btnEl.setStyle('background-image','url('+this.icon+')');}if(this.iconCls){btnEl.addClass(this.iconCls);if(!this.cls){D.addClass(this.text?'x-btn-text-icon':'x-btn-icon');}}if(this.tabIndex!==undefined){btnEl.dom.tabIndex=this.tabIndex;}if(this.tooltip){if(typeof this.tooltip=='object'){Roo.QuickTips.tips(Roo.apply({target:btnEl.id},this.tooltip));}else {btnEl.dom[this.tooltipType]=this.tooltip;}}}else {D=Roo.DomHelper.append(Roo.get(C).dom,this.dhconfig,true);} -this.el=D;if(this.id){this.el.dom.id=this.el.id=this.id;}if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);} -D.addClass("x-btn");if(Roo.isIE&&!Roo.isIE7){this.autoWidth.defer(1,this);}else {this.autoWidth();}if(this.handleMouseEvents){D.on("mouseover",this.onMouseOver,this);D.on("mouseout",this.onMouseOut,this);D.on("mousedown",this.onMouseDown,this);} -D.on(this.clickEvent,this.onClick,this);if(this.hidden){this.hide();}if(this.disabled){this.disable();} -Roo.ButtonToggleMgr.register(this);if(this.pressed){this.el.addClass("x-btn-pressed");}if(this.repeat){var repeater=new Roo.util.ClickRepeater(D,typeof this.repeat=="object"?this.repeat:{});repeater.on("click",this.onClick,this);} -this.fireEvent('render',this);},getEl:function(){return this.el;},destroy:function(){Roo.ButtonToggleMgr.unregister(this);this.el.removeAllListeners();this.purgeListeners();this.el.remove();},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Roo.isIE7&&Roo.isStrict){var ib=this.el.child('button');if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Roo.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth('lr'));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if(this.el.getWidth()20){ib.clip();ib.setWidth(Roo.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth('lr'));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if(this.el.getWidth()','','',"
 
",'','',"
 
");var E=D.append(C,[this.text,this.type],true);var F=E.child("button");if(this.cls){E.addClass(this.cls);}if(this.icon){F.setStyle('background-image','url('+this.icon+')');}if(this.iconCls){F.addClass(this.iconCls);if(!this.cls){E.addClass(this.text?'x-btn-text-icon':'x-btn-icon');}} -this.el=E;if(this.handleMouseEvents){E.on("mouseover",this.onMouseOver,this);E.on("mouseout",this.onMouseOut,this);E.on("mousedown",this.onMouseDown,this);E.on("mouseup",this.onMouseUp,this);} -E.on(this.clickEvent,this.onClick,this);if(this.tooltip){if(typeof this.tooltip=='object'){Roo.QuickTips.tips(Roo.apply({target:F.id},this.tooltip));}else {F.dom[this.tooltipType]=this.tooltip;}}if(this.arrowTooltip){E.child("button:nth(2)").dom[this.tooltipType]=this.arrowTooltip;}if(this.hidden){this.hide();}if(this.disabled){this.disable();}if(this.pressed){this.el.addClass("x-btn-pressed");}if(Roo.isIE&&!Roo.isIE7){this.autoWidth.defer(1,this);}else {this.autoWidth();}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);} +this.fireEvent("click",this,e);if(this.handler){this.el.removeClass("x-btn-over");this.handler.call(this.scope||this,this,e);}}},onMouseOver:function(e){if(!this.disabled){this.el.addClass("x-btn-over");this.fireEvent('mouseover',this,e);}},onMouseOut:function(e){if(!e.within(this.el,true)){this.el.removeClass("x-btn-over");this.fireEvent('mouseout',this,e);}},onFocus:function(e){if(!this.disabled){this.el.addClass("x-btn-focus");}},onBlur:function(e){this.el.removeClass("x-btn-focus");},onMouseDown:function(e){if(!this.disabled&&e.button==0){this.el.addClass("x-btn-click");Roo.get(document).on('mouseup',this.onMouseUp,this);}},onMouseUp:function(e){if(e.button==0){this.el.removeClass("x-btn-click");Roo.get(document).un('mouseup',this.onMouseUp,this);}},onMenuShow:function(e){this.el.addClass("x-btn-menu-active");},onMenuHide:function(e){this.el.removeClass("x-btn-menu-active");}});Roo.ButtonToggleMgr=function(){var A={};function B(C,D){if(D){var g=A[C.toggleGroup];for(var i=0,l=g.length;i','','',"
 
",'','',"
 
");var C=B.append(A,[this.text,this.type],true);var D=C.child("button");if(this.cls){C.addClass(this.cls);}if(this.icon){D.setStyle('background-image','url('+this.icon+')');}if(this.iconCls){D.addClass(this.iconCls);if(!this.cls){C.addClass(this.text?'x-btn-text-icon':'x-btn-icon');}} +this.el=C;if(this.handleMouseEvents){C.on("mouseover",this.onMouseOver,this);C.on("mouseout",this.onMouseOut,this);C.on("mousedown",this.onMouseDown,this);C.on("mouseup",this.onMouseUp,this);} +C.on(this.clickEvent,this.onClick,this);if(this.tooltip){if(typeof this.tooltip=='object'){Roo.QuickTips.tips(Roo.apply({target:D.id},this.tooltip));}else {D.dom[this.tooltipType]=this.tooltip;}}if(this.arrowTooltip){C.child("button:nth(2)").dom[this.tooltipType]=this.arrowTooltip;}if(this.hidden){this.hide();}if(this.disabled){this.disable();}if(this.pressed){this.el.addClass("x-btn-pressed");}if(Roo.isIE&&!Roo.isIE7){this.autoWidth.defer(1,this);}else {this.autoWidth();}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);} this.fireEvent('render',this);},autoWidth:function(){if(this.el){var tbl=this.el.child("table:first");var tbl2=this.el.child("table:last");this.el.setWidth("auto");tbl.setWidth("auto");if(Roo.isIE7&&Roo.isStrict){var ib=this.el.child('button:first');if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Roo.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth('lr'));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if((tbl.getWidth()+tbl2.getWidth())
');this.tr=this.el.child("tr",true);var E=0;this.items=new Roo.util.MixedCollection(false,function(o){return o.id||("item"+(++E));});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons;}},add:function(){var a=arguments,l=a.length;for(var i=0;i"){return this.addFill();}return this.addText(el);}if(el.tagName){return this.addElement(el);}if(typeof el=="object"){return this.addButton(el);}return false;},addxtype:function(e){return this.add(e);},getEl:function(){return this.el;},addSeparator:function(){return this.addItem(new Roo.Toolbar.Separator());},addSpacer:function(){return this.addItem(new Roo.Toolbar.Spacer());},addFill:function(){return this.addItem(new Roo.Toolbar.Fill());},addElement:function(el){return this.addItem(new Roo.Toolbar.Item(el));},items:false,addItem:function(F){var td=this.nextBlock();F.render(td);this.items.add(F);return F;},addButton:function(G){if(G instanceof Array){var B=[];for(var i=0,len=G.length;i
');this.tr=this.el.child("tr",true);var A=0;this.items=new Roo.util.MixedCollection(false,function(o){return o.id||("item"+(++A));});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons;}},add:function(){var a=arguments,l=a.length;for(var i=0;i"){return this.addFill();}return this.addText(el);}if(el.tagName){return this.addElement(el);}if(typeof el=="object"){return this.addButton(el);}return false;},addxtype:function(e){return this.add(e);},getEl:function(){return this.el;},addSeparator:function(){return this.addItem(new Roo.Toolbar.Separator());},addSpacer:function(){return this.addItem(new Roo.Toolbar.Spacer());},addFill:function(){return this.addItem(new Roo.Toolbar.Fill());},addElement:function(el){return this.addItem(new Roo.Toolbar.Item(el));},items:false,addItem:function(A){var td=this.nextBlock();A.render(td);this.items.add(A);return A;},addButton:function(A){if(A instanceof Array){var buttons=[];for(var i=0,len=A.length;i=1&parseInt(v,10)+increment<=d.pages){this.field.dom.value=parseInt(v,10)+increment;pageNum=Math.min(Math.max(1,pageNum+increment),d.pages)-1;this.ds.load({params:{start:pageNum*this.pageSize,limit:this.pageSize}});} -e.stopEvent();}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(C){var ds=this.ds;switch(C){case "first":ds.load({params:{start:0,limit:this.pageSize}});break;case "prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case "next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case "last":var B=ds.getTotalCount();var extra=B%this.pageSize;var lastStart=extra?(B-extra):B-this.pageSize;ds.load({params:{start:lastStart,limit:this.pageSize}});break;case "refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}});break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);ds.un("remove",this.updateInfo,this);ds.un("add",this.updateInfo,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);ds.on("remove",this.updateInfo,this);ds.on("add",this.updateInfo,this);this.ds=ds;}}); +e.stopEvent();}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(A){var ds=this.ds;switch(A){case "first":ds.load({params:{start:0,limit:this.pageSize}});break;case "prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case "next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case "last":var total=ds.getTotalCount();var extra=total%this.pageSize;var lastStart=extra?(total-extra):total-this.pageSize;ds.load({params:{start:lastStart,limit:this.pageSize}});break;case "refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}});break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);ds.un("remove",this.updateInfo,this);ds.un("add",this.updateInfo,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);ds.on("remove",this.updateInfo,this);ds.on("add",this.updateInfo,this);this.ds=ds;}}); Roo.Resizable=function(el,A){this.el=Roo.get(el);if(A&&A.wrap){A.resizeChild=this.el;this.el=this.el.wrap(typeof A.wrap=="object"?A.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=A.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(A.resizeChild.getPositioning());A.resizeChild.clearPositioning();if(!A.width||!A.height){var csize=A.resizeChild.getSize();this.el.setSize(csize.width,csize.height);}if(A.pinned&&!A.adjustments){A.adjustments="auto";}} this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"});this.proxy.unselectable();this.proxy.enableDisplayMode('block');Roo.apply(this,A);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned");}var B=this.el.getStyle("position");if(B!="absolute"&&B!="fixed"){this.el.setStyle("position","relative");}if(!this.handles){this.handles='s,e,se';if(this.multiDirectional){this.handles+=',n,w';}}if(this.handles=="all"){this.handles="n s e w ne nw se sw";}var hs=this.handles.split(/\s*?[,;]\s*?| /);var ps=Roo.Resizable.positions;for(var i=0,len=hs.length;i0){if(m>(I/2)){K=H+(I-m);}else {K=H-m;}}return Math.max(J,K);},resizeElement:function(){var L=this.proxy.getBox();if(this.updateBox){this.el.setBox(L,false,this.animate,this.duration,null,this.easing);}else {this.el.setSize(L.width,L.height,this.animate,this.duration,null,this.easing);} -this.updateChildSize();if(!this.dynamic){this.proxy.hide();}return L;},constrain:function(v,M,m,mx){if(v-Mmx){M=mx-v;}return M;},onMouseMove:function(e){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(e.getPoint())){return;}var curSize=this.curSize||this.startBox;var x=this.startBox.x,y=this.startBox.y;var ox=x,oy=y;var w=curSize.width,h=curSize.height;var ow=w,oh=h;var mw=this.minWidth,mh=this.minHeight;var mxw=this.maxWidth,mxh=this.maxHeight;var wi=this.widthIncrement;var hi=this.heightIncrement;var eventXY=e.getXY();var diffX=-(this.startPoint[0]-Math.max(this.minX,eventXY[0]));var diffY=-(this.startPoint[1]-Math.max(this.minY,eventXY[1]));var pos=this.activeHandle.position;switch(pos){case "east":w+=diffX;w=Math.min(Math.max(mw,w),mxw);break;case "south":h+=diffY;h=Math.min(Math.max(mh,h),mxh);break;case "southeast":w+=diffX;h+=diffY;w=Math.min(Math.max(mw,w),mxw);h=Math.min(Math.max(mh,h),mxh);break;case "north":diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "west":diffX=this.constrain(w,diffX,mw,mxw);x+=diffX;w-=diffX;break;case "northeast":w+=diffX;w=Math.min(Math.max(mw,w),mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "northwest":diffX=this.constrain(w,diffX,mw,mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;x+=diffX;w-=diffX;break;case "southwest":diffX=this.constrain(w,diffX,mw,mxw);h+=diffY;h=Math.min(Math.max(mh,h),mxh);x+=diffX;w-=diffX;break;}var sw=this.snap(w,wi,mw);var sh=this.snap(h,hi,mh);if(sw!=w||sh!=h){switch(pos){case "northeast":y-=sh-h;break;case "north":y-=sh-h;break;case "southwest":x-=sw-w;break;case "west":x-=sw-w;break;case "northwest":x-=sw-w;y-=sh-h;break;} +Roo.Resizable.superclass.constructor.call(this);};Roo.extend(Roo.Resizable,Roo.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:'easeOutStrong',widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,constrainTo:undefined,resizeRegion:undefined,resizeTo:function(A,B){this.el.setSize(A,B);this.updateChildSize();this.fireEvent("resize",this,A,B,null);},startSizing:function(e,A){this.fireEvent("beforeresize",this,e);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:" "});this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this);} +this.overlay.setStyle("cursor",A.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=e.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var ct=Roo.get(this.constrainTo);this.resizeRegion=ct.getRegion().adjust(ct.getFrameWidth('t'),ct.getFrameWidth('l'),-ct.getFrameWidth('b'),-ct.getFrameWidth('r'));} +this.proxy.setStyle('visibility','hidden');this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle('visibility','visible');}}},onMouseDown:function(A,e){if(this.enabled){e.stopEvent();this.activeHandle=A;this.startSizing(e,A);}},onMouseUp:function(e){var A=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,A.width,A.height,e);},updateChildSize:function(){if(this.resizeChild){var el=this.el;var child=this.resizeChild;var adj=this.adjustments;if(el.dom.offsetWidth){var b=el.getSize(true);child.setSize(b.width+adj[0],b.height+adj[1]);}if(Roo.isIE){setTimeout(function(){if(el.dom.offsetWidth){var b=el.getSize(true);child.setSize(b.width+adj[0],b.height+adj[1]);}},10);}}},snap:function(A,B,C){if(!B||!A)return A;var D=A;var m=A%B;if(m>0){if(m>(B/2)){D=A+(B-m);}else {D=A-m;}}return Math.max(C,D);},resizeElement:function(){var A=this.proxy.getBox();if(this.updateBox){this.el.setBox(A,false,this.animate,this.duration,null,this.easing);}else {this.el.setSize(A.width,A.height,this.animate,this.duration,null,this.easing);} +this.updateChildSize();if(!this.dynamic){this.proxy.hide();}return A;},constrain:function(v,A,m,mx){if(v-Amx){A=mx-v;}return A;},onMouseMove:function(e){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(e.getPoint())){return;}var curSize=this.curSize||this.startBox;var x=this.startBox.x,y=this.startBox.y;var ox=x,oy=y;var w=curSize.width,h=curSize.height;var ow=w,oh=h;var mw=this.minWidth,mh=this.minHeight;var mxw=this.maxWidth,mxh=this.maxHeight;var wi=this.widthIncrement;var hi=this.heightIncrement;var eventXY=e.getXY();var diffX=-(this.startPoint[0]-Math.max(this.minX,eventXY[0]));var diffY=-(this.startPoint[1]-Math.max(this.minY,eventXY[1]));var pos=this.activeHandle.position;switch(pos){case "east":w+=diffX;w=Math.min(Math.max(mw,w),mxw);break;case "south":h+=diffY;h=Math.min(Math.max(mh,h),mxh);break;case "southeast":w+=diffX;h+=diffY;w=Math.min(Math.max(mw,w),mxw);h=Math.min(Math.max(mh,h),mxh);break;case "north":diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "west":diffX=this.constrain(w,diffX,mw,mxw);x+=diffX;w-=diffX;break;case "northeast":w+=diffX;w=Math.min(Math.max(mw,w),mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "northwest":diffX=this.constrain(w,diffX,mw,mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;x+=diffX;w-=diffX;break;case "southwest":diffX=this.constrain(w,diffX,mw,mxw);h+=diffY;h=Math.min(Math.max(mh,h),mxh);x+=diffX;w-=diffX;break;}var sw=this.snap(w,wi,mw);var sh=this.snap(h,hi,mh);if(sw!=w||sh!=h){switch(pos){case "northeast":y-=sh-h;break;case "north":y-=sh-h;break;case "southwest":x-=sw-w;break;case "west":x-=sw-w;break;case "northwest":x-=sw-w;y-=sh-h;break;} w=sw;h=sh;}if(this.preserveRatio){switch(pos){case "southeast":case "east":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);break;case "south":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case "northeast":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case "north":var tw=w;w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);x+=(tw-w)/2;break;case "southwest":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);var tw=w;w=ow*(h/oh);x+=tw-w;break;case "west":var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);y+=(th-h)/2;var tw=w;w=ow*(h/oh);x+=tw-w;break;case "northwest":var tw=w;var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);y+=th-h;x+=tw-w;break;}} -this.proxy.setBounds(x,y,w,h);if(this.dynamic){this.resizeElement();}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over");}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over");}},getEl:function(){return this.el;},getResizeChild:function(){return this.resizeChild;},destroy:function(N){this.proxy.remove();if(this.overlay){this.overlay.removeAllListeners();this.overlay.remove();}var ps=Roo.Resizable.positions;for(var k in ps){if(typeof ps[k]!="function"&&this[ps[k]]){var h=this[ps[k]];h.el.removeAllListeners();h.el.remove();}}if(N){this.el.update("");this.el.remove();}}});Roo.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Roo.Resizable.Handle=function(rz,O,P,Q){if(!this.tpl){var tpl=Roo.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});tpl.compile();Roo.Resizable.Handle.prototype.tpl=tpl;} -this.position=O;this.rz=rz;this.el=this.tpl.append(rz.el.dom,[this.position],true);this.el.unselectable();if(Q){this.el.setOpacity(0);} -this.el.on("mousedown",this.onMouseDown,this);if(!P){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);}};Roo.Resizable.Handle.prototype={afterResize:function(rz){},onMouseDown:function(e){this.rz.onMouseDown(this,e);},onMouseOver:function(e){this.rz.handleOver(this,e);},onMouseOut:function(e){this.rz.handleOut(this,e);}}; -Roo.Editor=function(A,B){Roo.Editor.superclass.constructor.call(this,B);this.field=A;this.addEvents({"beforestartedit":true,"startedit":true,"beforecomplete":true,"complete":true,"specialkey":true});};Roo.extend(Roo.Editor,Roo.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,completeOnEnter:false,cancelOnEsc:false,updateEl:false,onRender:function(ct,C){this.el=new Roo.Layer({shadow:this.shadow,cls:"x-editor",parentEl:ct,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Roo.isGecko?"auto":"hidden");if(this.field.msgTarget!='title'){this.field.msgTarget='qtip';} +this.proxy.setBounds(x,y,w,h);if(this.dynamic){this.resizeElement();}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over");}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over");}},getEl:function(){return this.el;},getResizeChild:function(){return this.resizeChild;},destroy:function(A){this.proxy.remove();if(this.overlay){this.overlay.removeAllListeners();this.overlay.remove();}var ps=Roo.Resizable.positions;for(var k in ps){if(typeof ps[k]!="function"&&this[ps[k]]){var h=this[ps[k]];h.el.removeAllListeners();h.el.remove();}}if(A){this.el.update("");this.el.remove();}}});Roo.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Roo.Resizable.Handle=function(rz,A,B,C){if(!this.tpl){var tpl=Roo.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});tpl.compile();Roo.Resizable.Handle.prototype.tpl=tpl;} +this.position=A;this.rz=rz;this.el=this.tpl.append(rz.el.dom,[this.position],true);this.el.unselectable();if(C){this.el.setOpacity(0);} +this.el.on("mousedown",this.onMouseDown,this);if(!B){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);}};Roo.Resizable.Handle.prototype={afterResize:function(rz){},onMouseDown:function(e){this.rz.onMouseDown(this,e);},onMouseOver:function(e){this.rz.handleOver(this,e);},onMouseOut:function(e){this.rz.handleOut(this,e);}}; +Roo.Editor=function(A,B){Roo.Editor.superclass.constructor.call(this,B);this.field=A;this.addEvents({"beforestartedit":true,"startedit":true,"beforecomplete":true,"complete":true,"specialkey":true});};Roo.extend(Roo.Editor,Roo.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,completeOnEnter:false,cancelOnEsc:false,updateEl:false,onRender:function(ct,A){this.el=new Roo.Layer({shadow:this.shadow,cls:"x-editor",parentEl:ct,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Roo.isGecko?"auto":"hidden");if(this.field.msgTarget!='title'){this.field.msgTarget='qtip';} this.field.render(this.el);if(Roo.isGecko){this.field.el.dom.setAttribute('autocomplete','off');} this.field.on("specialkey",this.onSpecialKey,this);if(this.swallowKeys){this.field.el.swallowEvent(['keydown','keypress']);} -this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1});}},onSpecialKey:function(D,e){if(this.completeOnEnter&&e.getKey()==e.ENTER){e.stopEvent();this.completeEdit();}else if(this.cancelOnEsc&&e.getKey()==e.ESC){this.cancelEdit();}else {this.fireEvent('specialkey',D,e);}},startEdit:function(el,E){if(this.editing){this.completeEdit();} -this.boundEl=Roo.get(el);var v=E!==undefined?E:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body);}if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){return;} +this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1});}},onSpecialKey:function(A,e){if(this.completeOnEnter&&e.getKey()==e.ENTER){e.stopEvent();this.completeEdit();}else if(this.cancelOnEsc&&e.getKey()==e.ESC){this.cancelEdit();}else {this.fireEvent('specialkey',A,e);}},startEdit:function(el,A){if(this.editing){this.completeEdit();} +this.boundEl=Roo.get(el);var v=A!==undefined?A:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body);}if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){return;} this.startValue=v;this.field.setValue(v);if(this.autoSize){var sz=this.boundEl.getSize();switch(this.autoSize){case "width":this.setSize(sz.width,"");break;case "height":this.setSize("",sz.height);break;default:this.setSize(sz.width,sz.height);}} this.el.alignTo(this.boundEl,this.alignment);this.editing=true;if(Roo.QuickTips){Roo.QuickTips.disable();} -this.show();},setSize:function(w,h){this.field.setSize(w,h);if(this.el){this.el.sync();}},realign:function(){this.el.alignTo(this.boundEl,this.alignment);},completeEdit:function(F){if(!this.editing){return;}var v=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){v=this.startValue;this.cancelEdit(true);}if(String(v)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return;}if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(v);}if(F!==true){this.hide();} +this.show();},setSize:function(w,h){this.field.setSize(w,h);if(this.el){this.el.sync();}},realign:function(){this.el.alignTo(this.boundEl,this.alignment);},completeEdit:function(A){if(!this.editing){return;}var v=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){v=this.startValue;this.cancelEdit(true);}if(String(v)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return;}if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(v);}if(A!==true){this.hide();} this.fireEvent("complete",this,v,this.startValue);}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide();} this.field.show();if(Roo.isIE&&!this.fixIEFocus){this.fixIEFocus=true;this.deferredFocus.defer(50,this);}else {this.field.focus();} -this.fireEvent("startedit",this.boundEl,this.startValue);},deferredFocus:function(){if(this.editing){this.field.focus();}},cancelEdit:function(G){if(this.editing){this.setValue(this.startValue);if(G!==true){this.hide();}}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit();}},onHide:function(){if(this.editing){this.completeEdit();return;} +this.fireEvent("startedit",this.boundEl,this.startValue);},deferredFocus:function(){if(this.editing){this.field.focus();}},cancelEdit:function(A){if(this.editing){this.setValue(this.startValue);if(A!==true){this.hide();}}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit();}},onHide:function(){if(this.editing){this.completeEdit();return;} this.field.blur();if(this.field.collapse){this.field.collapse();} this.el.hide();if(this.hideEl!==false){this.boundEl.show();}if(Roo.QuickTips){Roo.QuickTips.enable();}},setValue:function(v){this.field.setValue(v);},getValue:function(){return this.field.getValue();}}); Roo.BasicDialog=function(el,A){this.el=Roo.get(el);var dh=Roo.DomHelper;if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=el;} @@ -495,34 +495,34 @@ this.focusEl=el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1"}); this.bg=this.el.createChild({tag:"div",cls:"x-dlg-bg",html:'
 
'});this.centerBg=this.bg.child("div.x-dlg-bg-center");if(this.autoScroll!==false&&!this.autoTabs){this.body.setStyle("overflow","auto");} this.toolbox=this.el.createChild({cls:"x-dlg-toolbox"});if(this.closable!==false){this.el.addClass("x-dlg-closable");this.close=this.toolbox.createChild({cls:"x-dlg-close"});this.close.on("click",this.closeClick,this);this.close.addClassOnOver("x-dlg-close-over");}if(this.collapsible!==false){this.collapseBtn=this.toolbox.createChild({cls:"x-dlg-collapse"});this.collapseBtn.on("click",this.collapseClick,this);this.collapseBtn.addClassOnOver("x-dlg-collapse-over");this.header.on("dblclick",this.collapseClick,this);}if(this.resizable!==false){this.el.addClass("x-dlg-resizable");this.resizer=new Roo.Resizable(el,{minWidth:this.minWidth||80,minHeight:this.minHeight||80,handles:this.resizeHandles||"all",pinned:true});this.resizer.on("beforeresize",this.beforeResize,this);this.resizer.on("resize",this.onResize,this);}if(this.draggable!==false){el.addClass("x-dlg-draggable");if(!this.proxyDrag){var dd=new Roo.dd.DD(el.dom.id,"WindowDrag");}else {var dd=new Roo.dd.DDProxy(el.dom.id,"WindowDrag",{dragElId:this.proxy.id});} dd.setHandleElId(this.header.id);dd.endDrag=this.endMove.createDelegate(this);dd.startDrag=this.startMove.createDelegate(this);dd.onDrag=this.onDrag.createDelegate(this);dd.scroll=false;this.dd=dd;}if(this.modal){this.mask=dh.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);this.mask.enableDisplayMode("block");this.mask.hide();this.el.addClass("x-dlg-modal");}if(this.shadow){this.shadow=new Roo.Shadow({mode:typeof this.shadow=="string"?this.shadow:"sides",offset:this.shadowOffset});}else {this.shadowOffset=0;}if(Roo.useShims&&this.shim!==false){this.shim=this.el.createShim();this.shim.hide=this.hideAction;this.shim.hide();}else {this.shim=false;}if(this.autoTabs){this.initTabs();}if(this.buttons){var bts=this.buttons;this.buttons=[];Roo.each(bts,function(b){this.addButton(b);},this);} -this.addEvents({"keydown":true,"move":true,"resize":true,"beforehide":true,"hide":true,"beforeshow":true,"show":true});el.on("keydown",this.onKeyDown,this);el.on("mousedown",this.toFront,this);Roo.EventManager.onWindowResize(this.adjustViewport,this,true);this.el.hide();Roo.DialogManager.register(this);Roo.BasicDialog.superclass.constructor.call(this);};Roo.extend(Roo.BasicDialog,Roo.util.Observable,{shadowOffset:Roo.isIE?6:5,minHeight:80,minWidth:200,minButtonWidth:75,defaultButton:null,buttonAlign:"right",tabTag:'div',firstShow:true,setTitle:function(B){this.header.update(B);return this;},closeClick:function(){this.hide();},collapseClick:function(){this[this.collapsed?"expand":"collapse"]();},collapse:function(){if(!this.collapsed){this.collapsed=true;this.el.addClass("x-dlg-collapsed");this.restoreHeight=this.el.getHeight();this.resizeTo(this.el.getWidth(),this.header.getHeight());}},expand:function(){if(this.collapsed){this.collapsed=false;this.el.removeClass("x-dlg-collapsed");this.resizeTo(this.el.getWidth(),this.restoreHeight);}},initTabs:function(){var C=this.getTabs();while(C.getTab(0)){C.removeTab(0);} -this.el.select(this.tabTag+'.x-dlg-tab').each(function(el){var D=el.dom;C.addTab(Roo.id(D),D.title);D.title="";});C.activate(0);return C;},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getHeaderFooterHeight(true)+40);},onResize:function(){this.refreshSize();this.syncBodyHeight();this.adjustAssets();this.focus();this.fireEvent("resize",this,this.size.width,this.size.height);},onKeyDown:function(e){if(this.isVisible()){this.fireEvent("keydown",this,e);}},resizeTo:function(D,E){this.el.setSize(D,E);this.size={width:D,height:E};this.syncBodyHeight();if(this.fixedcenter){this.center();}if(this.isVisible()){this.constrainXY();this.adjustAssets();} -this.fireEvent("resize",this,D,E);return this;},setContentSize:function(w,h){h+=this.getHeaderFooterHeight()+this.body.getMargins("tb");w+=this.body.getMargins("lr")+this.bwrap.getMargins("lr")+this.centerBg.getPadding("lr");h+=this.body.getPadding("tb")+this.bwrap.getBorderWidth("tb")+this.body.getBorderWidth("tb")+this.el.getBorderWidth("tb");w+=this.body.getPadding("lr")+this.bwrap.getBorderWidth("lr")+this.body.getBorderWidth("lr")+this.bwrap.getPadding("lr")+this.el.getBorderWidth("lr");if(this.tabs){h+=this.tabs.stripWrap.getHeight()+this.tabs.bodyEl.getMargins("tb")+this.tabs.bodyEl.getPadding("tb");w+=this.tabs.bodyEl.getMargins("lr")+this.tabs.bodyEl.getPadding("lr");} -this.resizeTo(w,h);return this;},addKeyListener:function(F,fn,G){var H,I,J,K;if(typeof F=="object"&&!(F instanceof Array)){H=F["key"];I=F["shift"];J=F["ctrl"];K=F["alt"];}else {H=F;}var L=function(M,e){if((!I||e.shiftKey)&&(!J||e.ctrlKey)&&(!K||e.altKey)){var k=e.getKey();if(H instanceof Array){for(var i=0,len=H.length;i
'},null,true);this.btnContainer=tb.firstChild.firstChild.firstChild;}var P={handler:N,scope:O,minWidth:this.minButtonWidth,hideParent:true};if(typeof M=="string"){P.text=M;}else {if(M.tag){P.dhconfig=M;}else {Roo.apply(P,M);}}var fc=false;if((typeof(P.position)!='undefined')&&P.positionvw+s.left){x=vw-w;moved=true;}if(y+h>vh+s.top){y=vh-h;moved=true;}if(x
'},null,true);this.btnContainer=tb.firstChild.firstChild.firstChild;}var D={handler:B,scope:C,minWidth:this.minButtonWidth,hideParent:true};if(typeof A=="string"){D.text=A;}else {if(A.tag){D.dhconfig=A;}else {Roo.apply(D,A);}}var fc=false;if((typeof(D.position)!='undefined')&&D.positionvw+s.left){x=vw-w;moved=true;}if(y+h>vh+s.top){y=vh-h;moved=true;}if(x
 
'});F=E.dom.firstChild;G=Roo.get(E.dom.childNodes[2]);G.enableDisplayMode();G.addKeyListener([10,13],function(){if(A.isVisible()&&B&&B.buttons){if(B.buttons.ok){M("ok");}else if(B.buttons.yes){M("yes");}}});H=Roo.get(E.dom.childNodes[3]);H.enableDisplayMode();I=Roo.get(E.dom.childNodes[4]);I.enableDisplayMode();var pf=I.dom.firstChild;if(pf){pp=Roo.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}}return A;},updateText:function(j){if(!A.isVisible()&&!B.width){A.resizeTo(this.maxWidth,100);} -F.innerHTML=j||' ';var w=Math.max(Math.min(B.width||F.offsetWidth,this.maxWidth),Math.max(B.minWidth||this.minWidth,L));if(B.prompt){K.setWidth(w);}if(A.isVisible()){A.fixedcenter=false;} -A.setContentSize(w,E.getHeight());if(A.isVisible()){A.fixedcenter=true;}return this;},updateProgress:function(l,m){if(m){this.updateText(m);}if(pp){pp.setWidth(Math.floor(l*I.dom.firstChild.offsetWidth));}return this;},isVisible:function(){return A&&A.isVisible();},hide:function(){if(this.isVisible()){A.hide();}},show:function(n){if(this.isVisible()){this.hide();}var d=this.getDialog();B=n;d.setTitle(B.title||" ");d.close.setDisplayed(B.closable!==false);K=G;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){G.hide();H.show();H.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);K=H;}else {G.show();H.hide();}}else {G.hide();H.hide();} +A.footer.dom.style.display='';for(var k in J){if(typeof J[k]!="function"){if(b[k]){J[k].show();J[k].setText(typeof b[k]=="string"?b[k]:Roo.MessageBox.buttonText[k]);Q+=J[k].el.getWidth()+15;}else {J[k].hide();}}}return Q;};var P=function(d,k,e){if(B&&B.closable!==false){A.hide();}if(e){e.stopEvent();}};return {getDialog:function(){if(!A){A=new Roo.BasicDialog("x-msg-box",{autoCreate:true,shadow:true,draggable:true,resizable:false,constraintoviewport:false,fixedcenter:true,collapsible:false,shim:true,modal:true,width:400,height:100,buttonAlign:"center",closeClick:function(){if(B&&B.buttons&&B.buttons.no&&!B.buttons.cancel){M("no");}else {M("cancel");}}});A.on("hide",N);C=A.mask;A.addKeyListener(27,P);J={};var bt=this.buttonText;J["ok"]=A.addButton(bt["ok"],M.createCallback("ok"));J["yes"]=A.addButton(bt["yes"],M.createCallback("yes"));J["no"]=A.addButton(bt["no"],M.createCallback("no"));J["cancel"]=A.addButton(bt["cancel"],M.createCallback("cancel"));E=A.body.createChild({html:'
 
'});F=E.dom.firstChild;G=Roo.get(E.dom.childNodes[2]);G.enableDisplayMode();G.addKeyListener([10,13],function(){if(A.isVisible()&&B&&B.buttons){if(B.buttons.ok){M("ok");}else if(B.buttons.yes){M("yes");}}});H=Roo.get(E.dom.childNodes[3]);H.enableDisplayMode();I=Roo.get(E.dom.childNodes[4]);I.enableDisplayMode();var pf=I.dom.firstChild;if(pf){pp=Roo.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}}return A;},updateText:function(Q){if(!A.isVisible()&&!B.width){A.resizeTo(this.maxWidth,100);} +F.innerHTML=Q||' ';var w=Math.max(Math.min(B.width||F.offsetWidth,this.maxWidth),Math.max(B.minWidth||this.minWidth,L));if(B.prompt){K.setWidth(w);}if(A.isVisible()){A.fixedcenter=false;} +A.setContentSize(w,E.getHeight());if(A.isVisible()){A.fixedcenter=true;}return this;},updateProgress:function(Q,R){if(R){this.updateText(R);}if(pp){pp.setWidth(Math.floor(Q*I.dom.firstChild.offsetWidth));}return this;},isVisible:function(){return A&&A.isVisible();},hide:function(){if(this.isVisible()){A.hide();}},show:function(Q){if(this.isVisible()){this.hide();}var d=this.getDialog();B=Q;d.setTitle(B.title||" ");d.close.setDisplayed(B.closable!==false);K=G;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){G.hide();H.show();H.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);K=H;}else {G.show();H.hide();}}else {G.hide();H.hide();} I.setDisplayed(B.progress===true);this.updateProgress(0);K.dom.value=B.value||"";if(B.prompt){A.setDefaultButton(K);}else {var bs=B.buttons;var db=null;if(bs&&bs.ok){db=J["ok"];}else if(bs&&bs.yes){db=J["yes"];} A.setDefaultButton(db);} L=O(B.buttons);this.updateText(B.msg);if(B.cls){d.el.addClass(B.cls);} -d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(n.animEl);}return this;},progress:function(o,p){this.show({title:o,msg:p,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true});return this;},alert:function(q,r,fn,s){this.show({title:q,msg:r,buttons:this.OK,fn:fn,scope:s,modal:true});return this;},wait:function(t,u){this.show({title:u,msg:t,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this;},confirm:function(v,x,fn,y){this.show({title:v,msg:x,buttons:this.YESNO,fn:fn,scope:y,modal:true});return this;},prompt:function(z,AA,fn,AB,AC){this.show({title:z,msg:AA,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:AB,prompt:true,multiline:AC,modal:true});return this;},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Roo.Msg=Roo.MessageBox; +d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(Q.animEl);}return this;},progress:function(Q,R){this.show({title:Q,msg:R,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true});return this;},alert:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.OK,fn:fn,scope:S,modal:true});return this;},wait:function(Q,R){this.show({title:R,msg:Q,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this;},confirm:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.YESNO,fn:fn,scope:S,modal:true});return this;},prompt:function(Q,R,fn,S,T){this.show({title:Q,msg:R,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:S,prompt:true,multiline:T,modal:true});return this;},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Roo.Msg=Roo.MessageBox; Roo.QuickTips=function(){var el,A,B,C,tm,D,E,F={},esc,removeCls=null,bdLeft,bdRight;var ce,bd,xy,dd;var G=false,H=true,I=false;var J=1,K=1,L=1,M=[];var N=function(e){if(H){return;}var t=e.getTarget();if(!t||t.nodeType!==1||t==document||t==document.body){return;}if(ce&&t==ce.el){clearTimeout(K);return;}if(t&&F[t.id]){F[t.id].el=t;J=S.defer(tm.showDelay,tm,[F[t.id]]);return;}var W,et=Roo.fly(t);var ns=D.namespace;if(tm.interceptTitles&&t.title){W=t.title;t.qtip=W;t.removeAttribute("title");e.preventDefault();}else {W=t.qtip||et.getAttributeNS(ns,D.attribute);}if(W){J=S.defer(tm.showDelay,tm,[{el:t,text:W,width:et.getAttributeNS(ns,D.width),autoHide:et.getAttributeNS(ns,D.hide)!="user",title:et.getAttributeNS(ns,D.title),cls:et.getAttributeNS(ns,D.cls)}]);}};var O=function(e){clearTimeout(J);var t=e.getTarget();if(t&&ce&&ce.el==t&&(tm.autoHide&&ce.autoHide!==false)){K=setTimeout(U,tm.hideDelay);}};var P=function(e){if(H){return;} xy=e.getXY();xy[1]+=18;if(tm.trackMouse&&ce){el.setXY(xy);}};var Q=function(e){clearTimeout(J);clearTimeout(K);if(!e.within(el)){if(tm.hideOnClick){U();tm.disable();tm.enable.defer(100,tm);}}};var R=function(){return 2;};var S=function(o){if(H){return;} clearTimeout(L);ce=o;if(removeCls){el.removeClass(removeCls);removeCls=null;}if(ce.cls){el.addClass(ce.cls);removeCls=ce.cls;}if(ce.title){C.update(ce.title);C.show();}else {C.update('');C.hide();} @@ -530,272 +530,272 @@ el.dom.style.width=tm.maxWidth+'px';B.update(o.text);var p=R(),w=ce.width;if(!w) el.setWidth(parseInt(w,10)+p);if(ce.autoHide===false){E.setDisplayed(true);if(dd){dd.unlock();}}else {E.setDisplayed(false);if(dd){dd.lock();}}if(xy){el.avoidY=xy[1]-18;el.setXY(xy);}if(tm.animate){el.setOpacity(.1);el.setStyle("visibility","visible");el.fadeIn({callback:T});}else {T();}};var T=function(){if(ce){el.show();esc.enable();if(tm.autoDismiss&&ce.autoHide!==false){L=setTimeout(U,tm.autoDismissDelay);}}};var U=function(W){clearTimeout(L);clearTimeout(K);ce=null;if(el.isVisible()){esc.disable();if(W!==true&&tm.animate){el.fadeOut({callback:V});}else {V();}}};var V=function(){el.hide();if(removeCls){el.removeClass(removeCls);removeCls=null;}};return {minWidth:40,maxWidth:300,interceptTitles:false,trackMouse:false,hideOnClick:true,showDelay:500,hideDelay:200,autoHide:true,autoDismiss:true,autoDismissDelay:5000,animate:false,title:'',text:'',cls:'',width:null,init:function(){tm=Roo.QuickTips;D=tm.tagConfig;if(!I){if(!Roo.isReady){Roo.onReady(Roo.QuickTips.init,Roo.QuickTips);return;} el=new Roo.Layer({cls:"x-tip",shadow:"drop",shim:true,constrain:true,shadowOffset:4});el.fxDefaults={stopFx:true};el.update('

');C=el.child('h3');C.enableDisplayMode("block");A=el.child('div.x-tip-bd');B=el.child('div.x-tip-bd-inner');E=el.child('div.x-tip-close');E.enableDisplayMode("block");E.on("click",U);var d=Roo.get(document);d.on("mousedown",Q);d.on("mouseover",N);d.on("mouseout",O);d.on("mousemove",P);esc=d.addKeyListener(27,U);esc.disable();if(Roo.dd.DD){dd=el.initDD("default",null,{onDrag:function(){el.sync();}});dd.setHandleElId(C.id);dd.lock();} I=true;} -this.enable();},register:function(X){var cs=X instanceof Array?X:arguments;for(var i=0,len=cs.length;i0){var f=function(Q,R){if(Q&&R){var n=R.findChild(N,v);if(n){n.select();if(O){O(true,n);}}else if(O){O(false,n);}}else {if(O){O(false,n);}}};this.expandPath(P.join(this.pathSeparator),N,f);}else {this.root.select();if(O){O(true,this.root);}}},getTreeEl:function(){return this.el;},render:function(){if(this.innerCt){return this;} +this.id=this.el.id;this.addEvents({"beforeload":true,"load":true,"textchange":true,"beforeexpand":true,"beforecollapse":true,"expand":true,"disabledchange":true,"collapse":true,"beforeclick":true,"checkchange":true,"click":true,"dblclick":true,"contextmenu":true,"beforechildrenrendered":true,"startdrag":true,"enddrag":true,"dragdrop":true,"beforenodedrop":true,"nodedrop":true,"nodedragover":true});if(this.singleExpand){this.on("beforeexpand",this.restrictExpand,this);}};Roo.extend(Roo.tree.TreePanel,Roo.data.Tree,{rootVisible:true,animate:Roo.enableFx,lines:true,enableDD:false,hlDrop:Roo.enableFx,renderer:false,rendererTip:false,restrictExpand:function(A){var p=A.parentNode;if(p){if(p.expandedChild&&p.expandedChild.parentNode==p){p.expandedChild.collapse();} +p.expandedChild=A;}},setRootNode:function(A){Roo.tree.TreePanel.superclass.setRootNode.call(this,A);if(!this.rootVisible){A.ui=new Roo.tree.RootTreeNodeUI(A);}return A;},getEl:function(){return this.el;},getLoader:function(){return this.loader;},expandAll:function(){this.root.expand(true);},collapseAll:function(){this.root.collapse(true);},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.tree.DefaultSelectionModel();}return this.selModel;},getChecked:function(a,A){A=A||this.root;var r=[];var f=function(){if(this.attributes.checked){r.push(!a?this:(a=='id'?this.id:this.attributes[a]));}} +A.cascade(f);return r;},expandPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var E=this.root;if(E.attributes[B]!=D[1]){if(C){C(false,null);}return;}var F=1;var f=function(){if(++F==D.length){if(C){C(true,E);}return;}var c=E.findChild(B,D[F]);if(!c){if(C){C(false,E);}return;} +E=c;c.expand(false,false,f);};E.expand(false,false,f);},selectPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var v=D.pop();if(D.length>0){var f=function(E,F){if(E&&F){var n=F.findChild(B,v);if(n){n.select();if(C){C(true,n);}}else if(C){C(false,n);}}else {if(C){C(false,n);}}};this.expandPath(D.join(this.pathSeparator),B,f);}else {this.root.select();if(C){C(true,this.root);}}},getTreeEl:function(){return this.el;},render:function(){if(this.innerCt){return this;} this.innerCt=this.el.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.lines?"x-tree-lines":"x-tree-no-lines")});if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Roo.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true});}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Roo.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll});} this.getSelectionModel().init(this);if(!this.root){console.log("ROOT not set in tree");return;} this.root.render();if(!this.rootVisible){this.root.renderChildren();}return this;}}); -Roo.tree.DefaultSelectionModel=function(){this.selNode=null;this.addEvents({"selectionchange":true,"beforeselect":true});};Roo.extend(Roo.tree.DefaultSelectionModel,Roo.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this);},onNodeClick:function(B,e){if(e.ctrlKey&&this.selNode==B){this.unselect(B);return;} -this.select(B);},select:function(C){var D=this.selNode;if(D!=C&&this.fireEvent('beforeselect',this,C,D)!==false){if(D){D.ui.onSelectedChange(false);} -this.selNode=C;C.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,C,D);}return C;},unselect:function(E){if(this.selNode==E){this.clearSelections();}},clearSelections:function(){var n=this.selNode;if(n){n.ui.onSelectedChange(false);this.selNode=null;this.fireEvent("selectionchange",this,null);}return n;},getSelectedNode:function(){return this.selNode;},isSelected:function(F){return this.selNode==F;},selectPrevious:function(){var s=this.selNode||this.lastSelNode;if(!s){return null;}var ps=s.previousSibling;if(ps){if(!ps.isExpanded()||ps.childNodes.length<1){return this.select(ps);}else {var lc=ps.lastChild;while(lc&&lc.isExpanded()&&lc.childNodes.length>0){lc=lc.lastChild;}return this.select(lc);}}else if(s.parentNode&&(this.tree.rootVisible||!s.parentNode.isRoot)){return this.select(s.parentNode);}return null;},selectNext:function(){var s=this.selNode||this.lastSelNode;if(!s){return null;}if(s.firstChild&&s.isExpanded()){return this.select(s.firstChild);}else if(s.nextSibling){return this.select(s.nextSibling);}else if(s.parentNode){var newS=null;s.parentNode.bubble(function(){if(this.nextSibling){newS=this.getOwnerTree().selModel.select(this.nextSibling);return false;}});return newS;}return null;},onKeyDown:function(e){var s=this.selNode||this.lastSelNode;var sm=this;if(!s){return;}var k=e.getKey();switch(k){case e.DOWN:e.stopEvent();this.selectNext();break;case e.UP:e.stopEvent();this.selectPrevious();break;case e.RIGHT:e.preventDefault();if(s.hasChildNodes()){if(!s.isExpanded()){s.expand();}else if(s.firstChild){this.select(s.firstChild,e);}}break;case e.LEFT:e.preventDefault();if(s.hasChildNodes()&&s.isExpanded()){s.collapse();}else if(s.parentNode&&(this.tree.rootVisible||s.parentNode!=this.tree.getRootNode())){this.select(s.parentNode,e);}break;};}});Roo.tree.MultiSelectionModel=function(){this.selNodes=[];this.selMap={};this.addEvents({"selectionchange":true});};Roo.extend(Roo.tree.MultiSelectionModel,Roo.util.Observable,{init:function(G){this.tree=G;G.getTreeEl().on("keydown",this.onKeyDown,this);G.on("click",this.onNodeClick,this);},onNodeClick:function(H,e){this.select(H,e,e.ctrlKey);},select:function(I,e,J){if(J!==true){this.clearSelections(true);}if(this.isSelected(I)){this.lastSelNode=I;return I;} -this.selNodes.push(I);this.selMap[I.id]=I;this.lastSelNode=I;I.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return I;},unselect:function(K){if(this.selMap[K.id]){K.ui.onSelectedChange(false);var sn=this.selNodes;var index=-1;if(sn.indexOf){index=sn.indexOf(K);}else {for(var i=0,len=sn.length;i0){for(var i=0,len=sn.length;i0){lc=lc.lastChild;}return this.select(lc);}}else if(s.parentNode&&(this.tree.rootVisible||!s.parentNode.isRoot)){return this.select(s.parentNode);}return null;},selectNext:function(){var s=this.selNode||this.lastSelNode;if(!s){return null;}if(s.firstChild&&s.isExpanded()){return this.select(s.firstChild);}else if(s.nextSibling){return this.select(s.nextSibling);}else if(s.parentNode){var newS=null;s.parentNode.bubble(function(){if(this.nextSibling){newS=this.getOwnerTree().selModel.select(this.nextSibling);return false;}});return newS;}return null;},onKeyDown:function(e){var s=this.selNode||this.lastSelNode;var sm=this;if(!s){return;}var k=e.getKey();switch(k){case e.DOWN:e.stopEvent();this.selectNext();break;case e.UP:e.stopEvent();this.selectPrevious();break;case e.RIGHT:e.preventDefault();if(s.hasChildNodes()){if(!s.isExpanded()){s.expand();}else if(s.firstChild){this.select(s.firstChild,e);}}break;case e.LEFT:e.preventDefault();if(s.hasChildNodes()&&s.isExpanded()){s.collapse();}else if(s.parentNode&&(this.tree.rootVisible||s.parentNode!=this.tree.getRootNode())){this.select(s.parentNode,e);}break;};}});Roo.tree.MultiSelectionModel=function(){this.selNodes=[];this.selMap={};this.addEvents({"selectionchange":true});};Roo.extend(Roo.tree.MultiSelectionModel,Roo.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this);},onNodeClick:function(A,e){this.select(A,e,e.ctrlKey);},select:function(A,e,B){if(B!==true){this.clearSelections(true);}if(this.isSelected(A)){this.lastSelNode=A;return A;} +this.selNodes.push(A);this.selMap[A.id]=A;this.lastSelNode=A;A.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return A;},unselect:function(A){if(this.selMap[A.id]){A.ui.onSelectedChange(false);var sn=this.selNodes;var index=-1;if(sn.indexOf){index=sn.indexOf(A);}else {for(var i=0,len=sn.length;i0){for(var i=0,len=sn.length;i
','',this.indentMarkup,"",'','',cb?('':' />')):'','',c,"
",'',""];if(b!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),g.join(""));}else {this.wrap=Roo.DomHelper.insertHtml("beforeEnd",Z,g.join(""));} -this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var h=3;if(cb){this.checkbox=cs[3];h++;} -this.anchor=cs[h];this.textNode=cs[h].firstChild;},getAnchor:function(){return this.anchor;},getTextEl:function(){return this.textNode;},getIconEl:function(){return this.iconNode;},isChecked:function(){return this.checkbox?this.checkbox.checked:false;},updateExpandIcon:function(){if(this.rendered){var n=this.node,c1,c2;var P=n.isLast()?"x-tree-elbow-end":"x-tree-elbow";var hasChild=n.hasChildNodes();if(hasChild){if(n.expanded){P+="-minus";c1="x-tree-node-collapsed";c2="x-tree-node-expanded";}else {P+="-plus";c1="x-tree-node-expanded";c2="x-tree-node-collapsed";}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false;}if(this.c1!=c1||this.c2!=c2){Roo.fly(this.elNode).replaceClass(c1,c2);this.c1=c1;this.c2=c2;}}else {if(!this.wasLeaf){Roo.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true;}}var ecc="x-tree-ec-icon "+P;if(this.ecc!=ecc){this.ecNode.className=ecc;this.ecc=ecc;}}},getChildIndent:function(){if(!this.childIndent){var g=[];var p=this.node;while(p){if(!p.isRoot||(p.isRoot&&p.ownerTree.rootVisible)){if(!p.isLast()){g.unshift('');}else {g.unshift('');}} +this.fireEvent("dblclick",this.node,e);},onCheckChange:function(){var A=this.checkbox.checked;this.node.attributes.checked=A;this.fireEvent('checkchange',this.node,A);},ecClick:function(e){if(!this.animating&&this.node.hasChildNodes()){this.node.toggle();}},startDrop:function(){this.dropping=true;},endDrop:function(){setTimeout(function(){this.dropping=false;}.createDelegate(this),50);},expand:function(){this.updateExpandIcon();this.ctNode.style.display="";},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus();}catch(e){}}else if(!Roo.isIE){try{var noscroll=this.node.getOwnerTree().getTreeEl().dom;var l=noscroll.scrollLeft;this.anchor.focus();noscroll.scrollLeft=l;}catch(e){}}},toggleCheck:function(A){var cb=this.checkbox;if(cb){cb.checked=(A===undefined?!cb.checked:A);}},blur:function(){try{this.anchor.blur();}catch(e){}},animExpand:function(A){var ct=Roo.get(this.ctNode);ct.stopFx();if(!this.node.hasChildNodes()){this.updateExpandIcon();this.ctNode.style.display="";Roo.callback(A);return;} +this.animating=true;this.updateExpandIcon();ct.slideIn('t',{callback:function(){this.animating=false;Roo.callback(A);},scope:this,duration:this.node.ownerTree.duration||.25});},highlight:function(){var A=this.node.getOwnerTree();Roo.fly(this.wrap).highlight(A.hlColor||"C3DAF9",{endColor:A.hlBaseColor});},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none";},animCollapse:function(A){var ct=Roo.get(this.ctNode);ct.enableDisplayMode('block');ct.stopFx();this.animating=true;this.updateExpandIcon();ct.slideOut('t',{callback:function(){this.animating=false;Roo.callback(A);},scope:this,duration:this.node.ownerTree.duration||.25});},getContainer:function(){return this.ctNode;},getEl:function(){return this.wrap;},appendDDGhost:function(A){A.appendChild(this.elNode.cloneNode(true));},getDDRepairXY:function(){return Roo.lib.Dom.getXY(this.iconNode);},onRender:function(){this.render();},render:function(A){var n=this.node,a=n.attributes;var B=n.parentNode?n.parentNode.ui.getContainer():n.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(n,a,B,A);if(a.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",a.qtipTitle);}}else {this.textNode.setAttribute("ext:qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttribute("ext:qtitle",a.qtipTitle);}}}else if(a.qtipCfg){a.qtipCfg.target=Roo.id(this.textNode);Roo.QuickTips.register(a.qtipCfg);} +this.initEvents();if(!this.node.expanded){this.updateExpandIcon();}}else {if(A===true){B.appendChild(this.wrap);}}},renderElements:function(n,a,A,B){this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';var t=n.getOwnerTree();var C=t.renderer?t.renderer(n.attributes):Roo.util.Format.htmlEncode(n.text);var D=t.rendererTip?t.rendererTip(n.attributes):C;var cb=typeof a.checked=='boolean';var E=a.href?a.href:Roo.isGecko?"":"#";var F=['
  • ','',this.indentMarkup,"",'','',cb?('':' />')):'','',C,"
    ",'',"
  • "];if(B!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),F.join(""));}else {this.wrap=Roo.DomHelper.insertHtml("beforeEnd",A,F.join(""));} +this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var G=3;if(cb){this.checkbox=cs[3];G++;} +this.anchor=cs[G];this.textNode=cs[G].firstChild;},getAnchor:function(){return this.anchor;},getTextEl:function(){return this.textNode;},getIconEl:function(){return this.iconNode;},isChecked:function(){return this.checkbox?this.checkbox.checked:false;},updateExpandIcon:function(){if(this.rendered){var n=this.node,c1,c2;var cls=n.isLast()?"x-tree-elbow-end":"x-tree-elbow";var hasChild=n.hasChildNodes();if(hasChild){if(n.expanded){cls+="-minus";c1="x-tree-node-collapsed";c2="x-tree-node-expanded";}else {cls+="-plus";c1="x-tree-node-expanded";c2="x-tree-node-collapsed";}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false;}if(this.c1!=c1||this.c2!=c2){Roo.fly(this.elNode).replaceClass(c1,c2);this.c1=c1;this.c2=c2;}}else {if(!this.wasLeaf){Roo.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true;}}var ecc="x-tree-ec-icon "+cls;if(this.ecc!=ecc){this.ecNode.className=ecc;this.ecc=ecc;}}},getChildIndent:function(){if(!this.childIndent){var buf=[];var p=this.node;while(p){if(!p.isRoot||(p.isRoot&&p.ownerTree.rootVisible)){if(!p.isLast()){buf.unshift('');}else {buf.unshift('');}} p=p.parentNode;} -this.childIndent=g.join("");}return this.childIndent;},renderIndent:function(){if(this.rendered){var indent="";var p=this.node.parentNode;if(p){indent=p.ui.getChildIndent();}if(this.indentMarkup!=indent){this.indentNode.innerHTML=indent;this.indentMarkup=indent;} -this.updateExpandIcon();}}};Roo.tree.RootTreeNodeUI=function(){Roo.tree.RootTreeNodeUI.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.tree.RootTreeNodeUI,Roo.tree.TreeNodeUI,{render:function(){if(!this.rendered){var Z=this.node.ownerTree.innerCt.dom;this.node.expanded=true;Z.innerHTML='
    ';this.wrap=this.ctNode=Z.firstChild;}},collapse:function(){},expand:function(){}}); -Roo.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Roo.apply(this,A);this.addEvents({beforeload:true,load:true,loadexception:true,create:true});Roo.tree.TreeLoader.superclass.constructor.call(this);};Roo.extend(Roo.tree.TreeLoader,Roo.util.Observable,{uiProviders:{},clearOnLoad:true,root:false,queryParam:false,load:function(B,C){if(this.clearOnLoad){while(B.firstChild){B.removeChild(B.firstChild);}}if(B.attributes.children){var cs=B.attributes.children;for(var i=0,len=cs.length;i
    ';this.wrap=this.ctNode=targetNode.firstChild;}},collapse:function(){},expand:function(){}}); +Roo.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Roo.apply(this,A);this.addEvents({beforeload:true,load:true,loadexception:true,create:true});Roo.tree.TreeLoader.superclass.constructor.call(this);};Roo.extend(Roo.tree.TreeLoader,Roo.util.Observable,{uiProviders:{},clearOnLoad:true,root:false,queryParam:false,load:function(A,B){if(this.clearOnLoad){while(A.firstChild){A.removeChild(A.firstChild);}}if(A.attributes.children){var cs=A.attributes.children;for(var i=0,len=cs.length;iv2){return C?-1:+1;}else {return 0;}};};Roo.tree.TreeSorter.prototype={doSort:function(F){F.sort(this.sortFn);},compareNodes:function(n1,n2){return (n1.text.toUpperCase()>n2.text.toUpperCase()?1:-1);},updateSort:function(G,H){if(H.childrenRendered){this.doSort.defer(1,this,[H]);}}}; -if(Roo.dd.DropZone){Roo.tree.TreeDropZone=function(A,B){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Roo.tree.TreeDropZone.superclass.constructor.call(this,A.innerCt,B);this.tree=A;this.lastInsertClass="x-tree-no-status";this.dragOverData={};};Roo.extend(Roo.tree.TreeDropZone,Roo.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(C){if(C.hasChildNodes()&&!C.isExpanded()){C.expand(false,null,this.triggerCacheRefresh.createDelegate(this));}},queueExpand:function(D){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[D]);},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false;}},isValidDropPoint:function(n,pt,dd,e,E){if(!n||!E){return false;}var F=n.node;var G=E.node;if(!(F&&F.isTarget&&pt)){return false;}if(pt=="append"&&F.allowChildren===false){return false;}if((pt=="above"||pt=="below")&&(F.parentNode&&F.parentNode.allowChildren===false)){return false;}if(G&&(F==G||G.contains(F))){return false;}var H=this.dragOverData;H.tree=this.tree;H.target=F;H.data=E;H.point=pt;H.source=dd;H.rawEvent=e;H.dropNode=G;H.cancel=false;var I=this.tree.fireEvent("nodedragover",H);return H.cancel===false&&I!==false;},getDropPoint:function(e,n,dd){var tn=n.node;if(tn.isRoot){return tn.allowChildren!==false?"append":false;}var J=n.ddel;var t=Roo.lib.Dom.getY(J),b=t+J.offsetHeight;var y=Roo.lib.Event.getPageY(e);var K=tn.allowChildren===false||tn.isLeaf();if(this.appendOnly||tn.parentNode.allowChildren===false){return K?false:"append";}var L=false;if(!this.allowParentInsert){L=tn.hasChildNodes()&&tn.isExpanded();}var q=(b-t)/(K?2:3);if(y>=t&&y<(t+q)){return "above";}else if(!L&&(K||y>=b-q&&y<=b)){return "below";}else {return "append";}},onNodeEnter:function(n,dd,e,M){this.cancelExpand();},onNodeOver:function(n,dd,e,N){var pt=this.getDropPoint(e,n,dd);var O=n.node;if(!this.expandProcId&&pt=="append"&&O.hasChildNodes()&&!n.node.isExpanded()){this.queueExpand(O);}else if(pt!="append"){this.cancelExpand();}var P=this.dropNotAllowed;if(this.isValidDropPoint(n,pt,dd,e,N)){if(pt){var el=n.ddel;var cls;if(pt=="above"){P=n.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";cls="x-tree-drag-insert-above";}else if(pt=="below"){P=n.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";cls="x-tree-drag-insert-below";}else {P="x-tree-drop-ok-append";cls="x-tree-drag-append";}if(this.lastInsertClass!=cls){Roo.fly(el).replaceClass(this.lastInsertClass,cls);this.lastInsertClass=cls;}}}return P;},onNodeOut:function(n,dd,e,Q){this.cancelExpand();this.removeDropIndicators(n);},onNodeDrop:function(n,dd,e,R){var S=this.getDropPoint(e,n,dd);var T=n.node;T.ui.startDrop();if(!this.isValidDropPoint(n,S,dd,e,R)){T.ui.endDrop();return false;}var U=R.node||(dd.getTreeNode?dd.getTreeNode(R,T,S,e):null);var V={tree:this.tree,target:T,data:R,point:S,source:dd,rawEvent:e,dropNode:U,cancel:!U};var W=this.tree.fireEvent("beforenodedrop",V);if(W===false||V.cancel===true||!V.dropNode){T.ui.endDrop();return false;} -T=V.target;if(S=="append"&&!T.isExpanded()){T.expand(false,null,function(){this.completeDrop(V);}.createDelegate(this));}else {this.completeDrop(V);}return true;},completeDrop:function(de){var ns=de.dropNode,p=de.point,t=de.target;if(!(ns instanceof Array)){ns=[ns];}var n;for(var i=0,len=ns.length;iv2){return C?-1:+1;}else {return 0;}};};Roo.tree.TreeSorter.prototype={doSort:function(A){A.sort(this.sortFn);},compareNodes:function(n1,n2){return (n1.text.toUpperCase()>n2.text.toUpperCase()?1:-1);},updateSort:function(A,B){if(B.childrenRendered){this.doSort.defer(1,this,[B]);}}}; +if(Roo.dd.DropZone){Roo.tree.TreeDropZone=function(A,B){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Roo.tree.TreeDropZone.superclass.constructor.call(this,A.innerCt,B);this.tree=A;this.lastInsertClass="x-tree-no-status";this.dragOverData={};};Roo.extend(Roo.tree.TreeDropZone,Roo.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(A){if(A.hasChildNodes()&&!A.isExpanded()){A.expand(false,null,this.triggerCacheRefresh.createDelegate(this));}},queueExpand:function(A){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[A]);},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false;}},isValidDropPoint:function(n,pt,dd,e,A){if(!n||!A){return false;}var B=n.node;var C=A.node;if(!(B&&B.isTarget&&pt)){return false;}if(pt=="append"&&B.allowChildren===false){return false;}if((pt=="above"||pt=="below")&&(B.parentNode&&B.parentNode.allowChildren===false)){return false;}if(C&&(B==C||C.contains(B))){return false;}var D=this.dragOverData;D.tree=this.tree;D.target=B;D.data=A;D.point=pt;D.source=dd;D.rawEvent=e;D.dropNode=C;D.cancel=false;var E=this.tree.fireEvent("nodedragover",D);return D.cancel===false&&E!==false;},getDropPoint:function(e,n,dd){var tn=n.node;if(tn.isRoot){return tn.allowChildren!==false?"append":false;}var A=n.ddel;var t=Roo.lib.Dom.getY(A),b=t+A.offsetHeight;var y=Roo.lib.Event.getPageY(e);var B=tn.allowChildren===false||tn.isLeaf();if(this.appendOnly||tn.parentNode.allowChildren===false){return B?false:"append";}var C=false;if(!this.allowParentInsert){C=tn.hasChildNodes()&&tn.isExpanded();}var q=(b-t)/(B?2:3);if(y>=t&&y<(t+q)){return "above";}else if(!C&&(B||y>=b-q&&y<=b)){return "below";}else {return "append";}},onNodeEnter:function(n,dd,e,A){this.cancelExpand();},onNodeOver:function(n,dd,e,A){var pt=this.getDropPoint(e,n,dd);var B=n.node;if(!this.expandProcId&&pt=="append"&&B.hasChildNodes()&&!n.node.isExpanded()){this.queueExpand(B);}else if(pt!="append"){this.cancelExpand();}var C=this.dropNotAllowed;if(this.isValidDropPoint(n,pt,dd,e,A)){if(pt){var el=n.ddel;var cls;if(pt=="above"){C=n.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";cls="x-tree-drag-insert-above";}else if(pt=="below"){C=n.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";cls="x-tree-drag-insert-below";}else {C="x-tree-drop-ok-append";cls="x-tree-drag-append";}if(this.lastInsertClass!=cls){Roo.fly(el).replaceClass(this.lastInsertClass,cls);this.lastInsertClass=cls;}}}return C;},onNodeOut:function(n,dd,e,A){this.cancelExpand();this.removeDropIndicators(n);},onNodeDrop:function(n,dd,e,A){var B=this.getDropPoint(e,n,dd);var C=n.node;C.ui.startDrop();if(!this.isValidDropPoint(n,B,dd,e,A)){C.ui.endDrop();return false;}var D=A.node||(dd.getTreeNode?dd.getTreeNode(A,C,B,e):null);var E={tree:this.tree,target:C,data:A,point:B,source:dd,rawEvent:e,dropNode:D,cancel:!D};var F=this.tree.fireEvent("beforenodedrop",E);if(F===false||E.cancel===true||!E.dropNode){C.ui.endDrop();return false;} +C=E.target;if(B=="append"&&!C.isExpanded()){C.expand(false,null,function(){this.completeDrop(E);}.createDelegate(this));}else {this.completeDrop(E);}return true;},completeDrop:function(de){var ns=de.dropNode,p=de.point,t=de.target;if(!(ns instanceof Array)){ns=[ns];}var n;for(var i=0,len=ns.length;ind.offsetLeft){td.scrollLeft=nd.offsetLeft;}var w=Math.min(this.maxWidth,(td.clientWidth>20?td.clientWidth:td.offsetWidth)-Math.max(0,nd.offsetLeft-td.scrollLeft)-5);this.setSize(w,'');},triggerEdit:function(D){this.completeEdit();this.editNode=D;this.startEdit(D.ui.textNode,D.text);},bindScroll:function(){this.tree.getTreeEl().on('scroll',this.cancelEdit,this);},beforeNodeClick:function(E,e){var F=(this.lastClick?this.lastClick.getElapsed():0);this.lastClick=new Date();if(F>this.editDelay&&this.tree.getSelectionModel().isSelected(E)){e.stopEvent();this.triggerEdit(E);return false;}},updateNode:function(ed,G){this.tree.getTreeEl().un('scroll',this.cancelEdit,this);this.editNode.setText(G);},onHide:function(){Roo.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus();}},onSpecialKey:function(H,e){var k=e.getKey();if(k==e.ESC){e.stopEvent();this.cancelEdit();}else if(k==e.ENTER&&!e.hasModifier()){e.stopEvent();this.completeEdit();}}}); +if(Roo.dd.DragZone){Roo.tree.TreeDragZone=function(A,B){Roo.tree.TreeDragZone.superclass.constructor.call(this,A.getTreeEl(),B);this.tree=A;};Roo.extend(Roo.tree.TreeDragZone,Roo.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(A,e){var n=A.node;return n&&n.draggable&&!n.disabled;},onInitDrag:function(e){var A=this.dragData;this.tree.getSelectionModel().select(A.node);this.proxy.update("");A.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,A.node,e);},getRepairXY:function(e,A){return A.node.ui.getDDRepairXY();},onEndDrag:function(A,e){this.tree.fireEvent("enddrag",this.tree,A.node,e);},onValidDrop:function(dd,e,id){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,dd,e);this.hideProxy();},beforeInvalidDrop:function(e,id){var sm=this.tree.getSelectionModel();sm.clearSelections();sm.select(this.dragData.node);}});} +Roo.tree.TreeEditor=function(A,B){B=B||{};var C=B.events?B:new Roo.form.TextField(B);Roo.tree.TreeEditor.superclass.constructor.call(this,C);this.tree=A;A.on('beforeclick',this.beforeNodeClick,this);A.getTreeEl().on('mousedown',this.hide,this);this.on('complete',this.updateNode,this);this.on('beforestartedit',this.fitToTree,this);this.on('startedit',this.bindScroll,this,{delay:10});this.on('specialkey',this.onSpecialKey,this);};Roo.extend(Roo.tree.TreeEditor,Roo.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,fitToTree:function(ed,el){var td=this.tree.getTreeEl().dom,nd=el.dom;if(td.scrollLeft>nd.offsetLeft){td.scrollLeft=nd.offsetLeft;}var w=Math.min(this.maxWidth,(td.clientWidth>20?td.clientWidth:td.offsetWidth)-Math.max(0,nd.offsetLeft-td.scrollLeft)-5);this.setSize(w,'');},triggerEdit:function(A){this.completeEdit();this.editNode=A;this.startEdit(A.ui.textNode,A.text);},bindScroll:function(){this.tree.getTreeEl().on('scroll',this.cancelEdit,this);},beforeNodeClick:function(A,e){var B=(this.lastClick?this.lastClick.getElapsed():0);this.lastClick=new Date();if(B>this.editDelay&&this.tree.getSelectionModel().isSelected(A)){e.stopEvent();this.triggerEdit(A);return false;}},updateNode:function(ed,A){this.tree.getTreeEl().un('scroll',this.cancelEdit,this);this.editNode.setText(A);},onHide:function(){Roo.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus();}},onSpecialKey:function(A,e){var k=e.getKey();if(k==e.ESC){e.stopEvent();this.cancelEdit();}else if(k==e.ENTER&&!e.hasModifier()){e.stopEvent();this.completeEdit();}}}); Roo.tree.ColumnNodeUI=Roo.extend(Roo.tree.TreeNodeUI,{renderElements:function(n,a,A,B){this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';var t=n.getOwnerTree();var C=Pman.Tab.Document_TypesTree.tree.el.id;var D=t.columns;var bw=t.borderWidth;var c=D[0];var E=a.href?a.href:Roo.isGecko?"":"#";var cb=typeof a.checked=="boolean";var tx=String.format('{0}',n.text||(c.renderer?c.renderer(a[c.dataIndex],n,a):a[c.dataIndex]));var F='x-t-'+C+'-c0';var G=['
  • ','
    ','
    ','',this.indentMarkup,'','','',(cb?('':' />')):''),'','',tx,'','
    ','',];for(var i=1,len=D.length;i','
    ',tx,"
    ","
    ");} G.push('','
  • ','',"");if(B!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),G.join(""));}else {this.wrap=Roo.DomHelper.insertHtml("beforeEnd",A,G.join(""));}var el=this.wrap.firstChild;this.elRow=el;this.elNode=el.firstChild;this.ranchor=el.childNodes[1];this.ctNode=this.wrap.childNodes[1];var cs=el.firstChild.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var H=3;if(cb){this.checkbox=cs[3];H++;} this.anchor=cs[H];this.textNode=cs[H].firstChild;},initEvents:function(){Roo.tree.ColumnNodeUI.superclass.initEvents.call(this);var a=this.ranchor;var el=Roo.get(a);if(Roo.isOpera){el.setStyle("text-decoration","none");} -el.on("click",this.onClick,this);el.on("dblclick",this.onDblClick,this);el.on("contextmenu",this.onContextMenu,this);},addClass:function(I){if(this.elRow){Roo.fly(this.elRow).addClass(I);}},removeClass:function(J){if(this.elRow){Roo.fly(this.elRow).removeClass(J);}}}); -Roo.tree.ColumnTree=function(el,A){Roo.tree.ColumnTree.superclass.constructor.call(this,el,A);this.addEvents({"resize":true});this.on('resize',this.onResize,this);};Roo.extend(Roo.tree.ColumnTree,Roo.tree.TreePanel,{borderWidth:Roo.isBorderBox?0:2,headEls:false,render:function(){Roo.tree.ColumnTree.superclass.render.apply(this);this.el.addClass('x-column-tree');this.headers=this.el.createChild({cls:'x-tree-headers'},this.innerCt.dom);var B=this.columns,c;var C=0;this.headEls=[];var D=B.length;for(var i=0;i=0&&i=0&&i0){E();}});}function E(){if(B&&B.length>0){var c=B.clone();c.each(function(m){m.hide();});}}function F(m){B.remove(m);if(B.length<1){Roo.get(document).un("mousedown",J);attached=false;}}function G(m){var L=B.last();lastShow=new Date();B.add(m);if(!attached){Roo.get(document).on("mousedown",J);attached=true;}if(m.parentMenu){m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"),10)+3);m.parentMenu.activeChild=m;}else if(L&&L.isVisible()){m.getEl().setZIndex(parseInt(L.getEl().getStyle("z-index"),10)+3);}}function H(m){if(m.activeChild){m.activeChild.hide();}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}function I(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){E();}else if(pm&&pm.activeChild&&B!=m){pm.activeChild.hide();}}function J(e){if(lastShow.getElapsed()>50&&B.length>0&&!e.getTarget(".x-menu")){E();}}function K(mi,L){if(L){var g=C[mi.group];for(var i=0,l=g.length;i0){E();}});}function E(){if(B&&B.length>0){var c=B.clone();c.each(function(m){m.hide();});}}function F(m){B.remove(m);if(B.length<1){Roo.get(document).un("mousedown",J);attached=false;}}function G(m){var L=B.last();lastShow=new Date();B.add(m);if(!attached){Roo.get(document).on("mousedown",J);attached=true;}if(m.parentMenu){m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"),10)+3);m.parentMenu.activeChild=m;}else if(L&&L.isVisible()){m.getEl().setZIndex(parseInt(L.getEl().getStyle("z-index"),10)+3);}}function H(m){if(m.activeChild){m.activeChild.hide();}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}function I(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){E();}else if(pm&&pm.activeChild&&B!=m){pm.activeChild.hide();}}function J(e){if(lastShow.getElapsed()>50&&B.length>0&&!e.getTarget(".x-menu")){E();}}function K(mi,L){if(L){var g=C[mi.group];for(var i=0,l=g.length;i{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||'');this.el=el;Roo.menu.Item.superclass.onRender.call(this,B,C);},setText:function(D){this.text=D;if(this.rendered){this.el.update(String.format('{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||''));this.parentMenu.autoWidth();}},handleClick:function(e){if(!this.href){e.stopEvent();} -Roo.menu.Item.superclass.handleClick.apply(this,arguments);},activate:function(E){if(Roo.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(E){this.expandMenu();}}return true;},shouldDeactivate:function(e){if(Roo.menu.Item.superclass.shouldDeactivate.call(this,e)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(e.getPoint());}return true;}return false;},deactivate:function(){Roo.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu();},expandMenu:function(F){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[F]);}else if(this.menu.isVisible()&&F){this.menu.tryActivate(0,1);}}},deferExpand:function(G){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(G){this.menu.tryActivate(0,1);}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this);}},deferHide:function(){delete this.hideTimer;this.menu.hide();}}); +Roo.menu.Item=function(A){Roo.menu.Item.superclass.constructor.call(this,A);if(this.menu){this.menu=Roo.menu.MenuMgr.get(this.menu);}};Roo.extend(Roo.menu.Item,Roo.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,hideDelay:200,ctype:"Roo.menu.Item",onRender:function(A,B){var el=document.createElement("a");el.hideFocus=true;el.unselectable="on";el.href=this.href||"#";if(this.hrefTarget){el.target=this.hrefTarget;} +el.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");el.innerHTML=String.format('{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||'');this.el=el;Roo.menu.Item.superclass.onRender.call(this,A,B);},setText:function(A){this.text=A;if(this.rendered){this.el.update(String.format('{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||''));this.parentMenu.autoWidth();}},handleClick:function(e){if(!this.href){e.stopEvent();} +Roo.menu.Item.superclass.handleClick.apply(this,arguments);},activate:function(A){if(Roo.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(A){this.expandMenu();}}return true;},shouldDeactivate:function(e){if(Roo.menu.Item.superclass.shouldDeactivate.call(this,e)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(e.getPoint());}return true;}return false;},deactivate:function(){Roo.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu();},expandMenu:function(A){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[A]);}else if(this.menu.isVisible()&&A){this.menu.tryActivate(0,1);}}},deferExpand:function(A){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(A){this.menu.tryActivate(0,1);}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this);}},deferHide:function(){delete this.hideTimer;this.menu.hide();}}); Roo.menu.CheckItem=function(A){Roo.menu.CheckItem.superclass.constructor.call(this,A);this.addEvents({"beforecheckchange":true,"checkchange":true});if(this.checkHandler){this.on('checkchange',this.checkHandler,this.scope);}};Roo.extend(Roo.menu.CheckItem,Roo.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Roo.menu.CheckItem",onRender:function(c){Roo.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass);} Roo.menu.MenuMgr.registerCheckable(this);if(this.checked){this.checked=false;this.setChecked(true,true);}},destroy:function(){if(this.rendered){Roo.menu.MenuMgr.unregisterCheckable(this);} -Roo.menu.CheckItem.superclass.destroy.apply(this,arguments);},setChecked:function(B,C){if(this.checked!=B&&this.fireEvent("beforecheckchange",this,B)!==false){if(this.container){this.container[B?"addClass":"removeClass"]("x-menu-item-checked");} -this.checked=B;if(C!==true){this.fireEvent("checkchange",this,B);}}},handleClick:function(e){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked);} +Roo.menu.CheckItem.superclass.destroy.apply(this,arguments);},setChecked:function(A,B){if(this.checked!=A&&this.fireEvent("beforecheckchange",this,A)!==false){if(this.container){this.container[A?"addClass":"removeClass"]("x-menu-item-checked");} +this.checked=A;if(B!==true){this.fireEvent("checkchange",this,A);}}},handleClick:function(e){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked);} Roo.menu.CheckItem.superclass.handleClick.apply(this,arguments);}}); -Roo.menu.DateItem=function(A){Roo.menu.DateItem.superclass.constructor.call(this,new Roo.DatePicker(A),A);this.picker=this.component;this.addEvents({select:true});this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item");});this.picker.on("select",this.onSelect,this);};Roo.extend(Roo.menu.DateItem,Roo.menu.Adapter,{onSelect:function(B,C){this.fireEvent("select",this,C,B);Roo.menu.DateItem.superclass.handleClick.call(this);}}); +Roo.menu.DateItem=function(A){Roo.menu.DateItem.superclass.constructor.call(this,new Roo.DatePicker(A),A);this.picker=this.component;this.addEvents({select:true});this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item");});this.picker.on("select",this.onSelect,this);};Roo.extend(Roo.menu.DateItem,Roo.menu.Adapter,{onSelect:function(A,B){this.fireEvent("select",this,B,A);Roo.menu.DateItem.superclass.handleClick.call(this);}}); Roo.menu.ColorItem=function(A){Roo.menu.ColorItem.superclass.constructor.call(this,new Roo.ColorPalette(A),A);this.palette=this.component;this.relayEvents(this.palette,["select"]);if(this.selectHandler){this.on('select',this.selectHandler,this.scope);}};Roo.extend(Roo.menu.ColorItem,Roo.menu.Adapter); Roo.menu.DateMenu=function(A){Roo.menu.DateMenu.superclass.constructor.call(this,A);this.plain=true;var di=new Roo.menu.DateItem(A);this.add(di);this.picker=di.picker;this.relayEvents(di,["select"]);this.on('beforeshow',function(){if(this.picker){this.picker.hideMonthPicker(true);}},this);};Roo.extend(Roo.menu.DateMenu,Roo.menu.Menu,{cls:'x-date-menu'}); Roo.menu.ColorMenu=function(A){Roo.menu.ColorMenu.superclass.constructor.call(this,A);this.plain=true;var ci=new Roo.menu.ColorItem(A);this.add(ci);this.palette=ci.palette;this.relayEvents(ci,["select"]);};Roo.extend(Roo.menu.ColorMenu,Roo.menu.Menu); -Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,B){Roo.form.Field.superclass.onRender.call(this,ct,B);if(!this.el){var cfg=this.getAutoCreate();if(!cfg.name){cfg.name=this.name||this.id;}if(this.inputType){cfg.type=this.inputType;} -this.el=ct.createChild(cfg,B);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';} -this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);} -this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(D){this.allowDomMove=false;this.el=Roo.get(D);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.originalValue);this.clearInvalid();},initEvents:function(){this.el.on(Roo.isIE?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.originalValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);} +Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);if(!this.el){var cfg=this.getAutoCreate();if(!cfg.name){cfg.name=this.name||this.id;}if(this.inputType){cfg.type=this.inputType;} +this.el=ct.createChild(cfg,A);}var B=this.el.dom.type;if(B){if(B=='password'){B='text';} +this.el.addClass('x-form-'+B);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);} +this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.originalValue);this.clearInvalid();},initEvents:function(){this.el.on(Roo.isIE?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.originalValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);} this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);} -this.fireEvent("blur",this);},isValid:function(E){if(this.disabled){return true;}var F=this.preventMark;this.preventMark=E===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=F;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true;}return false;},processValue:function(G){return G;},validateValue:function(H){return true;},markInvalid:function(I){if(!this.rendered||this.preventMark){return;} -this.el.addClass(this.invalidClass);I=I||this.invalidText;switch(this.msgTarget){case 'qtip':this.el.dom.qtip=I;this.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=I;break;case 'under':if(!this.errorEl){var elp=this.el.findParent('.x-form-element',5,true);this.errorEl=elp.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(elp.getWidth(true)-20);} -this.errorEl.update(I);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var elp=this.el.findParent('.x-form-element',5,true);this.errorIcon=elp.createChild({cls:'x-form-invalid-icon'});} -this.alignErrorIcon();this.errorIcon.dom.qtip=I;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML=I;t.style.display=this.msgDisplay;break;} -this.fireEvent('invalid',this,I);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;} +this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;} +this.el.addClass(this.invalidClass);A=A||this.invalidText;switch(this.msgTarget){case 'qtip':this.el.dom.qtip=A;this.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;break;case 'under':if(!this.errorEl){var elp=this.el.findParent('.x-form-element',5,true);this.errorEl=elp.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(elp.getWidth(true)-20);} +this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var elp=this.el.findParent('.x-form-element',5,true);this.errorIcon=elp.createChild({cls:'x-form-invalid-icon'});} +this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML=A;t.style.display=this.msgDisplay;break;} +this.fireEvent('invalid',this,A);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;} this.el.removeClass(this.invalidClass);switch(this.msgTarget){case 'qtip':this.el.dom.qtip='';break;case 'title':this.el.dom.title='';break;case 'under':if(this.errorEl){Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);}break;case 'side':if(this.errorIcon){this.errorIcon.dom.qtip='';this.errorIcon.hide();this.un('resize',this.alignErrorIcon,this);}break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;} -this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();if(v===this.emptyText){v='';}return v;},getValue:function(){var v=this.el.getValue();if(v===this.emptyText||v===undefined){v='';}return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(J,w){J=J.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(J=='input'||J=='textarea')){if(J=='input'){return w+2;}if(J='textarea'){return w-2;}}else if(Roo.isOpera){if(J=='input'){return w+2;}if(J='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(K,f){K.setDisplayed('block');},hide:function(L,f){L.setDisplayed(false).update('');}},slide:{show:function(M,f){M.slideIn('t',{stopFx:true});},hide:function(N,f){N.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(O,f){O.fixDisplay();O.alignTo(f.el,'tl-tr');O.slideIn('l',{stopFx:true});},hide:function(P,f){P.slideOut('l',{stopFx:true,useDisplay:true});}}}; -Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:'x-form-empty-field',initEvents:function(){Roo.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.el.on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);if(this.emptyText){this.on('blur',this.postBlur,this);this.applyEmptyText();}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50});this.el.on("click",this.autoSize,this);}},processValue:function(B){if(this.stripCharsRe){var newValue=B.replace(this.stripCharsRe,'');if(newValue!==B){this.setRawValue(newValue);return newValue;}}return B;},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},onKeyUp:function(e){if(!e.isNavKeyPress()){this.autoSize();}},reset:function(){Roo.form.TextField.superclass.reset.call(this);this.applyEmptyText();},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass);}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue('');} +this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();if(v===this.emptyText){v='';}return v;},getValue:function(){var v=this.el.getValue();if(v===this.emptyText||v===undefined){v='';}return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;}if(A='textarea'){return w-2;}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true});},hide:function(A,f){A.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(A,f){A.fixDisplay();A.alignTo(f.el,'tl-tr');A.slideIn('l',{stopFx:true});},hide:function(A,f){A.slideOut('l',{stopFx:true,useDisplay:true});}}}; +Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:'x-form-empty-field',initEvents:function(){Roo.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.el.on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);if(this.emptyText){this.on('blur',this.postBlur,this);this.applyEmptyText();}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50});this.el.on("click",this.autoSize,this);}},processValue:function(A){if(this.stripCharsRe){var newValue=A.replace(this.stripCharsRe,'');if(newValue!==A){this.setRawValue(newValue);return newValue;}}return A;},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},onKeyUp:function(e){if(!e.isNavKeyPress()){this.autoSize();}},reset:function(){Roo.form.TextField.superclass.reset.call(this);this.applyEmptyText();},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass);}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue('');} this.el.removeClass(this.emptyClass);}if(this.selectOnFocus){this.el.dom.select();}},postBlur:function(){this.applyEmptyText();},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE &&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},setValue:function(v){if(this.emptyText&&this.el&&v!==undefined&&v!==null&&v!==''){this.el.removeClass(this.emptyClass);} -Roo.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();},validateValue:function(C){if(C.length<1||C===this.emptyText){if(this.allowBlank){this.clearInvalid();return true;}else {this.markInvalid(this.blankText);return false;}}if(C.lengththis.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](C,this)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;}}if(typeof this.validator=="function"){var msg=this.validator(C);if(msg!==true){this.markInvalid(msg);return false;}}if(this.regex&&!this.regex.test(C)){this.markInvalid(this.regexText);return false;}return true;},selectText:function(D,E){var v=this.getRawValue();if(v.length>0){D=D===undefined?0:D;E=E===undefined?v.length:E;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(D,E);}else if(d.createTextRange){var range=d.createTextRange();range.moveStart("character",D);range.moveEnd("character",v.length-E);range.select();}}},autoSize:function(){if(!this.grow||!this.rendered){return;}if(!this.metrics){this.metrics=Roo.util.TextMetrics.createInstance(this.el);}var el=this.el;var v=el.dom.value;var d=document.createElement('div');d.appendChild(document.createTextNode(v));v=d.innerHTML;d=null;v+=" ";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w);}}); +Roo.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();},validateValue:function(A){if(A.length<1||A===this.emptyText){if(this.allowBlank){this.clearInvalid();return true;}else {this.markInvalid(this.blankText);return false;}}if(A.lengththis.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;}}if(typeof this.validator=="function"){var msg=this.validator(A);if(msg!==true){this.markInvalid(msg);return false;}}if(this.regex&&!this.regex.test(A)){this.markInvalid(this.regexText);return false;}return true;},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var range=d.createTextRange();range.moveStart("character",A);range.moveEnd("character",v.length-B);range.select();}}},autoSize:function(){if(!this.grow||!this.rendered){return;}if(!this.metrics){this.metrics=Roo.util.TextMetrics.createInstance(this.el);}var el=this.el;var v=el.dom.value;var d=document.createElement('div');d.appendChild(document.createTextNode(v));v=d.innerHTML;d=null;v+=" ";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w);}}); Roo.form.Hidden=function(A){Roo.form.Hidden.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Hidden,Roo.form.TextField,{fieldLabel:'',inputType:'hidden',width:50,allowBlank:true,labelSeparator:'',hidden:true,itemCls:'x-form-item-display-none'}); -Roo.form.TriggerField=function(A){this.mimicing=false;Roo.form.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.TriggerField,Roo.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',onResize:function(w,h){Roo.form.TriggerField.superclass.onResize.apply(this,arguments);if(typeof w=='number'){this.el.setWidth(this.adjustWidth('input',w-this.trigger.getWidth()));}},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,'tl-tr',[2,0]);},onRender:function(ct,B){Roo.form.TriggerField.superclass.onRender.call(this,ct,B);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false);} +Roo.form.TriggerField=function(A){this.mimicing=false;Roo.form.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.TriggerField,Roo.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',onResize:function(w,h){Roo.form.TriggerField.superclass.onResize.apply(this,arguments);if(typeof w=='number'){this.el.setWidth(this.adjustWidth('input',w-this.trigger.getWidth()));}},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,'tl-tr',[2,0]);},onRender:function(ct,A){Roo.form.TriggerField.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false);} this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());}},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver('x-form-trigger-over');this.trigger.addClassOnClick('x-form-trigger-click');},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove();}if(this.wrap){this.wrap.remove();} Roo.form.TriggerField.superclass.onDestroy.call(this);},onFocus:function(){Roo.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass('x-trigger-wrap-focus');this.mimicing=true;Roo.get(Roo.isIE?document.body:document).on("mousedown",this.mimicBlur,this);if(this.monitorTab){this.el.on("keydown",this.checkTab,this);}}},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur();}},onBlur:function(){},mimicBlur:function(e,t){if(!this.wrap.contains(t)&&this.validateBlur()){this.triggerBlur();}},triggerBlur:function(){this.mimicing=false;Roo.get(Roo.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this);} -this.wrap.removeClass('x-trigger-wrap-focus');Roo.form.TriggerField.superclass.onBlur.call(this);},validateBlur:function(e,t){return true;},onDisable:function(){Roo.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass('x-item-disabled');}},onEnable:function(){Roo.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass('x-item-disabled');}},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible';}},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn});Roo.form.TwinTriggerField=Roo.extend(Roo.form.TriggerField,{initComponent:function(){Roo.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:'span',cls:'x-form-twin-triggers',cn:[{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]};},getTrigger:function(C){return this.triggers[C];},initTrigger:function(){var ts=this.trigger.select('.x-form-trigger',true);this.wrap.setStyle('overflow','hidden');var D=this;ts.each(function(t,E,F){t.hide=function(){var w=D.wrap.getWidth();this.dom.style.display='none';D.el.setWidth(w-D.trigger.getWidth());};t.show=function(){var w=D.wrap.getWidth();this.dom.style.display='';D.el.setWidth(w-D.trigger.getWidth());};var G='Trigger'+(F+1);if(this['hide'+G]){t.dom.style.display='none';} -t.on("click",this['on'+G+'Click'],this,{preventDefault:true});t.addClassOnOver('x-form-trigger-over');t.addClassOnClick('x-form-trigger-click');},this);this.triggers=ts.elements;},onTrigger1Click:Roo.emptyFn,onTrigger2Click:Roo.emptyFn}); -Roo.form.TextArea=function(A){Roo.form.TextArea.superclass.constructor.call(this,A);if(this.minHeight!==undefined){this.growMin=this.minHeight;}if(this.maxHeight!==undefined){this.growMax=this.maxHeight;}};Roo.extend(Roo.form.TextArea,Roo.form.TextField,{growMin:60,growMax:1000,preventScrollbars:false,onRender:function(ct,B){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} -Roo.form.TextArea.superclass.onRender.call(this,ct,B);if(this.grow){this.textSizeEl=Roo.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden");} +this.wrap.removeClass('x-trigger-wrap-focus');Roo.form.TriggerField.superclass.onBlur.call(this);},validateBlur:function(e,t){return true;},onDisable:function(){Roo.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass('x-item-disabled');}},onEnable:function(){Roo.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass('x-item-disabled');}},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible';}},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn});Roo.form.TwinTriggerField=Roo.extend(Roo.form.TriggerField,{initComponent:function(){Roo.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:'span',cls:'x-form-twin-triggers',cn:[{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]};},getTrigger:function(A){return this.triggers[A];},initTrigger:function(){var ts=this.trigger.select('.x-form-trigger',true);this.wrap.setStyle('overflow','hidden');var A=this;ts.each(function(t,B,C){t.hide=function(){var w=A.wrap.getWidth();this.dom.style.display='none';A.el.setWidth(w-A.trigger.getWidth());};t.show=function(){var w=A.wrap.getWidth();this.dom.style.display='';A.el.setWidth(w-A.trigger.getWidth());};var D='Trigger'+(C+1);if(this['hide'+D]){t.dom.style.display='none';} +t.on("click",this['on'+D+'Click'],this,{preventDefault:true});t.addClassOnOver('x-form-trigger-over');t.addClassOnClick('x-form-trigger-click');},this);this.triggers=ts.elements;},onTrigger1Click:Roo.emptyFn,onTrigger2Click:Roo.emptyFn}); +Roo.form.TextArea=function(A){Roo.form.TextArea.superclass.constructor.call(this,A);if(this.minHeight!==undefined){this.growMin=this.minHeight;}if(this.maxHeight!==undefined){this.growMax=this.maxHeight;}};Roo.extend(Roo.form.TextArea,Roo.form.TextField,{growMin:60,growMax:1000,preventScrollbars:false,onRender:function(ct,A){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} +Roo.form.TextArea.superclass.onRender.call(this,ct,A);if(this.grow){this.textSizeEl=Roo.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden");} this.el.setHeight(this.growMin);}},onDestroy:function(){if(this.textSizeEl){this.textSizeEl.parentNode.removeChild(this.textSizeEl);} Roo.form.TextArea.superclass.onDestroy.call(this);},onKeyUp:function(e){if(!e.isNavKeyPress()||e.getKey()==e.ENTER){this.autoSize();}},autoSize:function(){if(!this.grow||!this.textSizeEl){return;}var el=this.el;var v=el.dom.value;var ts=this.textSizeEl;ts.innerHTML='';ts.appendChild(document.createTextNode(v));v=ts.innerHTML;Roo.fly(ts).setWidth(this.el.getWidth());if(v.length<1){v="  ";}else {if(Roo.isIE){v=v.replace(/\n/g,'

     

    ');} v+=" \n ";} ts.innerHTML=v;var h=Math.min(this.growMax,Math.max(ts.offsetHeight,this.growMin));if(h!=this.lastHeight){this.lastHeight=h;this.el.setHeight(h);this.fireEvent("autosize",this,h);}}}); -Roo.form.NumberField=function(A){Roo.form.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.NumberField,Roo.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",initEvents:function(){Roo.form.NumberField.superclass.initEvents.call(this);var B="0123456789";if(this.allowDecimals){B+=this.decimalSeparator;}if(this.allowNegative){B+="-";} -this.stripCharsRe=new RegExp('[^'+B+']','gi');var C=function(e){var k=e.getKey();if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE )){return;}var c=e.getCharCode();if(B.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",C,this);},validateValue:function(D){if(!Roo.form.NumberField.superclass.validateValue.call(this,D)){return false;}if(D.length<1){return true;}var E=this.parseValue(D);if(isNaN(E)){this.markInvalid(String.format(this.nanText,D));return false;}if(Ethis.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false;}return true;},getValue:function(){return this.fixPrecision(this.parseValue(Roo.form.NumberField.superclass.getValue.call(this)));},parseValue:function(F){F=parseFloat(String(F).replace(this.decimalSeparator,"."));return isNaN(F)?'':F;},fixPrecision:function(G){var H=isNaN(G);if(!this.allowDecimals||this.decimalPrecision==-1||H||!G){return H?'':G;}return parseFloat(G).toFixed(this.decimalPrecision);},setValue:function(v){Roo.form.NumberField.superclass.setValue.call(this,String(v).replace(".",this.decimalSeparator));},decimalPrecisionFcn:function(v){return Math.floor(v);},beforeBlur:function(){var v=this.parseValue(this.getRawValue());if(v){this.setValue(this.fixPrecision(v));}}}); +Roo.form.NumberField=function(A){Roo.form.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.NumberField,Roo.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",initEvents:function(){Roo.form.NumberField.superclass.initEvents.call(this);var A="0123456789";if(this.allowDecimals){A+=this.decimalSeparator;}if(this.allowNegative){A+="-";} +this.stripCharsRe=new RegExp('[^'+A+']','gi');var B=function(e){var k=e.getKey();if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE )){return;}var c=e.getCharCode();if(A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",B,this);},validateValue:function(A){if(!Roo.form.NumberField.superclass.validateValue.call(this,A)){return false;}if(A.length<1){return true;}var B=this.parseValue(A);if(isNaN(B)){this.markInvalid(String.format(this.nanText,A));return false;}if(Bthis.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false;}return true;},getValue:function(){return this.fixPrecision(this.parseValue(Roo.form.NumberField.superclass.getValue.call(this)));},parseValue:function(A){A=parseFloat(String(A).replace(this.decimalSeparator,"."));return isNaN(A)?'':A;},fixPrecision:function(A){var B=isNaN(A);if(!this.allowDecimals||this.decimalPrecision==-1||B||!A){return B?'':A;}return parseFloat(A).toFixed(this.decimalPrecision);},setValue:function(v){Roo.form.NumberField.superclass.setValue.call(this,String(v).replace(".",this.decimalSeparator));},decimalPrecisionFcn:function(v){return Math.floor(v);},beforeBlur:function(){var v=this.parseValue(this.getRawValue());if(v){this.setValue(this.fixPrecision(v));}}}); Roo.form.DateField=function(A){Roo.form.DateField.superclass.constructor.call(this,A);this.addEvents({'select':true});if(typeof this.minValue=="string")this.minValue=this.parseDate(this.minValue);if(typeof this.maxValue=="string")this.maxValue=this.parseDate(this.maxValue);this.ddMatch=null;if(this.disabledDates){var dd=this.disabledDates;var re="(?:";for(var i=0;ithis.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false;}if(this.disabledDays){var day=C.getDay();for(var i=0;ithis.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false;}if(this.disabledDays){var day=A.getDay();for(var i=0;i{'+this.displayField+'}
    ';} -this.view=new Roo.View(this.innerList,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.collapse,this);if(this.resizable){this.resizer=new Roo.Resizable(this.list,{pinned:true,handles:'se'});this.resizer.on('resize',function(r,w,h){this.maxHeight=h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;this.listWidth=w;this.innerList.setWidth(w-this.list.getFrameWidth('lr'));this.restrictHeight();},this);this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom',this.handleHeight+'px');}if(!this.editable){this.editable=true;this.setEditable(false);}},initEvents:function(){Roo.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Roo.KeyNav(this.el,{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else {this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.onViewClick();},"esc":function(e){this.collapse();},"tab":function(e){this.onViewClick(false);return true;},scope:this,doRelay:function(D,E,F){if(F=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);}return true;},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this);}if(this.forceSelection){this.on('blur',this.doForce,this);}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners();}if(this.list){this.list.destroy();}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.collapse,this);} -Roo.form.ComboBox.superclass.onDestroy.call(this);},fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){Roo.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var lw=Math.max(w,this.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},setEditable:function(D){if(D==this.editable){return;} -this.editable=D;if(!D){this.el.dom.setAttribute('readOnly',true);this.el.on('mousedown',this.onTriggerClick,this);this.el.addClass('x-combo-noedit');}else {this.el.dom.setAttribute('readOnly',false);this.el.un('mousedown',this.onTriggerClick,this);this.el.removeClass('x-combo-noedit');}},onBeforeLoad:function(){if(!this.hasFocus){return;} -this.innerList.update(this.loadingText?'
    '+this.loadingText+'
    ':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){if(!this.hasFocus){return;}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select();}if(!this.selectByValue(this.value,true)){this.select(0,true);}}else {this.selectNext();if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE ){this.taTask.delay(this.typeAheadDelay);}}}else {this.onEmptyResults();}},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var newValue=r.data[this.displayField];var len=newValue.length;var selStart=this.getRawValue().length;if(selStart!=len){this.setRawValue(newValue);this.selectText(selStart,newValue.length);}}},onSelect:function(E,F){if(this.fireEvent('beforeselect',this,E,F)!==false){this.setFromData(F>-1?E.data:false);this.collapse();this.fireEvent('select',this,E,F);}},getValue:function(){if(this.valueField){return typeof this.value!='undefined'?this.value:'';}else {return Roo.form.ComboBox.superclass.getValue.call(this);}},clearValue:function(){if(this.hiddenField){this.hiddenField.value='';} -this.value='';this.setRawValue('');this.lastSelectionText='';this.applyEmptyText();},setValue:function(v){var G=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){G=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){G=this.valueNotFoundText;}} -this.lastSelectionText=G;if(this.hiddenField){this.hiddenField.value=v;} -Roo.form.ComboBox.superclass.setValue.call(this,G);this.value=v;},lastData:false,setFromData:function(o){var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else {console.log('no value field set for '+this.name);}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];}if(this.hiddenField){this.hiddenField.value=vv;this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return;} -this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.originalValue);this.clearInvalid();this.lastData=false;},findRecord:function(H,I){var J;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[H]==I){J=r;return false;}});}return J;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var K=this.view.findItemFromChild(t);if(K){var F=this.view.indexOf(K);this.select(F,false);}},onViewClick:function(L){var M=this.view.getSelectedIndexes()[0];var r=this.store.getAt(M);if(r){this.onSelect(r,M);}if(L!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var N=this.innerList.dom;var h=Math.max(N.clientHeight,N.offsetHeight,N.scrollHeight);this.innerList.setHeight(h0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;this.applyEmptyText();}},doQuery:function(q,R){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:R,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;} -q=qe.query;R=qe.forceAll;if(R===true||(q.length>=this.minChars)){if(this.lastQuery!=q){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;if(R){this.store.clearFilter();}else {this.store.filter(this.displayField,q);} +this.selectedIndex=-1;if(this.mode=='local'){if(A.queryDelay===undefined){this.queryDelay=10;}if(A.minChars===undefined){this.minChars=0;}}};Roo.extend(Roo.form.ComboBox,Roo.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listWidth:undefined,displayField:undefined,valueField:undefined,hiddenName:undefined,listClass:'',selectedClass:'x-combo-selected',triggerClass:'x-form-arrow-trigger',shadow:'sides',listAlign:'tl-bl?',maxHeight:300,triggerAction:'query',minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:'query',loadingText:'Loading...',resizable:false,handleHeight:8,editable:true,allQuery:'',mode:'remote',minListWidth:70,forceSelection:false,typeAheadDelay:250,valueNotFoundText:undefined,blockFocus:false,disableClear:false,onRender:function(ct,A){Roo.form.ComboBox.superclass.onRender.call(this,ct,A);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var B='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[B,this.listClass].join(' '),constrain:false});var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:B+'-hd',html:this.title});this.assetHeight+=this.header.getHeight();} +this.innerList=this.list.createChild({cls:B+'-inner'});this.innerList.on('mouseover',this.onViewOver,this);this.innerList.on('mousemove',this.onViewMove,this);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));if(this.allowBlank&&!this.pageSize&&!this.disableClear){this.footer=this.list.createChild({cls:B+'-ft'});this.pageTb=new Roo.Toolbar(this.footer);}if(this.pageSize){this.footer=this.list.createChild({cls:B+'-ft'});this.pageTb=new Roo.PagingToolbar(this.footer,this.store,{pageSize:this.pageSize});}if(this.pageTb&&this.allowBlank&&!this.disableClear){var _this=this;this.pageTb.add(new Roo.Toolbar.Fill(),{cls:'x-btn-icon x-btn-clear',text:' ',handler:function(){_this.collapse();_this.clearValue();_this.onSelect(false,-1);}});}if(this.footer){this.assetHeight+=this.footer.getHeight();}if(!this.tpl){this.tpl='
    {'+this.displayField+'}
    ';} +this.view=new Roo.View(this.innerList,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.collapse,this);if(this.resizable){this.resizer=new Roo.Resizable(this.list,{pinned:true,handles:'se'});this.resizer.on('resize',function(r,w,h){this.maxHeight=h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;this.listWidth=w;this.innerList.setWidth(w-this.list.getFrameWidth('lr'));this.restrictHeight();},this);this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom',this.handleHeight+'px');}if(!this.editable){this.editable=true;this.setEditable(false);}},initEvents:function(){Roo.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Roo.KeyNav(this.el,{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else {this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.onViewClick();},"esc":function(e){this.collapse();},"tab":function(e){this.onViewClick(false);return true;},scope:this,doRelay:function(A,B,C){if(C=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);}return true;},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this);}if(this.forceSelection){this.on('blur',this.doForce,this);}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners();}if(this.list){this.list.destroy();}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.collapse,this);} +Roo.form.ComboBox.superclass.onDestroy.call(this);},fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){Roo.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var lw=Math.max(w,this.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},setEditable:function(A){if(A==this.editable){return;} +this.editable=A;if(!A){this.el.dom.setAttribute('readOnly',true);this.el.on('mousedown',this.onTriggerClick,this);this.el.addClass('x-combo-noedit');}else {this.el.dom.setAttribute('readOnly',false);this.el.un('mousedown',this.onTriggerClick,this);this.el.removeClass('x-combo-noedit');}},onBeforeLoad:function(){if(!this.hasFocus){return;} +this.innerList.update(this.loadingText?'
    '+this.loadingText+'
    ':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){if(!this.hasFocus){return;}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select();}if(!this.selectByValue(this.value,true)){this.select(0,true);}}else {this.selectNext();if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE ){this.taTask.delay(this.typeAheadDelay);}}}else {this.onEmptyResults();}},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var newValue=r.data[this.displayField];var len=newValue.length;var selStart=this.getRawValue().length;if(selStart!=len){this.setRawValue(newValue);this.selectText(selStart,newValue.length);}}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromData(B>-1?A.data:false);this.collapse();this.fireEvent('select',this,A,B);}},getValue:function(){if(this.valueField){return typeof this.value!='undefined'?this.value:'';}else {return Roo.form.ComboBox.superclass.getValue.call(this);}},clearValue:function(){if(this.hiddenField){this.hiddenField.value='';} +this.value='';this.setRawValue('');this.lastSelectionText='';this.applyEmptyText();},setValue:function(v){var A=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){A=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){A=this.valueNotFoundText;}} +this.lastSelectionText=A;if(this.hiddenField){this.hiddenField.value=v;} +Roo.form.ComboBox.superclass.setValue.call(this,A);this.value=v;},lastData:false,setFromData:function(o){var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else {console.log('no value field set for '+this.name);}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];}if(this.hiddenField){this.hiddenField.value=vv;this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return;} +this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.originalValue);this.clearInvalid();this.lastData=false;},findRecord:function(A,B){var C;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;return false;}});}return C;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var A=this.view.findItemFromChild(t);if(A){var index=this.view.indexOf(A);this.select(index,false);}},onViewClick:function(A){var B=this.view.getSelectedIndexes()[0];var r=this.store.getAt(B);if(r){this.onSelect(r,B);}if(A!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var A=this.innerList.dom;var h=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight);this.innerList.setHeight(h0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;this.applyEmptyText();}},doQuery:function(q,A){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:A,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;} +q=qe.query;A=qe.forceAll;if(A===true||(q.length>=this.minChars)){if(this.lastQuery!=q){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;if(A){this.store.clearFilter();}else {this.store.filter(this.displayField,q);} this.onLoad();}else {this.store.baseParams[this.queryParam]=q;this.store.load({params:this.getParams(q)});this.expand();}}else {this.selectedIndex=-1;this.onLoad();}}},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize;}return p;},collapse:function(){if(!this.isExpanded()){return;} this.list.hide();Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);this.fireEvent('collapse',this);},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.list)){this.collapse();}},expand:function(){if(this.isExpanded()||!this.hasFocus){return;} this.list.alignTo(this.el,this.listAlign);this.list.show();Roo.get(document).on('mousedown',this.collapseIf,this);Roo.get(document).on('mousewheel',this.collapseIf,this);this.fireEvent('expand',this);},onTriggerClick:function(){if(this.disabled){return;}if(this.isExpanded()){this.collapse();if(!this.blockFocus){this.el.focus();}}else {this.hasFocus=true;if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);}else {this.doQuery(this.getRawValue());}if(!this.blockFocus){this.el.focus();}}}}); -Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"},boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this);},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,B){Roo.form.Checkbox.superclass.onRender.call(this,ct,B);this.wrap=this.el.wrap({cls:'x-menu-check-item '});var C=this.wrap.createChild({tag:'img',cls:'x-menu-item-icon',style:'margin: 0px;',src:Roo.BLANK_IMAGE_URL});this.viewEl=C;this.wrap.on('click',this.onClick,this);this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});} -this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff;}return this.valueOff;},onClick:function(){this.setChecked(!this.checked);},setValue:function(v,D){this.setChecked(String(v)===String(this.inputValue),D);},setChecked:function(E,F){if(this.inSetChecked){this.checked=E;return;}if(this.wrap){this.wrap[E?'addClass':'removeClass']('x-menu-item-checked');} -this.checked=E;if(F!==true){this.fireEvent('checkchange',this,E);} -this.inSetChecked=true;this.el.dom.value=E?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;} +Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"},boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this);},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-menu-check-item '});var B=this.wrap.createChild({tag:'img',cls:'x-menu-item-icon',style:'margin: 0px;',src:Roo.BLANK_IMAGE_URL});this.viewEl=B;this.wrap.on('click',this.onClick,this);this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});} +this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff;}return this.valueOff;},onClick:function(){this.setChecked(!this.checked);},setValue:function(v,A){this.setChecked(String(v)===String(this.inputValue),A);},setChecked:function(A,B){if(this.inSetChecked){this.checked=A;return;}if(this.wrap){this.wrap[A?'addClass':'removeClass']('x-menu-item-checked');} +this.checked=A;if(B!==true){this.fireEvent('checkchange',this,A);} +this.inSetChecked=true;this.el.dom.value=A?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;} this.setValue(this.el.dom.value);},onDestroy:function(){if(this.viewEl){Roo.get(this.viewEl).remove();} Roo.form.Checkbox.superclass.onDestroy.call(this);}}); Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.form.Radio,Roo.form.Checkbox,{inputType:'radio',getGroupValue:function(){return this.el.up('form').child('input[name='+this.el.dom.name+']:checked',true).value;}}); -Roo.form.HtmlEditor=Roo.extend(Roo.form.Field,{toolbars:false,createLinkText:'Please enter the URL for the link:',defaultLinkValue:'http:/'+'/',frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true})},createToolbar:function(A){if(!A.toolbars||!A.toolbars.length){A.toolbars=[new Roo.form.HtmlEditor.ToolbarStandard()];}for(var i=0;i';},onRender:function(ct,B){Roo.form.HtmlEditor.superclass.onRender.call(this,ct,B);this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')} -this.wrap=this.el.wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.frameId=Roo.id();this.createToolbar(this);var C=this.wrap.createChild({tag:'iframe',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"});this.iframe=C.dom;this.assignDocWin();this.doc.designMode='on';this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var D={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;} -Roo.TaskMgr.stop(D);this.initEditor.defer(10,this);}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(D);if(!this.width){this.setSize(this.el.getSize());}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));this.iframe.style.width=aw+'px';}if(typeof h=='number'){var tbh=0;for(var i=0;i5){if(Roo.isSafari){G=G.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(G==' '){G='';}return G;},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var G=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs.match(/text-align:(.*?);/i);if(m&&m[1]){G='
    '+G+'
    ';}} -G=this.cleanHtml(G);if(this.fireEvent('beforesync',this,G)!==false){this.el.dom.value=G;this.fireEvent('sync',this,G);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value;if(v.length<1){v=' ';}if(this.fireEvent('beforepush',this,v)!==false){(this.doc.body||this.doc.documentElement).innerHTML=v;this.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else {this.el.focus();}},assignDocWin:function(){var H=this.iframe;if(Roo.isIE){this.doc=H.contentWindow.document;this.win=H.contentWindow;}else {this.doc=(H.contentDocument||Roo.get(this.frameId).dom.document);this.win=Roo.get(this.frameId).dom.contentWindow;}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var I=(this.doc.body||this.doc.documentElement);var ss=this.el.getStyles('font-size','background-image','background-repeat');ss['background-attachment']='fixed';I.bgProperties='fixed';Roo.DomHelper.applyStyles(I,ss);Roo.EventManager.on(this.doc,{'mousedown':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.applyCommand,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);} +Roo.form.HtmlEditor=Roo.extend(Roo.form.Field,{toolbars:false,createLinkText:'Please enter the URL for the link:',defaultLinkValue:'http:/'+'/',frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true})},createToolbar:function(A){if(!A.toolbars||!A.toolbars.length){A.toolbars=[new Roo.form.HtmlEditor.ToolbarStandard()];}for(var i=0;i';},onRender:function(ct,A){Roo.form.HtmlEditor.superclass.onRender.call(this,ct,A);this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')} +this.wrap=this.el.wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.frameId=Roo.id();this.createToolbar(this);var B=this.wrap.createChild({tag:'iframe',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"});this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on';this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;} +Roo.TaskMgr.stop(C);this.initEditor.defer(10,this);}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);if(!this.width){this.setSize(this.el.getSize());}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));this.iframe.style.width=aw+'px';}if(typeof h=='number'){var tbh=0;for(var i=0;i5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A==' '){A='';}return A;},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var html=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs.match(/text-align:(.*?);/i);if(m&&m[1]){html='
    '+html+'
    ';}} +html=this.cleanHtml(html);if(this.fireEvent('beforesync',this,html)!==false){this.el.dom.value=html;this.fireEvent('sync',this,html);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value;if(v.length<1){v=' ';}if(this.fireEvent('beforepush',this,v)!==false){(this.doc.body||this.doc.documentElement).innerHTML=v;this.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else {this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else {this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=Roo.get(this.frameId).dom.contentWindow;}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);var ss=this.el.getStyles('font-size','background-image','background-repeat');ss['background-attachment']='fixed';A.bgProperties='fixed';Roo.DomHelper.applyStyles(A,ss);Roo.EventManager.on(this.doc,{'mousedown':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.applyCommand,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);} this.initialized=true;this.fireEvent('initialize',this);this.pushValue();},onDestroy:function(){if(this.rendered){for(var i=0;i48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];} -v=Math.max(1,v+K);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.fireEvent('editorevent',this,e);this.syncValue();},insertTag:function(tg){this.execCmd("formatblock",tg);},insertText:function(L){range=this.createRange();range.deleteContents();range.insertNode(this.doc.createTextNode(L));},relayBtnCmd:function(M){this.relayCmd(M.cmd);},relayCmd:function(N,O){this.win.focus();this.execCmd(N,O);this.fireEvent('editorevent',this);this.deferFocus();},execCmd:function(P,Q){this.doc.execCommand(P,false,Q===undefined?null:Q);this.syncValue();},applyCommand:function(e){if(e.ctrlKey){var c=e.getCharCode(),P;if(c>0){c=String.fromCharCode(c);switch(c){case 'b':P='bold';break;case 'i':P='italic';break;case 'u':P='underline';break;}if(P){this.win.focus();this.execCmd(P);this.deferFocus();e.preventDefault();}}}},insertAtCursor:function(R){if(!this.activated){return;}if(Roo.isIE){this.win.focus();var r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML(R);this.syncValue();this.deferFocus();}}else if(Roo.isGecko||Roo.isOpera){this.win.focus();this.execCmd('InsertHTML',R);this.deferFocus();}else if(Roo.isSafari){this.execCmd('InsertText',R);this.deferFocus();}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}}else if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var target=r.parentElement();if(!target||target.tagName.toLowerCase()!='li'){e.stopEvent();r.pasteHTML('
    ');r.collapse(false);r.select();}}}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    ');this.deferFocus();}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;} -a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var S=this.createRange(this.getSelection());if(Roo.isIE){var parent=S.parentElement();while(true){var testRange=S.duplicate();testRange.moveToElementText(parent);if(testRange.inRange(S)){break;}if((parent.nodeType!=1)||(parent.tagName.toLowerCase()=='body')){break;} -parent=parent.parentElement;}return parent;}var ar=S.endContainer.childNodes;if(!ar.length){ar=S.commonAncestorContainer.childNodes;}var T=[];var U=[];var V=false;for(var i=0;i0)){U.push(ar[i]);continue;}if(!this.rangeIntersectsNode(S,ar[i])||(this.rangeCompareNode(S,ar[i])==0)){continue;} -V=true;}if(!T.length&&U.length){T=U;}if(V||!T.length||(T.length>1)){return false;}return T[0];},createRange:function(W){if(typeof W!="undefined"){try{return W.getRangeAt?W.getRangeAt(0):W.createRange();}catch(e){return this.doc.createRange();}}else {return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var X=Roo.isIE?this.doc.selection:this.win.getSelection();var Y=this.createRange(X);try{var p=Y.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(Z,b){var d=b.ownerDocument.createRange();try{d.selectNode(b);}catch(e){nodeRange.selectNodeContents(node);}return Z.compareBoundaryPoints(Range.END_TO_START,d)==-1&&Z.compareBoundaryPoints(Range.START_TO_END,d)==1;},rangeCompareNode:function(f,g){var j=g.ownerDocument.createRange();try{j.selectNode(g);}catch(e){nodeRange.selectNodeContents(node);}var k=f.compareBoundaryPoints(Range.START_TO_START,j)==1;var l=f.compareBoundaryPoints(Range.END_TO_END,j)==-1;if(k&&!l)return 0;if(!k&&l)return 1;if(k&&l)return 2;return 3;}}); +this.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10);if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];} +v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.fireEvent('editorevent',this,e);this.syncValue();},insertTag:function(tg){this.execCmd("formatblock",tg);},insertText:function(A){range=this.createRange();range.deleteContents();range.insertNode(this.doc.createTextNode(A));},relayBtnCmd:function(A){this.relayCmd(A.cmd);},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.fireEvent('editorevent',this);this.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);this.syncValue();},applyCommand:function(e){if(e.ctrlKey){var c=e.getCharCode(),cmd;if(c>0){c=String.fromCharCode(c);switch(c){case 'b':cmd='bold';break;case 'i':cmd='italic';break;case 'u':cmd='underline';break;}if(cmd){this.win.focus();this.execCmd(cmd);this.deferFocus();e.preventDefault();}}}},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isIE){this.win.focus();var r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML(A);this.syncValue();this.deferFocus();}}else if(Roo.isGecko||Roo.isOpera){this.win.focus();this.execCmd('InsertHTML',A);this.deferFocus();}else if(Roo.isSafari){this.execCmd('InsertText',A);this.deferFocus();}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}}else if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var target=r.parentElement();if(!target||target.tagName.toLowerCase()!='li'){e.stopEvent();r.pasteHTML('
    ');r.collapse(false);r.select();}}}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    ');this.deferFocus();}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;} +a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var A=this.createRange(this.getSelection());if(Roo.isIE){var parent=A.parentElement();while(true){var testRange=A.duplicate();testRange.moveToElementText(parent);if(testRange.inRange(A)){break;}if((parent.nodeType!=1)||(parent.tagName.toLowerCase()=='body')){break;} +parent=parent.parentElement;}return parent;}var ar=A.endContainer.childNodes;if(!ar.length){ar=A.commonAncestorContainer.childNodes;}var B=[];var C=[];var D=false;for(var i=0;i0)){C.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;} +D=true;}if(!B.length&&C.length){B=C;}if(D||!B.length||(B.length>1)){return false;}return B[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else {return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(node);}return A.compareBoundaryPoints(Range.END_TO_START,C)==-1&&A.compareBoundaryPoints(Range.START_TO_END,C)==1;},rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(node);}var D=A.compareBoundaryPoints(Range.START_TO_START,C)==1;var E=A.compareBoundaryPoints(Range.END_TO_END,C)==-1;if(D&&!E)return 0;if(!D&&E)return 1;if(D&&E)return 2;return 3;}}); Roo.form.HtmlEditor.ToolbarStandard=function(A){Roo.apply(this,A);} -Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,{tb:false,rendered:false,editor:false,disable:false,fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],specialChars:["©","®","™","£","…","÷","€","°"],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"]],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(B){this.editor=B;var C=B.frameId;var D=this;function E(id,G,H){var I=C+'-'+id;return {id:I,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:G!==false,scope:B,handler:H||B.relayBtnCmd,clickEvent:'mousedown',tooltip:D.buttonTips[id]||undefined,tabIndex:-1};}var tb=new Roo.Toolbar(B.wrap.dom.firstChild);this.tb=tb;tb.el.on('click',function(e){e.preventDefault();});if(!this.disable.font&&!Roo.isSafari){};if(!this.disable.formats){this.formatCombo=new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'tag',fields:['tag'],data:this.formats}),blockFocus:true,displayField:'tag',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Add tag',selectOnFocus:true,width:135,listeners:{'select':function(c,r,i){B.insertTag(r.get('tag'));B.focus();}}});tb.addField(this.formatCombo);}if(!this.disable.format){tb.add(E('bold'),E('italic'),E('underline'));};if(!this.disable.fontSize){tb.add('-',E('increasefontsize',false,B.adjustFont),E('decreasefontsize',false,B.adjustFont));};if(this.disable.colors){tb.add('-',{id:B.frameId+'-forecolor',cls:'x-btn-icon x-edit-forecolor',clickEvent:'mousedown',tooltip:this.buttonTips['forecolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({allowReselect:true,focus:Roo.emptyFn,value:'000000',plain:true,selectHandler:function(cp,G){B.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+G:G);B.deferFocus();},scope:B,clickEvent:'mousedown'})},{id:B.frameId+'backcolor',cls:'x-btn-icon x-edit-backcolor',clickEvent:'mousedown',tooltip:this.buttonTips['backcolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({focus:Roo.emptyFn,value:'FFFFFF',plain:true,allowReselect:true,selectHandler:function(cp,H){if(Roo.isGecko){B.execCmd('useCSS',false);B.execCmd('hilitecolor',H);B.execCmd('useCSS',true);B.deferFocus();}else {B.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+H:H);B.deferFocus();}},scope:B,clickEvent:'mousedown'})});};if(!this.disable.alignments){tb.add('-',E('justifyleft'),E('justifycenter'),E('justifyright'));};if(!this.disable.links){tb.add('-',E('createlink',false,B.createLink));};if(!this.disable.lists){tb.add('-',E('insertorderedlist'),E('insertunorderedlist'));}if(!this.disable.sourceEdit){tb.add('-',E('sourceedit',true,function(G){this.toggleSourceEdit(G.pressed);}));}var F={};if(!this.disable.special){F={text:"©",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i':'>'),ff,'');}return K.join('');},toggleSourceEdit:function(L){if(L===undefined){L=!this.sourceEditMode;} -this.sourceEditMode=L===true;var M=this.tb.items.get(this.editor.frameId+'-sourceedit');if(M.pressed!==this.editor.sourceEditMode){M.toggle(this.editor.sourceEditMode);return;}if(this.sourceEditMode){this.tb.items.each(function(N){if(N.cmd!='sourceedit'){N.disable();}});}else {if(this.initialized){this.tb.items.each(function(O){O.enable();});}} -this.editor.toggleSourceEdit(L);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(N){if(N.menu){N.menu.removeAll();if(N.menu.el){N.menu.el.destroy();}} -N.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(N){N.enable();});}}); +Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,{tb:false,rendered:false,editor:false,disable:false,fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],specialChars:["©","®","™","£","…","÷","€","°"],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"]],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function D(id,F,G){var H=B+'-'+id;return {id:H,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:F!==false,scope:A,handler:G||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var tb=new Roo.Toolbar(A.wrap.dom.firstChild);this.tb=tb;tb.el.on('click',function(e){e.preventDefault();});if(!this.disable.font&&!Roo.isSafari){};if(!this.disable.formats){this.formatCombo=new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'tag',fields:['tag'],data:this.formats}),blockFocus:true,displayField:'tag',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Add tag',selectOnFocus:true,width:135,listeners:{'select':function(c,r,i){A.insertTag(r.get('tag'));A.focus();}}});tb.addField(this.formatCombo);}if(!this.disable.format){tb.add(D('bold'),D('italic'),D('underline'));};if(!this.disable.fontSize){tb.add('-',D('increasefontsize',false,A.adjustFont),D('decreasefontsize',false,A.adjustFont));};if(this.disable.colors){tb.add('-',{id:A.frameId+'-forecolor',cls:'x-btn-icon x-edit-forecolor',clickEvent:'mousedown',tooltip:this.buttonTips['forecolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({allowReselect:true,focus:Roo.emptyFn,value:'000000',plain:true,selectHandler:function(cp,F){A.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+F:F);A.deferFocus();},scope:A,clickEvent:'mousedown'})},{id:A.frameId+'backcolor',cls:'x-btn-icon x-edit-backcolor',clickEvent:'mousedown',tooltip:this.buttonTips['backcolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({focus:Roo.emptyFn,value:'FFFFFF',plain:true,allowReselect:true,selectHandler:function(cp,F){if(Roo.isGecko){A.execCmd('useCSS',false);A.execCmd('hilitecolor',F);A.execCmd('useCSS',true);A.deferFocus();}else {A.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+F:F);A.deferFocus();}},scope:A,clickEvent:'mousedown'})});};if(!this.disable.alignments){tb.add('-',D('justifyleft'),D('justifycenter'),D('justifyright'));};if(!this.disable.links){tb.add('-',D('createlink',false,A.createLink));};if(!this.disable.lists){tb.add('-',D('insertorderedlist'),D('insertunorderedlist'));}if(!this.disable.sourceEdit){tb.add('-',D('sourceedit',true,function(F){this.toggleSourceEdit(F.pressed);}));}var E={};if(!this.disable.special){E={text:"©",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i':'>'),ff,'');}return A.join('');},toggleSourceEdit:function(A){if(A===undefined){A=!this.sourceEditMode;} +this.sourceEditMode=A===true;var B=this.tb.items.get(this.editor.frameId+'-sourceedit');if(B.pressed!==this.editor.sourceEditMode){B.toggle(this.editor.sourceEditMode);return;}if(this.sourceEditMode){this.tb.items.each(function(C){if(C.cmd!='sourceedit'){C.disable();}});}else {if(this.initialized){this.tb.items.each(function(C){C.enable();});}} +this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}} +A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});}}); Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);} -Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20},width:{title:"Width",width:40},height:{title:"Height",width:40},border:{title:"Border",width:20}},'TD':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["center"],["right"],["justify"],["char"]],width:40},valign:{title:"Valign",opts:[[""],["top"],["middle"],["bottom"],["baseline"]],width:40},colspan:{title:"Colspan",width:20}},'INPUT':{name:{title:"name",width:120},value:{title:"Value",width:120},width:{title:"Width",width:40}},'LABEL':{'for':{title:"For",width:120}},'TEXTAREA':{name:{title:"name",width:120},rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}},'SELECT':{name:{title:"name",width:120},selectoptions:{title:"Options",width:200}},'BODY':{title:{title:"title",width:120,disabled:true}}};Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,{tb:false,rendered:false,editor:false,disable:false,toolbars:false,init:function(B){this.editor=B;var C=B.frameId;var D=this;function E(id,G,H){var I=C+'-'+id;return {id:I,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:G!==false,scope:B,handler:H||B.relayBtnCmd,clickEvent:'mousedown',tooltip:D.buttonTips[id]||undefined,tabIndex:-1};}var F=B.wrap.createChild({tag:'div'},B.wrap.dom.firstChild.nextSibling,true);var ty=Roo.form.HtmlEditor.ToolbarContext.types;this.toolbars={};for(var i in ty){this.toolbars[i]=this.buildToolbar(ty[i],i);} -this.tb=this.toolbars.BODY;this.tb.el.show();this.rendered=true;B.on('editorevent',this.updateToolbar,this);},updateToolbar:function(){if(!this.editor.activated){this.editor.onFirstFocus();return;}var G=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;var H=G.length?(G[0]?G[0]:G[1]):this.editor.doc.body;H=H?H:this.editor.doc.body;H=H.tagName.length?H:this.editor.doc.body;var tn=H.tagName.toUpperCase();H=typeof(ty[tn])!='undefined'?H:this.editor.doc.body;tn=H.tagName.toUpperCase();if(this.tb.name==tn){return;} -this.tb.el.hide();this.tb=this.toolbars[tn];this.tb.el.show();this.tb.fields.each(function(e){e.setValue(H.getAttribute(e.name));});this.tb.selectedNode=H;Roo.menu.MenuMgr.hideAll();},onDestroy:function(){if(this.rendered){this.tb.items.each(function(I){if(I.menu){I.menu.removeAll();if(I.menu.el){I.menu.el.destroy();}} -I.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(I){I.enable();});},buildToolbar:function(I,nm){var J=this.editor;var K=J.wrap.createChild({tag:'div'},J.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(K);tb.add(nm+": ");for(var i in I){var item=I[i];tb.add(item.title+": ");if(item.opts){tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val'],data:item.opts}),name:i,displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:item.width?item.width:130,listeners:{'select':function(c,r,i){tb.selectedNode.setAttribute(c.name,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;} +Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20},width:{title:"Width",width:40},height:{title:"Height",width:40},border:{title:"Border",width:20}},'TD':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["center"],["right"],["justify"],["char"]],width:40},valign:{title:"Valign",opts:[[""],["top"],["middle"],["bottom"],["baseline"]],width:40},colspan:{title:"Colspan",width:20}},'INPUT':{name:{title:"name",width:120},value:{title:"Value",width:120},width:{title:"Width",width:40}},'LABEL':{'for':{title:"For",width:120}},'TEXTAREA':{name:{title:"name",width:120},rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}},'SELECT':{name:{title:"name",width:120},selectoptions:{title:"Options",width:200}},'BODY':{title:{title:"title",width:120,disabled:true}}};Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,{tb:false,rendered:false,editor:false,disable:false,toolbars:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function D(id,F,G){var H=B+'-'+id;return {id:H,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:F!==false,scope:A,handler:G||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var E=A.wrap.createChild({tag:'div'},A.wrap.dom.firstChild.nextSibling,true);var ty=Roo.form.HtmlEditor.ToolbarContext.types;this.toolbars={};for(var i in ty){this.toolbars[i]=this.buildToolbar(ty[i],i);} +this.tb=this.toolbars.BODY;this.tb.el.show();this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(){if(!this.editor.activated){this.editor.onFirstFocus();return;}var A=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;var B=A.length?(A[0]?A[0]:A[1]):this.editor.doc.body;B=B?B:this.editor.doc.body;B=B.tagName.length?B:this.editor.doc.body;var tn=B.tagName.toUpperCase();B=typeof(ty[tn])!='undefined'?B:this.editor.doc.body;tn=B.tagName.toUpperCase();if(this.tb.name==tn){return;} +this.tb.el.hide();this.tb=this.toolbars[tn];this.tb.el.show();this.tb.fields.each(function(e){e.setValue(B.getAttribute(e.name));});this.tb.selectedNode=B;Roo.menu.MenuMgr.hideAll();},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}} +A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});},buildToolbar:function(A,nm){var B=this.editor;var C=B.wrap.createChild({tag:'div'},B.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(C);tb.add(nm+": ");for(var i in A){var item=A[i];tb.add(item.title+": ");if(item.opts){tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val'],data:item.opts}),name:i,displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:item.width?item.width:130,listeners:{'select':function(c,r,i){tb.selectedNode.setAttribute(c.name,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;} tb.addField(new Roo.form.TextField({name:i,width:item.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.name,nv);}}}));} tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();tb.name=nm;return tb;}}); Roo.form.BasicForm=function(el,A){this.allItems=[];this.childForms=[];Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);} -Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:undefined,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var B=true;this.items.each(function(f){if(!f.validate()){B=false;}});return B;},isDirty:function(){var C=false;this.items.each(function(f){if(f.isDirty()){C=true;return false;}});return C;},doAction:function(D,E){if(typeof D=='string'){D=new Roo.form.Action.ACTION_TYPES[D](this,E);}if(this.fireEvent('beforeaction',this,D)!==false){this.beforeAction(D);D.run.defer(100,D);}return this;},submit:function(F){this.doAction('submit',F);return this;},load:function(G){this.doAction('load',G);return this;},updateRecord:function(H){H.beginEdit();var fs=H.fields;fs.each(function(f){var I=this.findField(f.name);if(I){H.set(f.name,I.getValue());}},this);H.endEdit();return this;},loadRecord:function(I){this.setValues(I.data);return this;},beforeAction:function(J){var o=J.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.mask(o.waitMsg,'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg,'x-mask-loading');}else {Roo.MessageBox.wait(o.waitMsg,o.waitTitle||this.waitTitle||'Please Wait...');}}},afterAction:function(K,L){this.activeAction=null;var o=K.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else {Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}}if(L){if(o.reset){this.reset();} -Roo.callback(o.success,o.scope,[this,K]);this.fireEvent('actioncomplete',this,K);}else {Roo.callback(o.failure,o.scope,[this,K]);this.fireEvent('actionfailed',this,K);}},findField:function(id){var M=this.items.get(id);if(!M){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){M=f;return false;}});}return M||null;},addForm:function(N){if(this.childForms.indexOf(N)>-1){return;} -this.childForms.push(N);Roo.each(N.allItems,function(fe){if(this.findField(fe.name)){return;}var O=new Roo.form.Hidden({name:fe.name});O.render(this.el);this.add(O);},this);},markInvalid:function(O){if(O instanceof Array){for(var i=0,len=O.length;i-1){return;} +this.childForms.push(A);Roo.each(A.allItems,function(fe){if(this.findField(fe.name)){return;}var B=new Roo.form.Hidden({name:fe.name});B.render(this.el);this.add(B);},this);},markInvalid:function(A){if(A instanceof Array){for(var i=0,len=A.length;i1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return C;},fieldset:function(c){var fs=new Roo.form.FieldSet(c);this.start(fs);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return fs;},container:function(c){var l=new Roo.form.Layout(c);this.start(l);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return l;},start:function(c){Roo.applyIf(c,{'labelAlign':this.active.labelAlign,'labelWidth':this.active.labelWidth,'itemCls':this.active.itemCls});this.active.stack.push(c);c.ownerCt=this.active;this.active=c;return this;},end:function(){if(this.active==this.root){return this;} -this.active=this.active.ownerCt;return this;},add:function(){this.active.stack.push.apply(this.active.stack,arguments);this.allItems.push.apply(this.allItems,arguments);var r=[];for(var i=0,a=arguments,len=a.length;i0){Roo.form.Form.superclass.add.apply(this,r);}return this;},findbyId:function(id){var D=false;if(!id){return D;} -Ext.each(this.allItems,function(f){if(f.id==id||f.name==id){D=f;return false;}});return D;},render:function(ct){ct=Roo.get(ct);var o=this.autoCreate||{tag:'form',method:this.method||'POST',id:this.id||Roo.id()};this.initEl(ct.createChild(o));this.root.render(this.el);this.items.each(function(f){f.render('x-form-el-'+f.id);});if(this.buttons.length>0){var tb=this.el.createChild({cls:'x-form-btns-ct',cn:{cls:"x-form-btns x-form-btns-"+this.buttonAlign,html:'
    '}},null,true);var tr=tb.getElementsByTagName('tr')[0];for(var i=0,len=this.buttons.length;i1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return A;},fieldset:function(c){var fs=new Roo.form.FieldSet(c);this.start(fs);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return fs;},container:function(c){var l=new Roo.form.Layout(c);this.start(l);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return l;},start:function(c){Roo.applyIf(c,{'labelAlign':this.active.labelAlign,'labelWidth':this.active.labelWidth,'itemCls':this.active.itemCls});this.active.stack.push(c);c.ownerCt=this.active;this.active=c;return this;},end:function(){if(this.active==this.root){return this;} +this.active=this.active.ownerCt;return this;},add:function(){this.active.stack.push.apply(this.active.stack,arguments);this.allItems.push.apply(this.allItems,arguments);var r=[];for(var i=0,a=arguments,len=a.length;i0){Roo.form.Form.superclass.add.apply(this,r);}return this;},findbyId:function(id){var A=false;if(!id){return A;} +Ext.each(this.allItems,function(f){if(f.id==id||f.name==id){A=f;return false;}});return A;},render:function(ct){ct=Roo.get(ct);var o=this.autoCreate||{tag:'form',method:this.method||'POST',id:this.id||Roo.id()};this.initEl(ct.createChild(o));this.root.render(this.el);this.items.each(function(f){f.render('x-form-el-'+f.id);});if(this.buttons.length>0){var tb=this.el.createChild({cls:'x-form-btns-ct',cn:{cls:"x-form-btns x-form-btns-"+this.buttonAlign,html:'
    '}},null,true);var tr=tb.getElementsByTagName('tr')[0];for(var i=0,len=this.buttons.length;i0){if(!this.fieldTpl){var t=new Roo.Template('
    ','','
    ','
    ','
    ');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.fieldTpl=t;}for(var i=0;i','','
    ','
    ','
    ');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.rowTpl=t;} -this.fieldTpl=this.rowTpl;var J=100;if((this.labelAlign!='top')){if(typeof this.labelWidth=='number'){J=this.labelWidth} -this.padWidth=20+J;} -Roo.form.Column.superclass.onRender.call(this,ct,I);if(this.width){this.el.setWidth(this.width);}if(this.height){this.el.setHeight(this.height);}},renderField:function(f){f.fieldEl=this.fieldTpl.append(this.el,[f.id,f.fieldLabel,f.labelStyle||this.labelStyle||'',this.elementStyle||'',typeof f.labelSeparator=='undefined'?this.labelSeparator:f.labelSeparator,f.itemCls||this.itemCls||'',f.width?f.width+this.padWidth:160+this.padWidth],true);}});Roo.form.FieldSet=function(K){Roo.form.FieldSet.superclass.constructor.call(this,K);};Roo.extend(Roo.form.FieldSet,Roo.form.Layout,{defaultAutoCreate:{tag:'fieldset',cn:{tag:'legend'}},onRender:function(ct,L){Roo.form.FieldSet.superclass.onRender.call(this,ct,L);if(this.legend){this.setLegend(this.legend);}},setLegend:function(M){if(this.rendered){this.el.child('legend').update(M);}}}); +Roo.form.Layout.superclass.constructor.call(this,A);this.stack=[];Roo.each(B,this.addxtype,this);};Roo.extend(Roo.form.Layout,Roo.Component,{clear:true,labelSeparator:':',hideLabels:false,defaultAutoCreate:{tag:'div',cls:'x-form-ct'},isLayout:true,onRender:function(ct,A){if(this.el){this.el=Roo.get(this.el);}else {var cfg=this.getAutoCreate();this.el=ct.createChild(cfg,A);}if(this.style){this.el.applyStyles(this.style);}if(this.labelAlign){this.el.addClass('x-form-label-'+this.labelAlign);}if(this.hideLabels){this.labelStyle="display:none";this.elementStyle="padding-left:0;";}else {if(typeof this.labelWidth=='number'){this.labelStyle="width:"+this.labelWidth+"px;";this.elementStyle="padding-left:"+((this.labelWidth+(typeof this.labelPad=='number'?this.labelPad:5))+'px')+";";}if(this.labelAlign=='top'){this.labelStyle="width:auto;";this.elementStyle="padding-left:0;";}}var B=this.stack;var C=B.length;if(C>0){if(!this.fieldTpl){var t=new Roo.Template('
    ','','
    ','
    ','
    ');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.fieldTpl=t;}for(var i=0;i','','
    ','
    ','
    ');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.rowTpl=t;} +this.fieldTpl=this.rowTpl;var B=100;if((this.labelAlign!='top')){if(typeof this.labelWidth=='number'){B=this.labelWidth} +this.padWidth=20+B;} +Roo.form.Column.superclass.onRender.call(this,ct,A);if(this.width){this.el.setWidth(this.width);}if(this.height){this.el.setHeight(this.height);}},renderField:function(f){f.fieldEl=this.fieldTpl.append(this.el,[f.id,f.fieldLabel,f.labelStyle||this.labelStyle||'',this.elementStyle||'',typeof f.labelSeparator=='undefined'?this.labelSeparator:f.labelSeparator,f.itemCls||this.itemCls||'',f.width?f.width+this.padWidth:160+this.padWidth],true);}});Roo.form.FieldSet=function(A){Roo.form.FieldSet.superclass.constructor.call(this,A);};Roo.extend(Roo.form.FieldSet,Roo.form.Layout,{defaultAutoCreate:{tag:'fieldset',cn:{tag:'legend'}},onRender:function(ct,A){Roo.form.FieldSet.superclass.onRender.call(this,ct,A);if(this.legend){this.setLegend(this.legend);}},setLegend:function(A){if(this.rendered){this.el.child('legend').update(A);}}}); Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;var D=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return {'email':function(v){return C.test(v);},'emailText':'This field should be an e-mail address in the format "user@domain.com"','emailMask':/[a-z0-9_\.\-@]/i,'url':function(v){return D.test(v);},'urlText':'This field should be a URL in the format "http:/'+'/www.domain.com"','alpha':function(v){return A.test(v);},'alphaText':'This field should only contain letters and _','alphaMask':/[a-z_]/i,'alphanum':function(v){return B.test(v);},'alphanumText':'This field should only contain letters, numbers and _','alphanumMask':/[a-z0-9_]/i};}(); -Roo.form.FCKeditor=function(A){Roo.form.FCKeditor.superclass.constructor.call(this,A);this.addEvents({editorinit:true});};Roo.form.FCKeditor.editors={};Roo.extend(Roo.form.FCKeditor,Roo.form.TextArea,{fckconfig:false,toolbarSet:'Basic',basePath:'/fckeditor/',frame:false,value:'',onRender:function(ct,B){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} -Roo.form.FCKeditor.superclass.onRender.call(this,ct,B);Roo.form.FCKeditor.editors[this.getId()]=this;this.replaceTextarea();},getEditor:function(){return this.fckEditor;},setValue:function(C){if(typeof(C)=='undefined'){return;} -Roo.form.FCKeditor.superclass.setValue.apply(this,[C]);if(!this.getEditor()){return;} -this.getEditor().SetData(C);},getValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getValue.call(this);}if(!this.el||!this.getEditor()){return this.value;}var D=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setValue.apply(this,[D]);return Roo.form.FCKeditor.superclass.getValue.call(this);},getRawValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getRawValue.call(this);}if(!this.el||!this.getEditor()){return this.value;return;}var E=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setRawValue.apply(this,[E]);return Roo.form.FCKeditor.superclass.getRawValue.call(this);},setSize:function(w,h){Roo.form.FCKeditor.superclass.setSize.apply(this,[w,h]);this.frame.dom.setAttribute('width',w);this.frame.dom.setAttribute('height',h);this.frame.setSize(w,h);},toggleSourceEdit:function(F){this.el.dom.style.display=F?'':'none';this.frame.dom.style.display=F?'none':'';},focus:function(G){if(this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.focus.call(this);}if(!this.el||!this.getEditor()){this.focus.defer(100,this,[G]);return;}var H=this.getEditor().EditorDocument.getElementsByTagName(G);this.getEditor().Focus();if(H.length){if(!this.getEditor().Selection.GetSelection()){this.focus.defer(100,this,[G]);return;}var r=this.getEditor().EditorDocument.createRange();r.setStart(H[0],0);r.setEnd(H[0],0);this.getEditor().Selection.GetSelection().removeAllRanges();this.getEditor().Selection.GetSelection().addRange(r);this.getEditor().Focus();}},replaceTextarea:function(){if(document.getElementById(this.getId()+'___Frame'))return;var I=document.getElementById(this.getId());var J=document.getElementsByName(this.getId());I.style.display='none';if(I.tabIndex){this.TabIndex=I.tabIndex;} -this._insertHtmlBefore(this._getConfigHtml(),I);this._insertHtmlBefore(this._getIFrameHtml(),I);this.frame=Roo.get(this.getId()+'___Frame')},_getConfigHtml:function(){var K='';for(var o in this.fckconfig){K+=K.length>0?'&':'';K+=encodeURIComponent(o)+'='+encodeURIComponent(this.fckconfig[o]);}return '';},_getIFrameHtml:function(){var L='fckeditor.html';var M=this.basePath+'editor/'+L+'?InstanceName='+encodeURIComponent(this.getId());M+=this.toolbarSet?('&Toolbar='+this.toolbarSet):'';var N='';return N;},_insertHtmlBefore:function(O,P){if(P.insertAdjacentHTML){P.insertAdjacentHTML('beforeBegin',O);}else {var oRange=document.createRange();oRange.setStartBefore(P);var oFragment=oRange.createContextualFragment(O);P.parentNode.insertBefore(oFragment,P);}}});function Q(R){var f=Roo.form.FCKeditor.editors[R.Name];f.fckEditor=R;f.fireEvent('editorinit',f,R);} -Roo.form.GridField=function(A){Roo.form.GridField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.GridField,Roo.form.Field,{width:100,height:50,xgrid:false,defaultAutoCreate:{tag:'input',type:'hidden',autocomplete:'off'},addTitle:false,onResize:function(){Roo.form.Field.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,B){this.style=this.style||'overflow: hidden; border:1px solid #c3daf9;';var C=this.style;delete this.style;Roo.form.DisplayImage.superclass.onRender.call(this,ct,B);this.wrap=this.el.wrap({cls:''});this.viewEl=this.wrap.createChild({tag:'div'});if(C){this.viewEl.applyStyles(C);}if(this.width){this.viewEl.setWidth(this.width);}if(this.height){this.viewEl.setHeight(this.height);} +Roo.form.FCKeditor=function(A){Roo.form.FCKeditor.superclass.constructor.call(this,A);this.addEvents({editorinit:true});};Roo.form.FCKeditor.editors={};Roo.extend(Roo.form.FCKeditor,Roo.form.TextArea,{fckconfig:false,toolbarSet:'Basic',basePath:'/fckeditor/',frame:false,value:'',onRender:function(ct,A){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} +Roo.form.FCKeditor.superclass.onRender.call(this,ct,A);Roo.form.FCKeditor.editors[this.getId()]=this;this.replaceTextarea();},getEditor:function(){return this.fckEditor;},setValue:function(A){if(typeof(A)=='undefined'){return;} +Roo.form.FCKeditor.superclass.setValue.apply(this,[A]);if(!this.getEditor()){return;} +this.getEditor().SetData(A);},getValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getValue.call(this);}if(!this.el||!this.getEditor()){return this.value;}var A=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setValue.apply(this,[A]);return Roo.form.FCKeditor.superclass.getValue.call(this);},getRawValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getRawValue.call(this);}if(!this.el||!this.getEditor()){return this.value;return;}var A=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setRawValue.apply(this,[A]);return Roo.form.FCKeditor.superclass.getRawValue.call(this);},setSize:function(w,h){Roo.form.FCKeditor.superclass.setSize.apply(this,[w,h]);this.frame.dom.setAttribute('width',w);this.frame.dom.setAttribute('height',h);this.frame.setSize(w,h);},toggleSourceEdit:function(A){this.el.dom.style.display=A?'':'none';this.frame.dom.style.display=A?'none':'';},focus:function(A){if(this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.focus.call(this);}if(!this.el||!this.getEditor()){this.focus.defer(100,this,[A]);return;}var B=this.getEditor().EditorDocument.getElementsByTagName(A);this.getEditor().Focus();if(B.length){if(!this.getEditor().Selection.GetSelection()){this.focus.defer(100,this,[A]);return;}var r=this.getEditor().EditorDocument.createRange();r.setStart(B[0],0);r.setEnd(B[0],0);this.getEditor().Selection.GetSelection().removeAllRanges();this.getEditor().Selection.GetSelection().addRange(r);this.getEditor().Focus();}},replaceTextarea:function(){if(document.getElementById(this.getId()+'___Frame'))return;var A=document.getElementById(this.getId());var B=document.getElementsByName(this.getId());A.style.display='none';if(A.tabIndex){this.TabIndex=A.tabIndex;} +this._insertHtmlBefore(this._getConfigHtml(),A);this._insertHtmlBefore(this._getIFrameHtml(),A);this.frame=Roo.get(this.getId()+'___Frame')},_getConfigHtml:function(){var A='';for(var o in this.fckconfig){A+=A.length>0?'&':'';A+=encodeURIComponent(o)+'='+encodeURIComponent(this.fckconfig[o]);}return '';},_getIFrameHtml:function(){var A='fckeditor.html';var B=this.basePath+'editor/'+A+'?InstanceName='+encodeURIComponent(this.getId());B+=this.toolbarSet?('&Toolbar='+this.toolbarSet):'';var C='';return C;},_insertHtmlBefore:function(A,B){if(B.insertAdjacentHTML){B.insertAdjacentHTML('beforeBegin',A);}else {var oRange=document.createRange();oRange.setStartBefore(B);var oFragment=oRange.createContextualFragment(A);B.parentNode.insertBefore(oFragment,B);}}});function FCKeditor_OnComplete(A){var f=Roo.form.FCKeditor.editors[A.Name];f.fckEditor=A;f.fireEvent('editorinit',f,A);} +Roo.form.GridField=function(A){Roo.form.GridField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.GridField,Roo.form.Field,{width:100,height:50,xgrid:false,defaultAutoCreate:{tag:'input',type:'hidden',autocomplete:'off'},addTitle:false,onResize:function(){Roo.form.Field.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){this.style=this.style||'overflow: hidden; border:1px solid #c3daf9;';var B=this.style;delete this.style;Roo.form.DisplayImage.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:''});this.viewEl=this.wrap.createChild({tag:'div'});if(B){this.viewEl.applyStyles(B);}if(this.width){this.viewEl.setWidth(this.width);}if(this.height){this.viewEl.setHeight(this.height);} this.grid=new Roo.grid[this.xgrid.xtype](this.viewEl,this.xgrid);this.grid.render();this.grid.getDataSource().on('remove',this.refreshValue,this);this.grid.getDataSource().on('update',this.refreshValue,this);this.grid.on('afteredit',this.refreshValue,this);},setValue:function(v){v=v||[];if(this.grid&&this.grid.getDataSource()&&typeof(v)!='undefined'){var ds=this.grid.getDataSource();var data={} data[ds.reader.meta.root]=typeof(v)=='string'?Roo.decode(v):v;ds.loadData(data);} -Roo.form.GridField.superclass.setValue.call(this,v);this.refreshValue();},refreshValue:function(){var D=[];this.grid.getDataSource().each(function(r){D.push(r.data);});this.el.dom.value=Roo.encode(D);}}); +Roo.form.GridField.superclass.setValue.call(this,v);this.refreshValue();},refreshValue:function(){var A=[];this.grid.getDataSource().each(function(r){A.push(r.data);});this.el.dom.value=Roo.encode(A);}}); Roo.DDView=function(A,B,C){Roo.DDView.superclass.constructor.apply(this,arguments);this.getEl().setStyle("outline","0px none");this.getEl().unselectable();if(this.dragGroup){this.setDraggable(this.dragGroup.split(","));}if(this.dropGroup){this.setDroppable(this.dropGroup.split(","));}if(this.deletable){this.setDeletable();} -this.isDirtyFlag=false;this.addEvents({"drop":true});};Roo.extend(Roo.DDView,Roo.View,{isFormField:true,reset:Roo.emptyFn,clearInvalid:Roo.form.Field.prototype.clearInvalid,validate:function(){return true;},destroy:function(){this.purgeListeners();this.getEl.removeAllListeners();this.getEl().remove();if(this.dragZone){if(this.dragZone.destroy){this.dragZone.destroy();}}if(this.dropZone){if(this.dropZone.destroy){this.dropZone.destroy();}}},getName:function(){return this.name;},setValue:function(v){if(!this.store){throw "DDView.setValue(). DDView must be constructed with a valid Store";}var D={};D[this.store.reader.meta.root]=v?[].concat(v):[];this.store.proxy=new Roo.data.MemoryProxy(D);this.store.load();},getValue:function(){var E='(';this.store.each(function(F){E+=F.id+',';});return E.substr(0,E.length-1)+')';},getIds:function(){var i=0,F=new Array(this.store.getCount());this.store.each(function(G){F[i++]=G.id;});return F;},isDirty:function(){return this.isDirtyFlag;},getTargetFromEvent:function(e){var G=e.getTarget();while((G!==null)&&(G.parentNode!=this.el.dom)){G=G.parentNode;}if(!G){G=this.el.dom.lastChild||this.el.dom;}return G;},getDragData:function(e){var H=this.findItemFromChild(e.getTarget());if(H){this.handleSelection(e);var selNodes=this.getSelectedNodes();var dragData={source:this,copy:this.copy||(this.allowCopy&&e.ctrlKey),nodes:selNodes,records:[]};var selectedIndices=this.getSelectedIndexes();for(var i=0;i-1){targets.remove(this.dropZone);}if(targets.length==1){this.dragZone.cachedTarget=null;var el=Roo.get(targets[0].getEl());var box=el.getBox(true);targets[0].onNodeDrop(el.dom,{target:el.dom,xy:[box.x,box.y+box.height-1]},null,this.getDragData(e));}}}},handleSelection:function(e){this.dragZone.cachedTarget=null;var U=this.findItemFromChild(e.getTarget());if(!U){this.clearSelections(true);return;}if(U&&(this.multiSelect||this.singleSelect)){if(this.multiSelect&&e.shiftKey&&(!e.ctrlKey)&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),U.nodeIndex),false);}else if(this.isSelected(this.getNode(U))&&e.ctrlKey){this.unselect(U);}else {this.select(U,this.multiSelect&&e.ctrlKey);this.lastSelection=U;}}},onItemClick:function(V,W,e){if(this.fireEvent("beforeclick",this,W,V,e)===false){return false;}return true;},unselect:function(X,Y){var Z=this.getNode(X);if(Z&&this.isSelected(Z)){if(this.fireEvent("beforeselect",this,Z,this.selections)!==false){Roo.fly(Z).removeClass(this.selectedClass);this.selections.remove(Z);if(!Y){this.fireEvent("selectionchange",this,this.selections);}}}}}); +this.dragZone.cachedTarget=null;return true;},removeDropIndicators:function(n){if(n){Roo.fly(n).removeClass(["x-view-drag-insert-above","x-view-drag-insert-below"]);this.lastInsertClass="_noclass";}},setDeletable:function(A){if(!this.singleSelect&&!this.multiSelect){this.singleSelect=true;}var c=this.getContextMenu();this.contextMenu.on("itemclick",function(B){switch(B.id){case "delete":this.remove(this.getSelectedIndexes());break;}},this);this.contextMenu.add({icon:A,id:"delete",text:'Delete'});},getContextMenu:function(){if(!this.contextMenu){this.contextMenu=new Roo.menu.Menu({id:this.id+"-contextmenu"});this.el.on("contextmenu",this.showContextMenu,this);}return this.contextMenu;},disableContextMenu:function(){if(this.contextMenu){this.el.un("contextmenu",this.showContextMenu,this);}},showContextMenu:function(e,A){A=this.findItemFromChild(e.getTarget());if(A){e.stopEvent();this.select(this.getNode(A),this.multiSelect&&e.ctrlKey,true);this.contextMenu.showAt(e.getXY());}},remove:function(A){A=[].concat(A);for(var i=0;i-1){targets.remove(this.dropZone);}if(targets.length==1){this.dragZone.cachedTarget=null;var el=Roo.get(targets[0].getEl());var box=el.getBox(true);targets[0].onNodeDrop(el.dom,{target:el.dom,xy:[box.x,box.y+box.height-1]},null,this.getDragData(e));}}}},handleSelection:function(e){this.dragZone.cachedTarget=null;var A=this.findItemFromChild(e.getTarget());if(!A){this.clearSelections(true);return;}if(A&&(this.multiSelect||this.singleSelect)){if(this.multiSelect&&e.shiftKey&&(!e.ctrlKey)&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),A.nodeIndex),false);}else if(this.isSelected(this.getNode(A))&&e.ctrlKey){this.unselect(A);}else {this.select(A,this.multiSelect&&e.ctrlKey);this.lastSelection=A;}}},onItemClick:function(A,B,e){if(this.fireEvent("beforeclick",this,B,A,e)===false){return false;}return true;},unselect:function(A,B){var C=this.getNode(A);if(C&&this.isSelected(C)){if(this.fireEvent("beforeselect",this,C,this.selections)!==false){Roo.fly(C).removeClass(this.selectedClass);this.selections.remove(C);if(!B){this.fireEvent("selectionchange",this,this.selections);}}}}}); Roo.LayoutManager=function(A,B){Roo.LayoutManager.superclass.constructor.call(this);this.el=Roo.get(A);if(this.el.dom==document.body&&Roo.isIE&&!B.allowScroll){document.body.scroll="no";}else if(this.el.dom!=document.body&&this.el.getStyle('position')=='static'){this.el.position('relative');} -this.id=this.el.id;this.el.addClass("x-layout-container");this.monitorWindowResize=true;this.regions={};this.addEvents({"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true});this.updating=false;Roo.EventManager.onWindowResize(this.onWindowResize,this,true);};Roo.extend(Roo.LayoutManager,Roo.util.Observable,{isUpdating:function(){return this.updating;},beginUpdate:function(){this.updating=true;},endUpdate:function(C){this.updating=false;if(!C){this.layout();}},layout:function(){},onRegionResized:function(D,E){this.fireEvent("regionresized",D,E);this.layout();},onRegionCollapsed:function(F){this.fireEvent("regioncollapsed",F);},onRegionExpanded:function(G){this.fireEvent("regionexpanded",G);},getViewSize:function(){var H;if(this.el.dom!=document.body){H=this.el.getSize();}else {H={width:Roo.lib.Dom.getViewWidth(),height:Roo.lib.Dom.getViewHeight()};} -H.width-=this.el.getBorderWidth("lr")-this.el.getPadding("lr");H.height-=this.el.getBorderWidth("tb")-this.el.getPadding("tb");return H;},getEl:function(){return this.el;},getRegion:function(I){return this.regions[I.toLowerCase()];},onWindowResize:function(){if(this.monitorWindowResize){this.layout();}}}); -Roo.BorderLayout=function(A,B){B=B||{};Roo.BorderLayout.superclass.constructor.call(this,A,B);this.factory=B.factory||Roo.BorderLayout.RegionFactory;for(var i=0,len=this.factory.validRegions.length;i1){for(var i=0,len=arguments.length;i1){for(var i=0,len=arguments.length;i0?K:" ");}},setActivePanel:function(L){L=this.getPanel(L);if(this.activePanel&&this.activePanel!=L){this.activePanel.setActiveState(false);} -this.activePanel=L;L.setActiveState(true);if(this.panelSize){L.setSize(this.panelSize.width,this.panelSize.height);}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&L.isClosable());} -this.updateTitle(L.getTitle());if(this.tabs){this.fireEvent("invalidated",this);} -this.fireEvent("panelactivated",this,L);},showPanel:function(M){if(M=this.getPanel(M)){if(this.tabs){var tab=this.tabs.getTab(M.getEl().id);if(tab.isHidden()){this.tabs.unhideTab(tab.id);} -tab.activate();}else {this.setActivePanel(M);}}return M;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle(" ");this.closeBtn.hide();this.hide();}else {if(!this.isVisible()){this.show();}}},add:function(N){if(arguments.length>1){for(var i=0,len=arguments.length;i0){this.remove(this.panels.first());}},remove:function(Q,R){Q=this.getPanel(Q);if(!Q){return null;}var e={};this.fireEvent("beforeremove",this,Q,e);if(e.cancel===true){return null;} -R=(typeof R!="undefined"?R:(this.config.preservePanels===true||Q.preserve===true));var S=Q.getId();this.panels.removeKey(S);if(R){document.body.appendChild(Q.getEl().dom);}if(this.tabs){this.tabs.removeTab(Q.getEl().id);}else if(!R){this.bodyEl.dom.removeChild(Q.getEl().dom);}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var tempEl=document.createElement("div");tempEl.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);tempEl=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);} -Q.setRegion(null);if(this.activePanel==Q){this.activePanel=null;}if(this.config.autoDestroy!==false&&R!==true){try{Q.destroy();}catch(e){}} -this.fireEvent("panelremoved",this,Q);return Q;},getTabs:function(){return this.tabs;},createTool:function(T,U){var V=Roo.DomHelper.append(T,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"x-layout-tools-button-inner "+U,html:" "}]},true);V.addClassOnOver("x-layout-tools-button-over");return V;}}); -Roo.SplitLayoutRegion=function(A,B,C,D){this.cursor=D;Roo.SplitLayoutRegion.superclass.constructor.call(this,A,B,C);};Roo.extend(Roo.SplitLayoutRegion,Roo.LayoutRegion,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(E){Roo.SplitLayoutRegion.superclass.applyConfig.call(this,E);if(E.split){if(!this.split){var splitEl=Roo.DomHelper.append(this.mgr.el.dom,{tag:"div",id:this.el.id+"-split",cls:"x-layout-split x-layout-split-"+this.position,html:" "});this.split=new Roo.SplitBar(splitEl,this.el,this.orientation);this.split.on("moved",this.onSplitMove,this);this.split.useShim=E.useShim===true;this.split.getMaximumSize=this[this.position=='north'||this.position=='south'?'getVMaxSize':'getHMaxSize'].createDelegate(this);if(this.useSplitTips){this.split.el.dom.title=E.collapsible?this.collapsibleSplitTip:this.splitTip;}if(E.collapsible){this.split.el.on("dblclick",this.collapse,this);}}if(typeof E.minSize!="undefined"){this.split.minSize=E.minSize;}if(typeof E.maxSize!="undefined"){this.split.maxSize=E.maxSize;}if(E.hideWhenEmpty||E.hidden||E.collapsed){this.hideSplitter();}}},getHMaxSize:function(){var F=this.config.maxSize||10000;var G=this.mgr.getRegion("center");return Math.min(F,(this.el.getWidth()+G.getEl().getWidth())-G.getMinWidth());},getVMaxSize:function(){var H=this.config.maxSize||10000;var I=this.mgr.getRegion("center");return Math.min(H,(this.el.getHeight()+I.getEl().getHeight())-I.getMinHeight());},onSplitMove:function(J,K){this.fireEvent("resized",this,K);},getSplitBar:function(){return this.split;},hide:function(){this.hideSplitter();Roo.SplitLayoutRegion.superclass.hide.call(this);},hideSplitter:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide();}},show:function(){if(this.split){this.split.el.show();} +this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;ts.monitorResize=false;ts.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");ts.bodyEl.addClass('x-layout-tabs-body');this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable());if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);} +ti.on("activate",function(){this.setActivePanel(A);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B);}if(this.tabs){var ti=this.tabs.getTab(A.getEl().id);ti.setText(B);if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}}},updateTitle:function(A){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof A!="undefined"&&A.length>0?A:" ");}},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false);} +this.activePanel=A;A.setActiveState(true);if(this.panelSize){A.setSize(this.panelSize.width,this.panelSize.height);}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&A.isClosable());} +this.updateTitle(A.getTitle());if(this.tabs){this.fireEvent("invalidated",this);} +this.fireEvent("panelactivated",this,A);},showPanel:function(A){if(A=this.getPanel(A)){if(this.tabs){var tab=this.tabs.getTab(A.getEl().id);if(tab.isHidden()){this.tabs.unhideTab(tab.id);} +tab.activate();}else {this.setActivePanel(A);}}return A;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle(" ");this.closeBtn.hide();this.hide();}else {if(!this.isVisible()){this.show();}}},add:function(A){if(arguments.length>1){for(var i=0,len=arguments.length;i0){this.remove(this.panels.first());}},remove:function(A,B){A=this.getPanel(A);if(!A){return null;}var e={};this.fireEvent("beforeremove",this,A,e);if(e.cancel===true){return null;} +B=(typeof B!="undefined"?B:(this.config.preservePanels===true||A.preserve===true));var C=A.getId();this.panels.removeKey(C);if(B){document.body.appendChild(A.getEl().dom);}if(this.tabs){this.tabs.removeTab(A.getEl().id);}else if(!B){this.bodyEl.dom.removeChild(A.getEl().dom);}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var tempEl=document.createElement("div");tempEl.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);tempEl=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);} +A.setRegion(null);if(this.activePanel==A){this.activePanel=null;}if(this.config.autoDestroy!==false&&B!==true){try{A.destroy();}catch(e){}} +this.fireEvent("panelremoved",this,A);return A;},getTabs:function(){return this.tabs;},createTool:function(A,B){var C=Roo.DomHelper.append(A,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"x-layout-tools-button-inner "+B,html:" "}]},true);C.addClassOnOver("x-layout-tools-button-over");return C;}}); +Roo.SplitLayoutRegion=function(A,B,C,D){this.cursor=D;Roo.SplitLayoutRegion.superclass.constructor.call(this,A,B,C);};Roo.extend(Roo.SplitLayoutRegion,Roo.LayoutRegion,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(A){Roo.SplitLayoutRegion.superclass.applyConfig.call(this,A);if(A.split){if(!this.split){var splitEl=Roo.DomHelper.append(this.mgr.el.dom,{tag:"div",id:this.el.id+"-split",cls:"x-layout-split x-layout-split-"+this.position,html:" "});this.split=new Roo.SplitBar(splitEl,this.el,this.orientation);this.split.on("moved",this.onSplitMove,this);this.split.useShim=A.useShim===true;this.split.getMaximumSize=this[this.position=='north'||this.position=='south'?'getVMaxSize':'getHMaxSize'].createDelegate(this);if(this.useSplitTips){this.split.el.dom.title=A.collapsible?this.collapsibleSplitTip:this.splitTip;}if(A.collapsible){this.split.el.on("dblclick",this.collapse,this);}}if(typeof A.minSize!="undefined"){this.split.minSize=A.minSize;}if(typeof A.maxSize!="undefined"){this.split.maxSize=A.maxSize;}if(A.hideWhenEmpty||A.hidden||A.collapsed){this.hideSplitter();}}},getHMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getWidth()+B.getEl().getWidth())-B.getMinWidth());},getVMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getHeight()+B.getEl().getHeight())-B.getMinHeight());},onSplitMove:function(A,B){this.fireEvent("resized",this,B);},getSplitBar:function(){return this.split;},hide:function(){this.hideSplitter();Roo.SplitLayoutRegion.superclass.hide.call(this);},hideSplitter:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide();}},show:function(){if(this.split){this.split.el.show();} Roo.SplitLayoutRegion.superclass.show.call(this);},beforeSlide:function(){if(Roo.isGecko){this.bodyEl.clip();if(this.tabs)this.tabs.bodyEl.clip();if(this.activePanel){this.activePanel.getEl().clip();if(this.activePanel.beforeSlide){this.activePanel.beforeSlide();}}}},afterSlide:function(){if(Roo.isGecko){this.bodyEl.unclip();if(this.tabs)this.tabs.bodyEl.unclip();if(this.activePanel){this.activePanel.getEl().unclip();if(this.activePanel.afterSlide){this.activePanel.afterSlide();}}}},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var st=new Roo.util.DelayedTask(this.slideIn,this);this.autoHideHd={"mouseout":function(e){if(!e.within(this.el,true)){st.delay(500);}},"mouseover":function(e){st.cancel();},scope:this};} this.el.on(this.autoHideHd);}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);}},clearMonitor:function(){Roo.get(document).un("click",this.slideInIf,this);},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return;} this.isSlid=true;if(this.collapseBtn){this.collapseBtn.hide();} @@ -803,141 +803,141 @@ this.closeBtnState=this.closeBtn.getStyle('display');this.closeBtn.hide();if(thi this.el.show();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.beforeSlide();this.el.setStyle("z-index",10001);this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Roo.get(document).on("click",this.slideInIf,this);this.fireEvent("slideshow",this);},scope:this,block:true});},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");if(this.collapseBtn){this.collapseBtn.show();} this.closeBtn.setStyle('display',this.closeBtnState);if(this.stickBtn){this.stickBtn.hide();} this.fireEvent("slidehide",this);},slideIn:function(cb){if(!this.isSlid||this.el.hasActiveFx()){Roo.callback(cb);return;} -this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);this.afterSlide();this.afterSlideIn();Roo.callback(cb);},scope:this,block:true});},slideInIf:function(e){if(!e.within(this.el)){this.slideIn();}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var L=this.getSlideAnchor();this.el.slideOut(L,{callback:function(){this.el.setStyle("z-index","");this.collapsedEl.slideIn(L,{duration:.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this);},scope:this,block:true});},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show();} +this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);this.afterSlide();this.afterSlideIn();Roo.callback(cb);},scope:this,block:true});},slideInIf:function(e){if(!e.within(this.el)){this.slideIn();}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var A=this.getSlideAnchor();this.el.slideOut(A,{callback:function(){this.el.setStyle("z-index","");this.collapsedEl.slideIn(A,{duration:.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this);},scope:this,block:true});},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show();} this.fireEvent("invalidated",this);this.fireEvent("expanded",this);},scope:this,block:true});},anchors:{"west":"left","east":"right","north":"top","south":"bottom"},sanchors:{"west":"l","east":"r","north":"t","south":"b"},canchors:{"west":"tl-tr","east":"tr-tl","north":"tl-bl","south":"bl-tl"},getAnchor:function(){return this.anchors[this.position];},getCollapseAnchor:function(){return this.canchors[this.position];},getSlideAnchor:function(){return this.sanchors[this.position];},getAlignAdj:function(){var cm=this.cmargins;switch(this.position){case "west":return [0,0];break;case "east":return [0,0];break;case "north":return [0,0];break;case "south":return [0,0];break;}},getExpandAdj:function(){var c=this.collapsedEl,cm=this.cmargins;switch(this.position){case "west":return [-(cm.right+c.getWidth()+cm.left),0];break;case "east":return [cm.right+c.getWidth()+cm.left,0];break;case "north":return [0,-(cm.top+cm.bottom+c.getHeight())];break;case "south":return [0,cm.top+cm.bottom+c.getHeight()];break;}}}); -Roo.CenterLayoutRegion=function(A,B){Roo.LayoutRegion.call(this,A,B,"center");this.visible=true;this.minWidth=B.minWidth||20;this.minHeight=B.minHeight||20;};Roo.extend(Roo.CenterLayoutRegion,Roo.LayoutRegion,{hide:function(){},show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});Roo.NorthLayoutRegion=function(C,D){Roo.LayoutRegion.call(this,C,D,"north","n-resize");if(this.split){this.split.placement=Roo.SplitBar.TOP;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var E=D.initialSize||D.height;if(typeof E!="undefined"){this.el.setHeight(E);}};Roo.extend(Roo.NorthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var F=this.el.getBox();if(this.split){F.height+=this.split.el.getHeight();}return F;},updateBox:function(G){if(this.split&&!this.collapsed){G.height-=this.split.el.getHeight();this.split.el.setLeft(G.x);this.split.el.setTop(G.y+G.height);this.split.el.setWidth(G.width);}if(this.collapsed){this.updateBody(G.width,null);} -Roo.LayoutRegion.prototype.updateBox.call(this,G);}});Roo.SouthLayoutRegion=function(H,I){Roo.SplitLayoutRegion.call(this,H,I,"south","s-resize");if(this.split){this.split.placement=Roo.SplitBar.BOTTOM;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var J=I.initialSize||I.height;if(typeof J!="undefined"){this.el.setHeight(J);}};Roo.extend(Roo.SouthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var K=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();K.height+=sh;K.y-=sh;}return K;},updateBox:function(L){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();L.height-=sh;L.y+=sh;this.split.el.setLeft(L.x);this.split.el.setTop(L.y-sh);this.split.el.setWidth(L.width);}if(this.collapsed){this.updateBody(L.width,null);} -Roo.LayoutRegion.prototype.updateBox.call(this,L);}});Roo.EastLayoutRegion=function(M,N){Roo.SplitLayoutRegion.call(this,M,N,"east","e-resize");if(this.split){this.split.placement=Roo.SplitBar.RIGHT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var O=N.initialSize||N.width;if(typeof O!="undefined"){this.el.setWidth(O);}};Roo.extend(Roo.EastLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var P=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();P.width+=sw;P.x-=sw;}return P;},updateBox:function(Q){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();Q.width-=sw;this.split.el.setLeft(Q.x);this.split.el.setTop(Q.y);this.split.el.setHeight(Q.height);Q.x+=sw;}if(this.collapsed){this.updateBody(null,Q.height);} -Roo.LayoutRegion.prototype.updateBox.call(this,Q);}});Roo.WestLayoutRegion=function(R,S){Roo.SplitLayoutRegion.call(this,R,S,"west","w-resize");if(this.split){this.split.placement=Roo.SplitBar.LEFT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var T=S.initialSize||S.width;if(typeof T!="undefined"){this.el.setWidth(T);}};Roo.extend(Roo.WestLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var U=this.el.getBox();if(this.split){U.width+=this.split.el.getWidth();}return U;},updateBox:function(V){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();V.width-=sw;this.split.el.setLeft(V.x+V.width);this.split.el.setTop(V.y);this.split.el.setHeight(V.height);}if(this.collapsed){this.updateBody(null,V.height);} -Roo.LayoutRegion.prototype.updateBox.call(this,V);}}); -Roo.LayoutStateManager=function(A){this.state={north:{},south:{},east:{},west:{}};};Roo.LayoutStateManager.prototype={init:function(B,C){this.provider=C;var D=C.get(B.id+"-layout-state");if(D){var wasUpdating=B.isUpdating();if(!wasUpdating){B.beginUpdate();}for(var key in D){if(typeof D[key]!="function"){var rstate=D[key];var r=B.getRegion(key);if(r&&rstate){if(rstate.size){r.resizeTo(rstate.size);}if(rstate.collapsed==true){r.collapse(true);}else {r.expand(null,true);}}}}if(!wasUpdating){B.endUpdate();} -this.state=D;} -this.layout=B;B.on("regionresized",this.onRegionResized,this);B.on("regioncollapsed",this.onRegionCollapsed,this);B.on("regionexpanded",this.onRegionExpanded,this);},storeState:function(){this.provider.set(this.layout.id+"-layout-state",this.state);},onRegionResized:function(E,F){this.state[E.getPosition()].size=F;this.storeState();},onRegionCollapsed:function(G){this.state[G.getPosition()].collapsed=true;this.storeState();},onRegionExpanded:function(H){this.state[H.getPosition()].collapsed=false;this.storeState();}}; +Roo.CenterLayoutRegion=function(A,B){Roo.LayoutRegion.call(this,A,B,"center");this.visible=true;this.minWidth=B.minWidth||20;this.minHeight=B.minHeight||20;};Roo.extend(Roo.CenterLayoutRegion,Roo.LayoutRegion,{hide:function(){},show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});Roo.NorthLayoutRegion=function(A,B){Roo.LayoutRegion.call(this,A,B,"north","n-resize");if(this.split){this.split.placement=Roo.SplitBar.TOP;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var C=B.initialSize||B.height;if(typeof C!="undefined"){this.el.setHeight(C);}};Roo.extend(Roo.NorthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.height+=this.split.el.getHeight();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){A.height-=this.split.el.getHeight();this.split.el.setLeft(A.x);this.split.el.setTop(A.y+A.height);this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}});Roo.SouthLayoutRegion=function(A,B){Roo.SplitLayoutRegion.call(this,A,B,"south","s-resize");if(this.split){this.split.placement=Roo.SplitBar.BOTTOM;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var C=B.initialSize||B.height;if(typeof C!="undefined"){this.el.setHeight(C);}};Roo.extend(Roo.SouthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();A.height+=sh;A.y-=sh;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();A.height-=sh;A.y+=sh;this.split.el.setLeft(A.x);this.split.el.setTop(A.y-sh);this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}});Roo.EastLayoutRegion=function(A,B){Roo.SplitLayoutRegion.call(this,A,B,"east","e-resize");if(this.split){this.split.placement=Roo.SplitBar.RIGHT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var C=B.initialSize||B.width;if(typeof C!="undefined"){this.el.setWidth(C);}};Roo.extend(Roo.EastLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();A.width+=sw;A.x-=sw;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();A.width-=sw;this.split.el.setLeft(A.x);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);A.x+=sw;}if(this.collapsed){this.updateBody(null,A.height);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}});Roo.WestLayoutRegion=function(A,B){Roo.SplitLayoutRegion.call(this,A,B,"west","w-resize");if(this.split){this.split.placement=Roo.SplitBar.LEFT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var C=B.initialSize||B.width;if(typeof C!="undefined"){this.el.setWidth(C);}};Roo.extend(Roo.WestLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.width+=this.split.el.getWidth();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();A.width-=sw;this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);}if(this.collapsed){this.updateBody(null,A.height);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}}); +Roo.LayoutStateManager=function(A){this.state={north:{},south:{},east:{},west:{}};};Roo.LayoutStateManager.prototype={init:function(A,B){this.provider=B;var C=B.get(A.id+"-layout-state");if(C){var wasUpdating=A.isUpdating();if(!wasUpdating){A.beginUpdate();}for(var key in C){if(typeof C[key]!="function"){var rstate=C[key];var r=A.getRegion(key);if(r&&rstate){if(rstate.size){r.resizeTo(rstate.size);}if(rstate.collapsed==true){r.collapse(true);}else {r.expand(null,true);}}}}if(!wasUpdating){A.endUpdate();} +this.state=C;} +this.layout=A;A.on("regionresized",this.onRegionResized,this);A.on("regioncollapsed",this.onRegionCollapsed,this);A.on("regionexpanded",this.onRegionExpanded,this);},storeState:function(){this.provider.set(this.layout.id+"-layout-state",this.state);},onRegionResized:function(A,B){this.state[A.getPosition()].size=B;this.storeState();},onRegionCollapsed:function(A){this.state[A.getPosition()].collapsed=true;this.storeState();},onRegionExpanded:function(A){this.state[A.getPosition()].collapsed=false;this.storeState();}}; Roo.ContentPanel=function(el,A,B){if(el.autoCreate){A=el;el=Roo.id();} this.el=Roo.get(el);if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=A.id||el;} this.el=Roo.DomHelper.append(document.body,A.autoCreate,true);}else {this.el=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-inactive-content",id:A.id||el},true);}} this.closable=false;this.loaded=false;this.active=false;if(typeof A=="string"){this.title=A;}else {Roo.apply(this,A);}if(this.toolbar&&!this.toolbar.el&&this.toolbar.xtype){this.wrapEl=this.el.wrap();this.toolbar=new Roo.Toolbar(this.el.insertSibling(false,'before'),[],this.toolbar);}if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl,true);}else {this.resizeEl=this.el;} this.addEvents({"activate":true,"deactivate":true,"resize":true});if(this.autoScroll){this.resizeEl.setStyle("overflow","auto");} B=B||this.content;if(B){this.setContent(B);}if(A&&A.url){this.setUrl(this.url,this.params,this.loadOnce);} -Roo.ContentPanel.superclass.constructor.call(this);};Roo.extend(Roo.ContentPanel,Roo.util.Observable,{tabTip:'',setRegion:function(C){this.region=C;if(C){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content");}else {this.el.replaceClass("x-layout-active-content","x-layout-inactive-content");}},getToolbar:function(){return this.toolbar;},setActiveState:function(D){this.active=D;if(!D){this.fireEvent("deactivate",this);}else {this.fireEvent("activate",this);}},setContent:function(E,F){this.el.update(E,F);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else {this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(G,H,I){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);} -this.refreshDelegate=this._handleRefresh.createDelegate(this,[G,H,I]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(J,K,L){if(!L||!this.loaded){var updater=this.el.getUpdateManager();updater.update(J,K,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(M,N){if(this.resizeEl!=this.el){M-=this.el.getFrameWidth('lr');N-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();N-=te.getHeight();te.setWidth(M);}if(this.adjustments){M+=this.adjustments[0];N+=this.adjustments[1];}return {"width":M,"height":N};},setSize:function(O,P){if(this.fitToFrame&&!this.ignoreResize(O,P)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(O,P);}var size=this.adjustForComponents(O,P);this.resizeEl.setSize(this.autoWidth?"auto":size.width,this.autoHeight?"auto":size.height);this.fireEvent('resize',this,size.width,size.height);}},getTitle:function(){return this.title;},setTitle:function(Q){this.title=Q;if(this.region){this.region.updatePanelTitle(this,Q);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var R=document.createElement("span");R.appendChild(this.el.dom);R.innerHTML="";this.el.remove();this.el=null;},addxtype:function(S){if(S.xtype.match(/^Form$/)){var el=this.el.createChild();this.form=new Roo.form.Form(S);if(this.form.allItems.length)this.form.render(el.dom);return this.form;}if(['View','JsonView'].indexOf(S.xtype)>-1){S.el=this.el.appendChild(document.createElement("div"));var ret=new Roo[S.xtype](S);ret.render(false,'');return ret;}return false;}});Roo.GridPanel=function(T,U){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(T.getGridEl().dom);Roo.GridPanel.superclass.constructor.call(this,this.wrapper,U);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){this.footer.container=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);} -T.monitorWindowResize=false;T.autoHeight=false;T.autoWidth=false;this.grid=T;this.grid.getGridEl().replaceClass("x-layout-inactive-content","x-layout-component-panel");};Roo.extend(Roo.GridPanel,Roo.ContentPanel,{getId:function(){return this.grid.id;},getGrid:function(){return this.grid;},setSize:function(V,W){if(!this.ignoreResize(V,W)){var T=this.grid;var size=this.adjustForComponents(V,W);T.getGridEl().setSize(size.width,size.height);T.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.GridPanel.superclass.destroy.call(this);}});Roo.NestedLayoutPanel=function(X,Y){Roo.NestedLayoutPanel.superclass.constructor.call(this,X.getEl(),Y);X.monitorWindowResize=false;this.layout=X;this.layout.getEl().addClass("x-layout-nested-layout");};Roo.extend(Roo.NestedLayoutPanel,Roo.ContentPanel,{setSize:function(Z,a){if(!this.ignoreResize(Z,a)){var size=this.adjustForComponents(Z,a);var el=this.layout.getEl();el.setSize(size.width,size.height);var touch=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(b){this.active=b;if(!b){this.fireEvent("deactivate",this);return;} -this.fireEvent("activate",this);if(!this.layout){return;}var c=false;for(var r in this.layout.regions){c=this.layout.getRegion(r);if(c.getActivePanel()){c.setActivePanel(c.getActivePanel());continue;}if(!c.panels.length){continue;} -c.showPanel(c.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(d){return this.layout.addxtype(d);}});Roo.ScrollPanel=function(el,e,f){e=e||{};e.fitToFrame=true;Roo.ScrollPanel.superclass.constructor.call(this,el,e,f);this.el.dom.style.overflow="hidden";var g=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var up=g.createChild({cls:"x-scroller-up",html:" "},this.el.dom);var i=g.createChild({cls:"x-scroller-down",html:" "});up.unselectable();i.unselectable();up.on("click",this.scrollUp,this);i.on("click",this.scrollDown,this);up.addClassOnOver("x-scroller-btn-over");i.addClassOnOver("x-scroller-btn-over");up.addClassOnClick("x-scroller-btn-click");i.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(up.getHeight()+i.getHeight())];this.resizeEl=this.el;this.el=g;this.up=up;this.down=i;};Roo.extend(Roo.ScrollPanel,Roo.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this});},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this});},afterScroll:function(){var el=this.resizeEl;var t=el.dom.scrollTop,h=el.dom.scrollHeight,ch=el.dom.clientHeight;this.up[t==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[h-t<=ch?"addClass":"removeClass"]("x-scroller-btn-disabled");},setSize:function(){Roo.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll();},onWheel:function(e){var d=e.getWheelDelta();this.resizeEl.dom.scrollTop-=(d*this.wheelIncrement);this.afterScroll();e.stopEvent();},setContent:function(j,k){this.resizeEl.update(j,k);}});Roo.TreePanel=function(l){var el=l.el;var m=l.tree;delete l.tree;delete l.el;Roo.TreePanel.superclass.constructor.call(this,el,l);var n=el.createChild();this.tree=new Roo.tree.TreePanel(n,m);this.on('activate',function(){if(this.tree.rendered){return;} +Roo.ContentPanel.superclass.constructor.call(this);};Roo.extend(Roo.ContentPanel,Roo.util.Observable,{tabTip:'',setRegion:function(A){this.region=A;if(A){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content");}else {this.el.replaceClass("x-layout-active-content","x-layout-inactive-content");}},getToolbar:function(){return this.toolbar;},setActiveState:function(A){this.active=A;if(!A){this.fireEvent("deactivate",this);}else {this.fireEvent("activate",this);}},setContent:function(A,B){this.el.update(A,B);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else {this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);} +this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var updater=this.el.getUpdateManager();updater.update(A,B,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();B-=te.getHeight();te.setWidth(A);}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);}var size=this.adjustForComponents(A,B);this.resizeEl.setSize(this.autoWidth?"auto":size.width,this.autoHeight?"auto":size.height);this.fireEvent('resize',this,size.width,size.height);}},getTitle:function(){return this.title;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},addxtype:function(A){if(A.xtype.match(/^Form$/)){var el=this.el.createChild();this.form=new Roo.form.Form(A);if(this.form.allItems.length)this.form.render(el.dom);return this.form;}if(['View','JsonView'].indexOf(A.xtype)>-1){A.el=this.el.appendChild(document.createElement("div"));var ret=new Roo[A.xtype](A);ret.render(false,'');return ret;}return false;}});Roo.GridPanel=function(A,B){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(A.getGridEl().dom);Roo.GridPanel.superclass.constructor.call(this,this.wrapper,B);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){this.footer.container=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);} +A.monitorWindowResize=false;A.autoHeight=false;A.autoWidth=false;this.grid=A;this.grid.getGridEl().replaceClass("x-layout-inactive-content","x-layout-component-panel");};Roo.extend(Roo.GridPanel,Roo.ContentPanel,{getId:function(){return this.grid.id;},getGrid:function(){return this.grid;},setSize:function(A,B){if(!this.ignoreResize(A,B)){var grid=this.grid;var size=this.adjustForComponents(A,B);grid.getGridEl().setSize(size.width,size.height);grid.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.GridPanel.superclass.destroy.call(this);}});Roo.NestedLayoutPanel=function(A,B){Roo.NestedLayoutPanel.superclass.constructor.call(this,A.getEl(),B);A.monitorWindowResize=false;this.layout=A;this.layout.getEl().addClass("x-layout-nested-layout");};Roo.extend(Roo.NestedLayoutPanel,Roo.ContentPanel,{setSize:function(A,B){if(!this.ignoreResize(A,B)){var size=this.adjustForComponents(A,B);var el=this.layout.getEl();el.setSize(size.width,size.height);var touch=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(A){this.active=A;if(!A){this.fireEvent("deactivate",this);return;} +this.fireEvent("activate",this);if(!this.layout){return;}var B=false;for(var r in this.layout.regions){B=this.layout.getRegion(r);if(B.getActivePanel()){B.setActivePanel(B.getActivePanel());continue;}if(!B.panels.length){continue;} +B.showPanel(B.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(A){return this.layout.addxtype(A);}});Roo.ScrollPanel=function(el,A,B){A=A||{};A.fitToFrame=true;Roo.ScrollPanel.superclass.constructor.call(this,el,A,B);this.el.dom.style.overflow="hidden";var C=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var up=C.createChild({cls:"x-scroller-up",html:" "},this.el.dom);var D=C.createChild({cls:"x-scroller-down",html:" "});up.unselectable();D.unselectable();up.on("click",this.scrollUp,this);D.on("click",this.scrollDown,this);up.addClassOnOver("x-scroller-btn-over");D.addClassOnOver("x-scroller-btn-over");up.addClassOnClick("x-scroller-btn-click");D.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(up.getHeight()+D.getHeight())];this.resizeEl=this.el;this.el=C;this.up=up;this.down=D;};Roo.extend(Roo.ScrollPanel,Roo.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this});},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this});},afterScroll:function(){var el=this.resizeEl;var t=el.dom.scrollTop,h=el.dom.scrollHeight,ch=el.dom.clientHeight;this.up[t==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[h-t<=ch?"addClass":"removeClass"]("x-scroller-btn-disabled");},setSize:function(){Roo.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll();},onWheel:function(e){var d=e.getWheelDelta();this.resizeEl.dom.scrollTop-=(d*this.wheelIncrement);this.afterScroll();e.stopEvent();},setContent:function(A,B){this.resizeEl.update(A,B);}});Roo.TreePanel=function(A){var el=A.el;var B=A.tree;delete A.tree;delete A.el;Roo.TreePanel.superclass.constructor.call(this,el,A);var C=el.createChild();this.tree=new Roo.tree.TreePanel(C,B);this.on('activate',function(){if(this.tree.rendered){return;} this.tree.render();});this.on('resize',function(cp,w,h){this.tree.innerCt.setWidth(w);this.tree.innerCt.setHeight(h);this.tree.innerCt.setStyle('overflow-y','auto');});};Roo.extend(Roo.TreePanel,Roo.ContentPanel); Roo.ReaderLayout=function(A,B){var c=A||{size:{}};Roo.ReaderLayout.superclass.constructor.call(this,B||document.body,{north:c.north!==false?Roo.apply({split:false,initialSize:32,titlebar:false},c.north):false,west:c.west!==false?Roo.apply({split:true,initialSize:200,minSize:175,maxSize:400,titlebar:true,collapsible:true,animate:true,margins:{left:5,right:0,bottom:5,top:5},cmargins:{left:5,right:5,bottom:5,top:5}},c.west):false,east:c.east!==false?Roo.apply({split:true,initialSize:200,minSize:175,maxSize:400,titlebar:true,collapsible:true,animate:true,margins:{left:0,right:5,bottom:5,top:5},cmargins:{left:5,right:5,bottom:5,top:5}},c.east):false,center:Roo.apply({tabPosition:'top',autoScroll:false,closeOnTab:true,titlebar:false,margins:{left:c.west!==false?0:5,right:c.east!==false?0:5,bottom:5,top:2}},c.center)});this.el.addClass('x-reader');this.beginUpdate();var C=new Roo.BorderLayout(Roo.get(document.body).createChild(),{south:c.preview!==false?Roo.apply({split:true,initialSize:200,minSize:100,autoScroll:true,collapsible:true,titlebar:true,cmargins:{top:5,left:0,right:0,bottom:0}},c.preview):false,center:Roo.apply({autoScroll:false,titlebar:false,minHeight:200},c.listView)});this.add('center',new Roo.NestedLayoutPanel(C,Roo.apply({title:c.mainTitle||'',tabTip:''},c.innerPanelCfg)));this.endUpdate();this.regions.preview=C.getRegion('south');this.regions.listView=C.getRegion('center');};Roo.extend(Roo.ReaderLayout,Roo.BorderLayout); Roo.grid.Grid=function(A,B){this.container=Roo.get(A);this.container.update("");this.container.setStyle("overflow","hidden");this.container.addClass('x-grid-container');this.id=this.container.id;Roo.apply(this,B);if(this.ds){this.dataSource=this.ds;delete this.ds;}if(this.cm){this.colModel=this.cm;delete this.cm;}if(this.sm){this.selModel=this.sm;delete this.sm;}if(this.selModel){this.selModel=Roo.factory(this.selModel,Roo.grid);this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(typeof(this.colModel.config)=='undefined'){this.colModel=new Roo.grid.ColumnModel(this.colModel);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.dataSource){this.dataSource=Roo.factory(this.dataSource,Roo.data);this.ds=this.dataSource;this.ds.xmodule=this.xmodule||false;}if(this.width){this.container.setWidth(this.width);}if(this.height){this.container.setHeight(this.height);} -this.addEvents({"click":true,"dblclick":true,"contextmenu":true,"mousedown":true,"mouseup":true,"mouseover":true,"mouseout":true,"keypress":true,"keydown":true,"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"headerclick":true,"headerdblclick":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"bodyscroll":true,"columnresize":true,"columnmove":true,"startdrag":true,"enddrag":true,"dragdrop":true,"dragover":true,"dragenter":true,"dragout":true,render:true});Roo.grid.Grid.superclass.constructor.call(this);};Roo.extend(Roo.grid.Grid,Roo.util.Observable,{minColumnWidth:25,autoSizeColumns:false,autoSizeHeaders:true,monitorWindowResize:true,maxRowsToMeasure:0,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableColumnHide:true,enableRowHeightSync:false,stripeRows:true,autoHeight:false,autoExpandColumn:false,autoExpandMin:50,autoExpandMax:1000,view:null,loadMask:false,rendered:false,render:function(){var c=this.container;if((!c.dom.offsetHeight||c.dom.offsetHeight<20)||c.getStyle("height")=="auto"){this.autoHeight=true;}var C=this.getView();C.init(this);c.on("click",this.onClick,this);c.on("dblclick",this.onDblClick,this);c.on("contextmenu",this.onContextMenu,this);c.on("keydown",this.onKeyDown,this);this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);C.render();if(this.loadMask){this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:this.dataSource},this.loadMask));}if(this.toolbar&&this.toolbar.xtype){this.toolbar.container=this.getView().getHeaderPanel(true);this.toolbar=new Ext.Toolbar(this.toolbar);}if(this.footer&&this.footer.xtype){this.footer.dataSource=this.getDataSource();this.footer.container=this.getView().getFooterPanel(true);this.footer=Roo.factory(this.footer,Roo);} -this.rendered=true;this.fireEvent('render',this);return this;},reconfigure:function(D,E){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:D},this.loadMask));} -this.view.bind(D,E);this.dataSource=D;this.colModel=E;this.view.refresh(true);},onKeyDown:function(e){this.fireEvent("keydown",e);},destroy:function(F,G){if(this.loadMask){this.loadMask.destroy();}var c=this.container;c.removeAllListeners();this.view.destroy();this.colModel.purgeListeners();if(!G){this.purgeListeners();} -c.update("");if(F===true){c.remove();}},processEvent:function(H,e){this.fireEvent(H,e);var t=e.getTarget();var v=this.view;var I=v.findHeaderIndex(t);if(I!==false){this.fireEvent("header"+H,this,I,e);}else {var row=v.findRowIndex(t);var cell=v.findCellIndex(t);if(row!==false){this.fireEvent("row"+H,this,row,e);if(cell!==false){this.fireEvent("cell"+H,this,row,cell,e);}}}},onClick:function(e){this.processEvent("click",e);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},onDblClick:function(e){this.processEvent("dblclick",e);},walkCells:function(J,K,L,fn,M){var cm=this.colModel,N=cm.getColumnCount();var ds=this.dataSource,O=ds.getCount(),P=true;if(L<0){if(K<0){J--;P=false;}while(J>=0){if(!P){K=N-1;} -P=false;while(K>=0){if(fn.call(M||this,J,K,cm)===true){return [J,K];} -K--;} -J--;}}else {if(K>=N){J++;P=false;}while(J=0){if(!G){B=E-1;} +G=false;while(B>=0){if(fn.call(D||this,A,B,cm)===true){return [A,B];} +B--;} +A--;}}else {if(B>=E){A++;G=false;}while(A','
    ','
    ','
    ','
    {lockedHeader}
    ','
    {lockedBody}
    ',"
    ",'
    ','
    {header}
    ','
    {body}
    ',"
    ",'
    ','','
     
    ',"
    ");C.master.disableformats=true;}if(!C.header){C.header=new Roo.Template('','{cells}',"
    {splits}");C.header.disableformats=true;} -C.header.compile();if(!C.hcell){C.hcell=new Roo.Template('
    ','
    {value}
    ',"
    ");C.hcell.disableFormats=true;} -C.hcell.compile();if(!C.hsplit){C.hsplit=new Roo.Template('
     
    ');C.hsplit.disableFormats=true;} -C.hsplit.compile();if(!C.body){C.body=new Roo.Template('',"{rows}","
    ");C.body.disableFormats=true;} -C.body.compile();if(!C.row){C.row=new Roo.Template('{cells}');C.row.disableFormats=true;} -C.row.compile();if(!C.cell){C.cell=new Roo.Template('','
    {value}
    ',"");C.cell.disableFormats=true;} -C.cell.compile();this.templates=C;},onColWidthChange:function(){this.updateColumns.apply(this,arguments);},onHeaderChange:function(){this.updateHeaders.apply(this,arguments);},onHiddenChange:function(){this.handleHiddenChange.apply(this,arguments);},onColumnMove:function(){this.handleColumnMove.apply(this,arguments);},onColumnLock:function(){this.handleLockChange.apply(this,arguments);},onDataChange:function(){this.refresh();this.updateHeaderSortState();},onClear:function(){this.refresh();},onUpdate:function(ds,D){this.refreshRow(D);},refreshRow:function(E){var ds=this.ds,F;if(typeof E=='number'){F=E;E=ds.getAt(F);}else {F=ds.indexOf(E);} -this.insertRows(ds,F,F,true);this.onRemove(ds,E,F+1,true);this.syncRowHeights(F,F);this.layout();this.fireEvent("rowupdated",this,F,E);},onAdd:function(ds,G,H){this.insertRows(ds,H,H+(G.length-1));},onRemove:function(ds,I,J,K){if(K!==true){this.fireEvent("beforerowremoved",this,J,I);}var bt=this.getBodyTable(),lt=this.getLockedTable();if(bt.rows[J]){bt.firstChild.removeChild(bt.rows[J]);}if(lt.rows[J]){lt.firstChild.removeChild(lt.rows[J]);}if(K!==true){this.stripeRows(J);this.syncRowHeights(J,J);this.layout();this.fireEvent("rowremoved",this,J,I);}},onLoad:function(){this.scrollToTop();},scrollToTop:function(){if(this.scroller){this.scroller.dom.scrollTop=0;this.syncScroll();}},getHeaderPanel:function(L){if(L){this.headerPanel.show();}return this.headerPanel;},getFooterPanel:function(M){if(M){this.footerPanel.show();}return this.footerPanel;},initElements:function(){var E=Roo.Element;var el=this.grid.getGridEl().dom.firstChild;var cs=el.childNodes;this.el=new E(el);this.headerPanel=new E(el.firstChild);this.headerPanel.enableDisplayMode("block");this.scroller=new E(cs[1]);this.scrollSizer=new E(this.scroller.dom.firstChild);this.lockedWrap=new E(cs[2]);this.lockedHd=new E(this.lockedWrap.dom.firstChild);this.lockedBody=new E(this.lockedWrap.dom.childNodes[1]);this.mainWrap=new E(cs[3]);this.mainHd=new E(this.mainWrap.dom.firstChild);this.mainBody=new E(this.mainWrap.dom.childNodes[1]);this.footerPanel=new E(cs[4]);this.footerPanel.enableDisplayMode("block");this.focusEl=new E(cs[5]);this.focusEl.swallowEvent("click",true);this.resizeProxy=new E(cs[6]);this.headerSelector=String.format('#{0} td.x-grid-hd, #{1} td.x-grid-hd',this.lockedHd.id,this.mainHd.id);this.splitterSelector=String.format('#{0} div.x-grid-split, #{1} div.x-grid-split',this.idToCssName(this.lockedHd.id),this.idToCssName(this.mainHd.id));},idToCssName:function(s){return s.replace(/[^a-z0-9]+/ig,'-');},getHeaderCell:function(N){return Roo.DomQuery.select(this.headerSelector)[N];},getHeaderCellMeasure:function(O){return this.getHeaderCell(O).firstChild;},getHeaderCellText:function(P){return this.getHeaderCell(P).firstChild.firstChild;},getLockedTable:function(){return this.lockedBody.dom.firstChild;},getBodyTable:function(){return this.mainBody.dom.firstChild;},getLockedRow:function(Q){return this.getLockedTable().rows[Q];},getRow:function(R){return this.getBodyTable().rows[R];},getRowComposite:function(S){if(!this.rowEl){this.rowEl=new Roo.CompositeElementLite();}var T=[],U,V;if(U=this.getLockedRow(S)){T.push(U);}if(V=this.getRow(S)){T.push(V);} -this.rowEl.elements=T;return this.rowEl;},getCell:function(W,X){var Y=this.cm.getLockedCount();var Z;if(X=this.ds.getCount()){return;} -AC=(AC!==undefined?AC:0);var cm=this.grid.colModel;while(cm.isHidden(AC)){AC++;}var el=this.getCell(AB,AC);if(!el){return;}var c=this.scroller.dom;var AE=parseInt(el.offsetTop,10);var AF=parseInt(el.offsetLeft,10);var AG=AE+el.offsetHeight;var AH=AF+el.offsetWidth;var ch=c.clientHeight-this.mainHd.dom.offsetHeight;var AI=parseInt(c.scrollTop,10);var AJ=parseInt(c.scrollLeft,10);var AK=AI+ch;var AL=AJ+c.clientWidth;if(AEAK){c.scrollTop=AG-ch;}if(AD!==false){if(AFAL){c.scrollLeft=AH-c.clientWidth;}}return el;},updateColumns:function(){this.grid.stopEditing();var cm=this.grid.colModel,AM=this.getColumnIds();var AN=0;for(var i=0,len=cm.getColumnCount();i
    ");B.master.disableformats=true;}if(!B.header){B.header=new Roo.Template('','{cells}',"
    {splits}");B.header.disableformats=true;} +B.header.compile();if(!B.hcell){B.hcell=new Roo.Template('
    ','
    {value}
    ',"
    ");B.hcell.disableFormats=true;} +B.hcell.compile();if(!B.hsplit){B.hsplit=new Roo.Template('
     
    ');B.hsplit.disableFormats=true;} +B.hsplit.compile();if(!B.body){B.body=new Roo.Template('',"{rows}","
    ");B.body.disableFormats=true;} +B.body.compile();if(!B.row){B.row=new Roo.Template('{cells}');B.row.disableFormats=true;} +B.row.compile();if(!B.cell){B.cell=new Roo.Template('','
    {value}
    ',"");B.cell.disableFormats=true;} +B.cell.compile();this.templates=B;},onColWidthChange:function(){this.updateColumns.apply(this,arguments);},onHeaderChange:function(){this.updateHeaders.apply(this,arguments);},onHiddenChange:function(){this.handleHiddenChange.apply(this,arguments);},onColumnMove:function(){this.handleColumnMove.apply(this,arguments);},onColumnLock:function(){this.handleLockChange.apply(this,arguments);},onDataChange:function(){this.refresh();this.updateHeaderSortState();},onClear:function(){this.refresh();},onUpdate:function(ds,A){this.refreshRow(A);},refreshRow:function(A){var ds=this.ds,B;if(typeof A=='number'){B=A;A=ds.getAt(B);}else {B=ds.indexOf(A);} +this.insertRows(ds,B,B,true);this.onRemove(ds,A,B+1,true);this.syncRowHeights(B,B);this.layout();this.fireEvent("rowupdated",this,B,A);},onAdd:function(ds,A,B){this.insertRows(ds,B,B+(A.length-1));},onRemove:function(ds,A,B,C){if(C!==true){this.fireEvent("beforerowremoved",this,B,A);}var bt=this.getBodyTable(),lt=this.getLockedTable();if(bt.rows[B]){bt.firstChild.removeChild(bt.rows[B]);}if(lt.rows[B]){lt.firstChild.removeChild(lt.rows[B]);}if(C!==true){this.stripeRows(B);this.syncRowHeights(B,B);this.layout();this.fireEvent("rowremoved",this,B,A);}},onLoad:function(){this.scrollToTop();},scrollToTop:function(){if(this.scroller){this.scroller.dom.scrollTop=0;this.syncScroll();}},getHeaderPanel:function(A){if(A){this.headerPanel.show();}return this.headerPanel;},getFooterPanel:function(A){if(A){this.footerPanel.show();}return this.footerPanel;},initElements:function(){var E=Roo.Element;var el=this.grid.getGridEl().dom.firstChild;var cs=el.childNodes;this.el=new E(el);this.headerPanel=new E(el.firstChild);this.headerPanel.enableDisplayMode("block");this.scroller=new E(cs[1]);this.scrollSizer=new E(this.scroller.dom.firstChild);this.lockedWrap=new E(cs[2]);this.lockedHd=new E(this.lockedWrap.dom.firstChild);this.lockedBody=new E(this.lockedWrap.dom.childNodes[1]);this.mainWrap=new E(cs[3]);this.mainHd=new E(this.mainWrap.dom.firstChild);this.mainBody=new E(this.mainWrap.dom.childNodes[1]);this.footerPanel=new E(cs[4]);this.footerPanel.enableDisplayMode("block");this.focusEl=new E(cs[5]);this.focusEl.swallowEvent("click",true);this.resizeProxy=new E(cs[6]);this.headerSelector=String.format('#{0} td.x-grid-hd, #{1} td.x-grid-hd',this.lockedHd.id,this.mainHd.id);this.splitterSelector=String.format('#{0} div.x-grid-split, #{1} div.x-grid-split',this.idToCssName(this.lockedHd.id),this.idToCssName(this.mainHd.id));},idToCssName:function(s){return s.replace(/[^a-z0-9]+/ig,'-');},getHeaderCell:function(A){return Roo.DomQuery.select(this.headerSelector)[A];},getHeaderCellMeasure:function(A){return this.getHeaderCell(A).firstChild;},getHeaderCellText:function(A){return this.getHeaderCell(A).firstChild.firstChild;},getLockedTable:function(){return this.lockedBody.dom.firstChild;},getBodyTable:function(){return this.mainBody.dom.firstChild;},getLockedRow:function(A){return this.getLockedTable().rows[A];},getRow:function(A){return this.getBodyTable().rows[A];},getRowComposite:function(A){if(!this.rowEl){this.rowEl=new Roo.CompositeElementLite();}var B=[],C,D;if(C=this.getLockedRow(A)){B.push(C);}if(D=this.getRow(A)){B.push(D);} +this.rowEl.elements=B;return this.rowEl;},getCell:function(A,B){var C=this.cm.getLockedCount();var D;if(B=this.ds.getCount()){return;} +B=(B!==undefined?B:0);var cm=this.grid.colModel;while(cm.isHidden(B)){B++;}var el=this.getCell(A,B);if(!el){return;}var c=this.scroller.dom;var D=parseInt(el.offsetTop,10);var E=parseInt(el.offsetLeft,10);var F=D+el.offsetHeight;var G=E+el.offsetWidth;var ch=c.clientHeight-this.mainHd.dom.offsetHeight;var H=parseInt(c.scrollTop,10);var I=parseInt(c.scrollLeft,10);var J=H+ch;var K=I+c.clientWidth;if(DJ){c.scrollTop=F-ch;}if(C!==false){if(EK){c.scrollLeft=G-c.clientWidth;}}return el;},updateColumns:function(){this.grid.stopEditing();var cm=this.grid.colModel,A=this.getColumnIds();var B=0;for(var i=0,len=cm.getColumnCount();i
    ';return x.firstChild.firstChild.firstChild.firstChild;};Roo.TabPanel.prototype.createBody=function(y){var z=document.createElement("div");Roo.id(z,"tab-body");Roo.fly(z).addClass("x-tabs-body");y.appendChild(z);return z;};Roo.TabPanel.prototype.createItemBody=function(AA,id){var AB=Roo.getDom(id);if(!AB){AB=document.createElement("div");AB.id=id;} -Roo.fly(AB).addClass("x-tabs-item-body");AA.insertBefore(AB,AA.firstChild);return AB;};Roo.TabPanel.prototype.createStripElements=function(AC,AD,AE){var td=document.createElement("td");AC.appendChild(td);if(AE){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Roo.Template(''+'{text}'+'
     
    ');}var el=this.closeTpl.overwrite(td,{"text":AD});var close=el.getElementsByTagName("div")[0];var inner=el.getElementsByTagName("em")[0];return {"el":el,"close":close,"inner":inner};}else {if(!this.tabTpl){this.tabTpl=new Roo.Template(''+'{text}');}var el=this.tabTpl.overwrite(td,{"text":AD});var inner=el.getElementsByTagName("em")[0];return {"el":el,"inner":inner};}}; +this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else {this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(A){var B=A-this.pnode.getPadding("lr");this.inner.setWidth(B);this.textEl.setWidth(B-this.inner.getPadding("lr"));this.pnode.setWidth(A);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"));},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);} +this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var updater=this.bodyEl.getUpdateManager();updater.update(A,B,this._setLoaded.createDelegate(this));}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);}},closeText:"Close this tab"});Roo.TabPanel.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B;};Roo.TabPanel.prototype.createStripList=function(A){A.innerHTML='
    ';return A.firstChild.firstChild.firstChild.firstChild;};Roo.TabPanel.prototype.createBody=function(A){var B=document.createElement("div");Roo.id(B,"tab-body");Roo.fly(B).addClass("x-tabs-body");A.appendChild(B);return B;};Roo.TabPanel.prototype.createItemBody=function(A,id){var B=Roo.getDom(id);if(!B){B=document.createElement("div");B.id=id;} +Roo.fly(B).addClass("x-tabs-item-body");A.insertBefore(B,A.firstChild);return B;};Roo.TabPanel.prototype.createStripElements=function(A,B,C){var td=document.createElement("td");A.appendChild(td);if(C){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Roo.Template(''+'{text}'+'
     
    ');}var el=this.closeTpl.overwrite(td,{"text":B});var close=el.getElementsByTagName("div")[0];var inner=el.getElementsByTagName("em")[0];return {"el":el,"close":close,"inner":inner};}else {if(!this.tabTpl){this.tabTpl=new Roo.Template(''+'{text}');}var el=this.tabTpl.overwrite(td,{"text":B});var inner=el.getElementsByTagName("em")[0];return {"el":el,"inner":inner};}}; Roo.Button=function(A,B){if(!B){B=A;A=B.renderTo||false;} Roo.apply(this,B);this.addEvents({"click":true,"toggle":true,'mouseover':true,'mouseout':true,'render':true});if(this.menu){this.menu=Roo.menu.MenuMgr.get(this.menu);}if(A){this.render(A);} -Roo.util.Observable.call(this);};Roo.extend(Roo.Button,Roo.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:'button',menuClassTarget:'tr',clickEvent:'click',handleMouseEvents:true,tooltipType:'qtip',render:function(C){var D;if(this.hideParent){this.parentEl=Roo.get(C);}if(!this.dhconfig){if(!this.template){if(!Roo.Button.buttonTemplate){Roo.Button.buttonTemplate=new Roo.Template('','',"
      
    ");} +Roo.util.Observable.call(this);};Roo.extend(Roo.Button,Roo.util.Observable,{hidden:false,disabled:false,pressed:false,tabIndex:undefined,enableToggle:false,menu:undefined,menuAlign:"tl-bl?",iconCls:undefined,type:'button',menuClassTarget:'tr',clickEvent:'click',handleMouseEvents:true,tooltipType:'qtip',render:function(A){var B;if(this.hideParent){this.parentEl=Roo.get(A);}if(!this.dhconfig){if(!this.template){if(!Roo.Button.buttonTemplate){Roo.Button.buttonTemplate=new Roo.Template('','',"
      
    ");} this.template=Roo.Button.buttonTemplate;} -D=this.template.append(C,[this.text||' ',this.type],true);var btnEl=D.child("button:first");btnEl.on('focus',this.onFocus,this);btnEl.on('blur',this.onBlur,this);if(this.cls){D.addClass(this.cls);}if(this.icon){btnEl.setStyle('background-image','url('+this.icon+')');}if(this.iconCls){btnEl.addClass(this.iconCls);if(!this.cls){D.addClass(this.text?'x-btn-text-icon':'x-btn-icon');}}if(this.tabIndex!==undefined){btnEl.dom.tabIndex=this.tabIndex;}if(this.tooltip){if(typeof this.tooltip=='object'){Roo.QuickTips.tips(Roo.apply({target:btnEl.id},this.tooltip));}else {btnEl.dom[this.tooltipType]=this.tooltip;}}}else {D=Roo.DomHelper.append(Roo.get(C).dom,this.dhconfig,true);} -this.el=D;if(this.id){this.el.dom.id=this.el.id=this.id;}if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);} -D.addClass("x-btn");if(Roo.isIE&&!Roo.isIE7){this.autoWidth.defer(1,this);}else {this.autoWidth();}if(this.handleMouseEvents){D.on("mouseover",this.onMouseOver,this);D.on("mouseout",this.onMouseOut,this);D.on("mousedown",this.onMouseDown,this);} -D.on(this.clickEvent,this.onClick,this);if(this.hidden){this.hide();}if(this.disabled){this.disable();} -Roo.ButtonToggleMgr.register(this);if(this.pressed){this.el.addClass("x-btn-pressed");}if(this.repeat){var repeater=new Roo.util.ClickRepeater(D,typeof this.repeat=="object"?this.repeat:{});repeater.on("click",this.onClick,this);} -this.fireEvent('render',this);},getEl:function(){return this.el;},destroy:function(){Roo.ButtonToggleMgr.unregister(this);this.el.removeAllListeners();this.purgeListeners();this.el.remove();},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Roo.isIE7&&Roo.isStrict){var ib=this.el.child('button');if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Roo.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth('lr'));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if(this.el.getWidth()20){ib.clip();ib.setWidth(Roo.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth('lr'));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if(this.el.getWidth()','','',"
     
    ",'','',"
     
    ");var E=D.append(C,[this.text,this.type],true);var F=E.child("button");if(this.cls){E.addClass(this.cls);}if(this.icon){F.setStyle('background-image','url('+this.icon+')');}if(this.iconCls){F.addClass(this.iconCls);if(!this.cls){E.addClass(this.text?'x-btn-text-icon':'x-btn-icon');}} -this.el=E;if(this.handleMouseEvents){E.on("mouseover",this.onMouseOver,this);E.on("mouseout",this.onMouseOut,this);E.on("mousedown",this.onMouseDown,this);E.on("mouseup",this.onMouseUp,this);} -E.on(this.clickEvent,this.onClick,this);if(this.tooltip){if(typeof this.tooltip=='object'){Roo.QuickTips.tips(Roo.apply({target:F.id},this.tooltip));}else {F.dom[this.tooltipType]=this.tooltip;}}if(this.arrowTooltip){E.child("button:nth(2)").dom[this.tooltipType]=this.arrowTooltip;}if(this.hidden){this.hide();}if(this.disabled){this.disable();}if(this.pressed){this.el.addClass("x-btn-pressed");}if(Roo.isIE&&!Roo.isIE7){this.autoWidth.defer(1,this);}else {this.autoWidth();}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);} +this.fireEvent("click",this,e);if(this.handler){this.el.removeClass("x-btn-over");this.handler.call(this.scope||this,this,e);}}},onMouseOver:function(e){if(!this.disabled){this.el.addClass("x-btn-over");this.fireEvent('mouseover',this,e);}},onMouseOut:function(e){if(!e.within(this.el,true)){this.el.removeClass("x-btn-over");this.fireEvent('mouseout',this,e);}},onFocus:function(e){if(!this.disabled){this.el.addClass("x-btn-focus");}},onBlur:function(e){this.el.removeClass("x-btn-focus");},onMouseDown:function(e){if(!this.disabled&&e.button==0){this.el.addClass("x-btn-click");Roo.get(document).on('mouseup',this.onMouseUp,this);}},onMouseUp:function(e){if(e.button==0){this.el.removeClass("x-btn-click");Roo.get(document).un('mouseup',this.onMouseUp,this);}},onMenuShow:function(e){this.el.addClass("x-btn-menu-active");},onMenuHide:function(e){this.el.removeClass("x-btn-menu-active");}});Roo.ButtonToggleMgr=function(){var A={};function B(C,D){if(D){var g=A[C.toggleGroup];for(var i=0,l=g.length;i','','',"
     
    ",'','',"
     
    ");var C=B.append(A,[this.text,this.type],true);var D=C.child("button");if(this.cls){C.addClass(this.cls);}if(this.icon){D.setStyle('background-image','url('+this.icon+')');}if(this.iconCls){D.addClass(this.iconCls);if(!this.cls){C.addClass(this.text?'x-btn-text-icon':'x-btn-icon');}} +this.el=C;if(this.handleMouseEvents){C.on("mouseover",this.onMouseOver,this);C.on("mouseout",this.onMouseOut,this);C.on("mousedown",this.onMouseDown,this);C.on("mouseup",this.onMouseUp,this);} +C.on(this.clickEvent,this.onClick,this);if(this.tooltip){if(typeof this.tooltip=='object'){Roo.QuickTips.tips(Roo.apply({target:D.id},this.tooltip));}else {D.dom[this.tooltipType]=this.tooltip;}}if(this.arrowTooltip){C.child("button:nth(2)").dom[this.tooltipType]=this.arrowTooltip;}if(this.hidden){this.hide();}if(this.disabled){this.disable();}if(this.pressed){this.el.addClass("x-btn-pressed");}if(Roo.isIE&&!Roo.isIE7){this.autoWidth.defer(1,this);}else {this.autoWidth();}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);} this.fireEvent('render',this);},autoWidth:function(){if(this.el){var tbl=this.el.child("table:first");var tbl2=this.el.child("table:last");this.el.setWidth("auto");tbl.setWidth("auto");if(Roo.isIE7&&Roo.isStrict){var ib=this.el.child('button:first');if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Roo.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth('lr'));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if((tbl.getWidth()+tbl2.getWidth())
    ');this.tr=this.el.child("tr",true);var E=0;this.items=new Roo.util.MixedCollection(false,function(o){return o.id||("item"+(++E));});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons;}},add:function(){var a=arguments,l=a.length;for(var i=0;i"){return this.addFill();}return this.addText(el);}if(el.tagName){return this.addElement(el);}if(typeof el=="object"){return this.addButton(el);}return false;},addxtype:function(e){return this.add(e);},getEl:function(){return this.el;},addSeparator:function(){return this.addItem(new Roo.Toolbar.Separator());},addSpacer:function(){return this.addItem(new Roo.Toolbar.Spacer());},addFill:function(){return this.addItem(new Roo.Toolbar.Fill());},addElement:function(el){return this.addItem(new Roo.Toolbar.Item(el));},items:false,addItem:function(F){var td=this.nextBlock();F.render(td);this.items.add(F);return F;},addButton:function(G){if(G instanceof Array){var B=[];for(var i=0,len=G.length;i
    ');this.tr=this.el.child("tr",true);var A=0;this.items=new Roo.util.MixedCollection(false,function(o){return o.id||("item"+(++A));});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons;}},add:function(){var a=arguments,l=a.length;for(var i=0;i"){return this.addFill();}return this.addText(el);}if(el.tagName){return this.addElement(el);}if(typeof el=="object"){return this.addButton(el);}return false;},addxtype:function(e){return this.add(e);},getEl:function(){return this.el;},addSeparator:function(){return this.addItem(new Roo.Toolbar.Separator());},addSpacer:function(){return this.addItem(new Roo.Toolbar.Spacer());},addFill:function(){return this.addItem(new Roo.Toolbar.Fill());},addElement:function(el){return this.addItem(new Roo.Toolbar.Item(el));},items:false,addItem:function(A){var td=this.nextBlock();A.render(td);this.items.add(A);return A;},addButton:function(A){if(A instanceof Array){var buttons=[];for(var i=0,len=A.length;i=1&parseInt(v,10)+increment<=d.pages){this.field.dom.value=parseInt(v,10)+increment;pageNum=Math.min(Math.max(1,pageNum+increment),d.pages)-1;this.ds.load({params:{start:pageNum*this.pageSize,limit:this.pageSize}});} -e.stopEvent();}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(C){var ds=this.ds;switch(C){case "first":ds.load({params:{start:0,limit:this.pageSize}});break;case "prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case "next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case "last":var B=ds.getTotalCount();var extra=B%this.pageSize;var lastStart=extra?(B-extra):B-this.pageSize;ds.load({params:{start:lastStart,limit:this.pageSize}});break;case "refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}});break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);ds.un("remove",this.updateInfo,this);ds.un("add",this.updateInfo,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);ds.on("remove",this.updateInfo,this);ds.on("add",this.updateInfo,this);this.ds=ds;}}); +e.stopEvent();}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(A){var ds=this.ds;switch(A){case "first":ds.load({params:{start:0,limit:this.pageSize}});break;case "prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case "next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case "last":var total=ds.getTotalCount();var extra=total%this.pageSize;var lastStart=extra?(total-extra):total-this.pageSize;ds.load({params:{start:lastStart,limit:this.pageSize}});break;case "refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}});break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);ds.un("remove",this.updateInfo,this);ds.un("add",this.updateInfo,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);ds.on("remove",this.updateInfo,this);ds.on("add",this.updateInfo,this);this.ds=ds;}}); Roo.Resizable=function(el,A){this.el=Roo.get(el);if(A&&A.wrap){A.resizeChild=this.el;this.el=this.el.wrap(typeof A.wrap=="object"?A.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=A.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(A.resizeChild.getPositioning());A.resizeChild.clearPositioning();if(!A.width||!A.height){var csize=A.resizeChild.getSize();this.el.setSize(csize.width,csize.height);}if(A.pinned&&!A.adjustments){A.adjustments="auto";}} this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"});this.proxy.unselectable();this.proxy.enableDisplayMode('block');Roo.apply(this,A);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned");}var B=this.el.getStyle("position");if(B!="absolute"&&B!="fixed"){this.el.setStyle("position","relative");}if(!this.handles){this.handles='s,e,se';if(this.multiDirectional){this.handles+=',n,w';}}if(this.handles=="all"){this.handles="n s e w ne nw se sw";}var hs=this.handles.split(/\s*?[,;]\s*?| /);var ps=Roo.Resizable.positions;for(var i=0,len=hs.length;i0){if(m>(I/2)){K=H+(I-m);}else {K=H-m;}}return Math.max(J,K);},resizeElement:function(){var L=this.proxy.getBox();if(this.updateBox){this.el.setBox(L,false,this.animate,this.duration,null,this.easing);}else {this.el.setSize(L.width,L.height,this.animate,this.duration,null,this.easing);} -this.updateChildSize();if(!this.dynamic){this.proxy.hide();}return L;},constrain:function(v,M,m,mx){if(v-Mmx){M=mx-v;}return M;},onMouseMove:function(e){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(e.getPoint())){return;}var curSize=this.curSize||this.startBox;var x=this.startBox.x,y=this.startBox.y;var ox=x,oy=y;var w=curSize.width,h=curSize.height;var ow=w,oh=h;var mw=this.minWidth,mh=this.minHeight;var mxw=this.maxWidth,mxh=this.maxHeight;var wi=this.widthIncrement;var hi=this.heightIncrement;var eventXY=e.getXY();var diffX=-(this.startPoint[0]-Math.max(this.minX,eventXY[0]));var diffY=-(this.startPoint[1]-Math.max(this.minY,eventXY[1]));var pos=this.activeHandle.position;switch(pos){case "east":w+=diffX;w=Math.min(Math.max(mw,w),mxw);break;case "south":h+=diffY;h=Math.min(Math.max(mh,h),mxh);break;case "southeast":w+=diffX;h+=diffY;w=Math.min(Math.max(mw,w),mxw);h=Math.min(Math.max(mh,h),mxh);break;case "north":diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "west":diffX=this.constrain(w,diffX,mw,mxw);x+=diffX;w-=diffX;break;case "northeast":w+=diffX;w=Math.min(Math.max(mw,w),mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "northwest":diffX=this.constrain(w,diffX,mw,mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;x+=diffX;w-=diffX;break;case "southwest":diffX=this.constrain(w,diffX,mw,mxw);h+=diffY;h=Math.min(Math.max(mh,h),mxh);x+=diffX;w-=diffX;break;}var sw=this.snap(w,wi,mw);var sh=this.snap(h,hi,mh);if(sw!=w||sh!=h){switch(pos){case "northeast":y-=sh-h;break;case "north":y-=sh-h;break;case "southwest":x-=sw-w;break;case "west":x-=sw-w;break;case "northwest":x-=sw-w;y-=sh-h;break;} +Roo.Resizable.superclass.constructor.call(this);};Roo.extend(Roo.Resizable,Roo.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:'easeOutStrong',widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,constrainTo:undefined,resizeRegion:undefined,resizeTo:function(A,B){this.el.setSize(A,B);this.updateChildSize();this.fireEvent("resize",this,A,B,null);},startSizing:function(e,A){this.fireEvent("beforeresize",this,e);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:" "});this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this);} +this.overlay.setStyle("cursor",A.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=e.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var ct=Roo.get(this.constrainTo);this.resizeRegion=ct.getRegion().adjust(ct.getFrameWidth('t'),ct.getFrameWidth('l'),-ct.getFrameWidth('b'),-ct.getFrameWidth('r'));} +this.proxy.setStyle('visibility','hidden');this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle('visibility','visible');}}},onMouseDown:function(A,e){if(this.enabled){e.stopEvent();this.activeHandle=A;this.startSizing(e,A);}},onMouseUp:function(e){var A=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,A.width,A.height,e);},updateChildSize:function(){if(this.resizeChild){var el=this.el;var child=this.resizeChild;var adj=this.adjustments;if(el.dom.offsetWidth){var b=el.getSize(true);child.setSize(b.width+adj[0],b.height+adj[1]);}if(Roo.isIE){setTimeout(function(){if(el.dom.offsetWidth){var b=el.getSize(true);child.setSize(b.width+adj[0],b.height+adj[1]);}},10);}}},snap:function(A,B,C){if(!B||!A)return A;var D=A;var m=A%B;if(m>0){if(m>(B/2)){D=A+(B-m);}else {D=A-m;}}return Math.max(C,D);},resizeElement:function(){var A=this.proxy.getBox();if(this.updateBox){this.el.setBox(A,false,this.animate,this.duration,null,this.easing);}else {this.el.setSize(A.width,A.height,this.animate,this.duration,null,this.easing);} +this.updateChildSize();if(!this.dynamic){this.proxy.hide();}return A;},constrain:function(v,A,m,mx){if(v-Amx){A=mx-v;}return A;},onMouseMove:function(e){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(e.getPoint())){return;}var curSize=this.curSize||this.startBox;var x=this.startBox.x,y=this.startBox.y;var ox=x,oy=y;var w=curSize.width,h=curSize.height;var ow=w,oh=h;var mw=this.minWidth,mh=this.minHeight;var mxw=this.maxWidth,mxh=this.maxHeight;var wi=this.widthIncrement;var hi=this.heightIncrement;var eventXY=e.getXY();var diffX=-(this.startPoint[0]-Math.max(this.minX,eventXY[0]));var diffY=-(this.startPoint[1]-Math.max(this.minY,eventXY[1]));var pos=this.activeHandle.position;switch(pos){case "east":w+=diffX;w=Math.min(Math.max(mw,w),mxw);break;case "south":h+=diffY;h=Math.min(Math.max(mh,h),mxh);break;case "southeast":w+=diffX;h+=diffY;w=Math.min(Math.max(mw,w),mxw);h=Math.min(Math.max(mh,h),mxh);break;case "north":diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "west":diffX=this.constrain(w,diffX,mw,mxw);x+=diffX;w-=diffX;break;case "northeast":w+=diffX;w=Math.min(Math.max(mw,w),mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case "northwest":diffX=this.constrain(w,diffX,mw,mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;x+=diffX;w-=diffX;break;case "southwest":diffX=this.constrain(w,diffX,mw,mxw);h+=diffY;h=Math.min(Math.max(mh,h),mxh);x+=diffX;w-=diffX;break;}var sw=this.snap(w,wi,mw);var sh=this.snap(h,hi,mh);if(sw!=w||sh!=h){switch(pos){case "northeast":y-=sh-h;break;case "north":y-=sh-h;break;case "southwest":x-=sw-w;break;case "west":x-=sw-w;break;case "northwest":x-=sw-w;y-=sh-h;break;} w=sw;h=sh;}if(this.preserveRatio){switch(pos){case "southeast":case "east":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);break;case "south":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case "northeast":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case "north":var tw=w;w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);x+=(tw-w)/2;break;case "southwest":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);var tw=w;w=ow*(h/oh);x+=tw-w;break;case "west":var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);y+=(th-h)/2;var tw=w;w=ow*(h/oh);x+=tw-w;break;case "northwest":var tw=w;var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);y+=th-h;x+=tw-w;break;}} -this.proxy.setBounds(x,y,w,h);if(this.dynamic){this.resizeElement();}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over");}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over");}},getEl:function(){return this.el;},getResizeChild:function(){return this.resizeChild;},destroy:function(N){this.proxy.remove();if(this.overlay){this.overlay.removeAllListeners();this.overlay.remove();}var ps=Roo.Resizable.positions;for(var k in ps){if(typeof ps[k]!="function"&&this[ps[k]]){var h=this[ps[k]];h.el.removeAllListeners();h.el.remove();}}if(N){this.el.update("");this.el.remove();}}});Roo.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Roo.Resizable.Handle=function(rz,O,P,Q){if(!this.tpl){var tpl=Roo.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});tpl.compile();Roo.Resizable.Handle.prototype.tpl=tpl;} -this.position=O;this.rz=rz;this.el=this.tpl.append(rz.el.dom,[this.position],true);this.el.unselectable();if(Q){this.el.setOpacity(0);} -this.el.on("mousedown",this.onMouseDown,this);if(!P){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);}};Roo.Resizable.Handle.prototype={afterResize:function(rz){},onMouseDown:function(e){this.rz.onMouseDown(this,e);},onMouseOver:function(e){this.rz.handleOver(this,e);},onMouseOut:function(e){this.rz.handleOut(this,e);}}; -Roo.Editor=function(A,B){Roo.Editor.superclass.constructor.call(this,B);this.field=A;this.addEvents({"beforestartedit":true,"startedit":true,"beforecomplete":true,"complete":true,"specialkey":true});};Roo.extend(Roo.Editor,Roo.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,completeOnEnter:false,cancelOnEsc:false,updateEl:false,onRender:function(ct,C){this.el=new Roo.Layer({shadow:this.shadow,cls:"x-editor",parentEl:ct,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Roo.isGecko?"auto":"hidden");if(this.field.msgTarget!='title'){this.field.msgTarget='qtip';} +this.proxy.setBounds(x,y,w,h);if(this.dynamic){this.resizeElement();}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over");}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over");}},getEl:function(){return this.el;},getResizeChild:function(){return this.resizeChild;},destroy:function(A){this.proxy.remove();if(this.overlay){this.overlay.removeAllListeners();this.overlay.remove();}var ps=Roo.Resizable.positions;for(var k in ps){if(typeof ps[k]!="function"&&this[ps[k]]){var h=this[ps[k]];h.el.removeAllListeners();h.el.remove();}}if(A){this.el.update("");this.el.remove();}}});Roo.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Roo.Resizable.Handle=function(rz,A,B,C){if(!this.tpl){var tpl=Roo.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});tpl.compile();Roo.Resizable.Handle.prototype.tpl=tpl;} +this.position=A;this.rz=rz;this.el=this.tpl.append(rz.el.dom,[this.position],true);this.el.unselectable();if(C){this.el.setOpacity(0);} +this.el.on("mousedown",this.onMouseDown,this);if(!B){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);}};Roo.Resizable.Handle.prototype={afterResize:function(rz){},onMouseDown:function(e){this.rz.onMouseDown(this,e);},onMouseOver:function(e){this.rz.handleOver(this,e);},onMouseOut:function(e){this.rz.handleOut(this,e);}}; +Roo.Editor=function(A,B){Roo.Editor.superclass.constructor.call(this,B);this.field=A;this.addEvents({"beforestartedit":true,"startedit":true,"beforecomplete":true,"complete":true,"specialkey":true});};Roo.extend(Roo.Editor,Roo.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,completeOnEnter:false,cancelOnEsc:false,updateEl:false,onRender:function(ct,A){this.el=new Roo.Layer({shadow:this.shadow,cls:"x-editor",parentEl:ct,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Roo.isGecko?"auto":"hidden");if(this.field.msgTarget!='title'){this.field.msgTarget='qtip';} this.field.render(this.el);if(Roo.isGecko){this.field.el.dom.setAttribute('autocomplete','off');} this.field.on("specialkey",this.onSpecialKey,this);if(this.swallowKeys){this.field.el.swallowEvent(['keydown','keypress']);} -this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1});}},onSpecialKey:function(D,e){if(this.completeOnEnter&&e.getKey()==e.ENTER){e.stopEvent();this.completeEdit();}else if(this.cancelOnEsc&&e.getKey()==e.ESC){this.cancelEdit();}else {this.fireEvent('specialkey',D,e);}},startEdit:function(el,E){if(this.editing){this.completeEdit();} -this.boundEl=Roo.get(el);var v=E!==undefined?E:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body);}if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){return;} +this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1});}},onSpecialKey:function(A,e){if(this.completeOnEnter&&e.getKey()==e.ENTER){e.stopEvent();this.completeEdit();}else if(this.cancelOnEsc&&e.getKey()==e.ESC){this.cancelEdit();}else {this.fireEvent('specialkey',A,e);}},startEdit:function(el,A){if(this.editing){this.completeEdit();} +this.boundEl=Roo.get(el);var v=A!==undefined?A:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body);}if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){return;} this.startValue=v;this.field.setValue(v);if(this.autoSize){var sz=this.boundEl.getSize();switch(this.autoSize){case "width":this.setSize(sz.width,"");break;case "height":this.setSize("",sz.height);break;default:this.setSize(sz.width,sz.height);}} this.el.alignTo(this.boundEl,this.alignment);this.editing=true;if(Roo.QuickTips){Roo.QuickTips.disable();} -this.show();},setSize:function(w,h){this.field.setSize(w,h);if(this.el){this.el.sync();}},realign:function(){this.el.alignTo(this.boundEl,this.alignment);},completeEdit:function(F){if(!this.editing){return;}var v=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){v=this.startValue;this.cancelEdit(true);}if(String(v)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return;}if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(v);}if(F!==true){this.hide();} +this.show();},setSize:function(w,h){this.field.setSize(w,h);if(this.el){this.el.sync();}},realign:function(){this.el.alignTo(this.boundEl,this.alignment);},completeEdit:function(A){if(!this.editing){return;}var v=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){v=this.startValue;this.cancelEdit(true);}if(String(v)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return;}if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(v);}if(A!==true){this.hide();} this.fireEvent("complete",this,v,this.startValue);}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide();} this.field.show();if(Roo.isIE&&!this.fixIEFocus){this.fixIEFocus=true;this.deferredFocus.defer(50,this);}else {this.field.focus();} -this.fireEvent("startedit",this.boundEl,this.startValue);},deferredFocus:function(){if(this.editing){this.field.focus();}},cancelEdit:function(G){if(this.editing){this.setValue(this.startValue);if(G!==true){this.hide();}}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit();}},onHide:function(){if(this.editing){this.completeEdit();return;} +this.fireEvent("startedit",this.boundEl,this.startValue);},deferredFocus:function(){if(this.editing){this.field.focus();}},cancelEdit:function(A){if(this.editing){this.setValue(this.startValue);if(A!==true){this.hide();}}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit();}},onHide:function(){if(this.editing){this.completeEdit();return;} this.field.blur();if(this.field.collapse){this.field.collapse();} this.el.hide();if(this.hideEl!==false){this.boundEl.show();}if(Roo.QuickTips){Roo.QuickTips.enable();}},setValue:function(v){this.field.setValue(v);},getValue:function(){return this.field.getValue();}}); Roo.BasicDialog=function(el,A){this.el=Roo.get(el);var dh=Roo.DomHelper;if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=el;} @@ -254,34 +254,34 @@ this.focusEl=el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1"}); this.bg=this.el.createChild({tag:"div",cls:"x-dlg-bg",html:'
     
    '});this.centerBg=this.bg.child("div.x-dlg-bg-center");if(this.autoScroll!==false&&!this.autoTabs){this.body.setStyle("overflow","auto");} this.toolbox=this.el.createChild({cls:"x-dlg-toolbox"});if(this.closable!==false){this.el.addClass("x-dlg-closable");this.close=this.toolbox.createChild({cls:"x-dlg-close"});this.close.on("click",this.closeClick,this);this.close.addClassOnOver("x-dlg-close-over");}if(this.collapsible!==false){this.collapseBtn=this.toolbox.createChild({cls:"x-dlg-collapse"});this.collapseBtn.on("click",this.collapseClick,this);this.collapseBtn.addClassOnOver("x-dlg-collapse-over");this.header.on("dblclick",this.collapseClick,this);}if(this.resizable!==false){this.el.addClass("x-dlg-resizable");this.resizer=new Roo.Resizable(el,{minWidth:this.minWidth||80,minHeight:this.minHeight||80,handles:this.resizeHandles||"all",pinned:true});this.resizer.on("beforeresize",this.beforeResize,this);this.resizer.on("resize",this.onResize,this);}if(this.draggable!==false){el.addClass("x-dlg-draggable");if(!this.proxyDrag){var dd=new Roo.dd.DD(el.dom.id,"WindowDrag");}else {var dd=new Roo.dd.DDProxy(el.dom.id,"WindowDrag",{dragElId:this.proxy.id});} dd.setHandleElId(this.header.id);dd.endDrag=this.endMove.createDelegate(this);dd.startDrag=this.startMove.createDelegate(this);dd.onDrag=this.onDrag.createDelegate(this);dd.scroll=false;this.dd=dd;}if(this.modal){this.mask=dh.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);this.mask.enableDisplayMode("block");this.mask.hide();this.el.addClass("x-dlg-modal");}if(this.shadow){this.shadow=new Roo.Shadow({mode:typeof this.shadow=="string"?this.shadow:"sides",offset:this.shadowOffset});}else {this.shadowOffset=0;}if(Roo.useShims&&this.shim!==false){this.shim=this.el.createShim();this.shim.hide=this.hideAction;this.shim.hide();}else {this.shim=false;}if(this.autoTabs){this.initTabs();}if(this.buttons){var bts=this.buttons;this.buttons=[];Roo.each(bts,function(b){this.addButton(b);},this);} -this.addEvents({"keydown":true,"move":true,"resize":true,"beforehide":true,"hide":true,"beforeshow":true,"show":true});el.on("keydown",this.onKeyDown,this);el.on("mousedown",this.toFront,this);Roo.EventManager.onWindowResize(this.adjustViewport,this,true);this.el.hide();Roo.DialogManager.register(this);Roo.BasicDialog.superclass.constructor.call(this);};Roo.extend(Roo.BasicDialog,Roo.util.Observable,{shadowOffset:Roo.isIE?6:5,minHeight:80,minWidth:200,minButtonWidth:75,defaultButton:null,buttonAlign:"right",tabTag:'div',firstShow:true,setTitle:function(B){this.header.update(B);return this;},closeClick:function(){this.hide();},collapseClick:function(){this[this.collapsed?"expand":"collapse"]();},collapse:function(){if(!this.collapsed){this.collapsed=true;this.el.addClass("x-dlg-collapsed");this.restoreHeight=this.el.getHeight();this.resizeTo(this.el.getWidth(),this.header.getHeight());}},expand:function(){if(this.collapsed){this.collapsed=false;this.el.removeClass("x-dlg-collapsed");this.resizeTo(this.el.getWidth(),this.restoreHeight);}},initTabs:function(){var C=this.getTabs();while(C.getTab(0)){C.removeTab(0);} -this.el.select(this.tabTag+'.x-dlg-tab').each(function(el){var D=el.dom;C.addTab(Roo.id(D),D.title);D.title="";});C.activate(0);return C;},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getHeaderFooterHeight(true)+40);},onResize:function(){this.refreshSize();this.syncBodyHeight();this.adjustAssets();this.focus();this.fireEvent("resize",this,this.size.width,this.size.height);},onKeyDown:function(e){if(this.isVisible()){this.fireEvent("keydown",this,e);}},resizeTo:function(D,E){this.el.setSize(D,E);this.size={width:D,height:E};this.syncBodyHeight();if(this.fixedcenter){this.center();}if(this.isVisible()){this.constrainXY();this.adjustAssets();} -this.fireEvent("resize",this,D,E);return this;},setContentSize:function(w,h){h+=this.getHeaderFooterHeight()+this.body.getMargins("tb");w+=this.body.getMargins("lr")+this.bwrap.getMargins("lr")+this.centerBg.getPadding("lr");h+=this.body.getPadding("tb")+this.bwrap.getBorderWidth("tb")+this.body.getBorderWidth("tb")+this.el.getBorderWidth("tb");w+=this.body.getPadding("lr")+this.bwrap.getBorderWidth("lr")+this.body.getBorderWidth("lr")+this.bwrap.getPadding("lr")+this.el.getBorderWidth("lr");if(this.tabs){h+=this.tabs.stripWrap.getHeight()+this.tabs.bodyEl.getMargins("tb")+this.tabs.bodyEl.getPadding("tb");w+=this.tabs.bodyEl.getMargins("lr")+this.tabs.bodyEl.getPadding("lr");} -this.resizeTo(w,h);return this;},addKeyListener:function(F,fn,G){var H,I,J,K;if(typeof F=="object"&&!(F instanceof Array)){H=F["key"];I=F["shift"];J=F["ctrl"];K=F["alt"];}else {H=F;}var L=function(M,e){if((!I||e.shiftKey)&&(!J||e.ctrlKey)&&(!K||e.altKey)){var k=e.getKey();if(H instanceof Array){for(var i=0,len=H.length;i
    '},null,true);this.btnContainer=tb.firstChild.firstChild.firstChild;}var P={handler:N,scope:O,minWidth:this.minButtonWidth,hideParent:true};if(typeof M=="string"){P.text=M;}else {if(M.tag){P.dhconfig=M;}else {Roo.apply(P,M);}}var fc=false;if((typeof(P.position)!='undefined')&&P.positionvw+s.left){x=vw-w;moved=true;}if(y+h>vh+s.top){y=vh-h;moved=true;}if(x
    '},null,true);this.btnContainer=tb.firstChild.firstChild.firstChild;}var D={handler:B,scope:C,minWidth:this.minButtonWidth,hideParent:true};if(typeof A=="string"){D.text=A;}else {if(A.tag){D.dhconfig=A;}else {Roo.apply(D,A);}}var fc=false;if((typeof(D.position)!='undefined')&&D.positionvw+s.left){x=vw-w;moved=true;}if(y+h>vh+s.top){y=vh-h;moved=true;}if(x
     
    '});F=E.dom.firstChild;G=Roo.get(E.dom.childNodes[2]);G.enableDisplayMode();G.addKeyListener([10,13],function(){if(A.isVisible()&&B&&B.buttons){if(B.buttons.ok){M("ok");}else if(B.buttons.yes){M("yes");}}});H=Roo.get(E.dom.childNodes[3]);H.enableDisplayMode();I=Roo.get(E.dom.childNodes[4]);I.enableDisplayMode();var pf=I.dom.firstChild;if(pf){pp=Roo.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}}return A;},updateText:function(j){if(!A.isVisible()&&!B.width){A.resizeTo(this.maxWidth,100);} -F.innerHTML=j||' ';var w=Math.max(Math.min(B.width||F.offsetWidth,this.maxWidth),Math.max(B.minWidth||this.minWidth,L));if(B.prompt){K.setWidth(w);}if(A.isVisible()){A.fixedcenter=false;} -A.setContentSize(w,E.getHeight());if(A.isVisible()){A.fixedcenter=true;}return this;},updateProgress:function(l,m){if(m){this.updateText(m);}if(pp){pp.setWidth(Math.floor(l*I.dom.firstChild.offsetWidth));}return this;},isVisible:function(){return A&&A.isVisible();},hide:function(){if(this.isVisible()){A.hide();}},show:function(n){if(this.isVisible()){this.hide();}var d=this.getDialog();B=n;d.setTitle(B.title||" ");d.close.setDisplayed(B.closable!==false);K=G;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){G.hide();H.show();H.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);K=H;}else {G.show();H.hide();}}else {G.hide();H.hide();} +A.footer.dom.style.display='';for(var k in J){if(typeof J[k]!="function"){if(b[k]){J[k].show();J[k].setText(typeof b[k]=="string"?b[k]:Roo.MessageBox.buttonText[k]);Q+=J[k].el.getWidth()+15;}else {J[k].hide();}}}return Q;};var P=function(d,k,e){if(B&&B.closable!==false){A.hide();}if(e){e.stopEvent();}};return {getDialog:function(){if(!A){A=new Roo.BasicDialog("x-msg-box",{autoCreate:true,shadow:true,draggable:true,resizable:false,constraintoviewport:false,fixedcenter:true,collapsible:false,shim:true,modal:true,width:400,height:100,buttonAlign:"center",closeClick:function(){if(B&&B.buttons&&B.buttons.no&&!B.buttons.cancel){M("no");}else {M("cancel");}}});A.on("hide",N);C=A.mask;A.addKeyListener(27,P);J={};var bt=this.buttonText;J["ok"]=A.addButton(bt["ok"],M.createCallback("ok"));J["yes"]=A.addButton(bt["yes"],M.createCallback("yes"));J["no"]=A.addButton(bt["no"],M.createCallback("no"));J["cancel"]=A.addButton(bt["cancel"],M.createCallback("cancel"));E=A.body.createChild({html:'
     
    '});F=E.dom.firstChild;G=Roo.get(E.dom.childNodes[2]);G.enableDisplayMode();G.addKeyListener([10,13],function(){if(A.isVisible()&&B&&B.buttons){if(B.buttons.ok){M("ok");}else if(B.buttons.yes){M("yes");}}});H=Roo.get(E.dom.childNodes[3]);H.enableDisplayMode();I=Roo.get(E.dom.childNodes[4]);I.enableDisplayMode();var pf=I.dom.firstChild;if(pf){pp=Roo.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}}return A;},updateText:function(Q){if(!A.isVisible()&&!B.width){A.resizeTo(this.maxWidth,100);} +F.innerHTML=Q||' ';var w=Math.max(Math.min(B.width||F.offsetWidth,this.maxWidth),Math.max(B.minWidth||this.minWidth,L));if(B.prompt){K.setWidth(w);}if(A.isVisible()){A.fixedcenter=false;} +A.setContentSize(w,E.getHeight());if(A.isVisible()){A.fixedcenter=true;}return this;},updateProgress:function(Q,R){if(R){this.updateText(R);}if(pp){pp.setWidth(Math.floor(Q*I.dom.firstChild.offsetWidth));}return this;},isVisible:function(){return A&&A.isVisible();},hide:function(){if(this.isVisible()){A.hide();}},show:function(Q){if(this.isVisible()){this.hide();}var d=this.getDialog();B=Q;d.setTitle(B.title||" ");d.close.setDisplayed(B.closable!==false);K=G;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){G.hide();H.show();H.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);K=H;}else {G.show();H.hide();}}else {G.hide();H.hide();} I.setDisplayed(B.progress===true);this.updateProgress(0);K.dom.value=B.value||"";if(B.prompt){A.setDefaultButton(K);}else {var bs=B.buttons;var db=null;if(bs&&bs.ok){db=J["ok"];}else if(bs&&bs.yes){db=J["yes"];} A.setDefaultButton(db);} L=O(B.buttons);this.updateText(B.msg);if(B.cls){d.el.addClass(B.cls);} -d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(n.animEl);}return this;},progress:function(o,p){this.show({title:o,msg:p,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true});return this;},alert:function(q,r,fn,s){this.show({title:q,msg:r,buttons:this.OK,fn:fn,scope:s,modal:true});return this;},wait:function(t,u){this.show({title:u,msg:t,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this;},confirm:function(v,x,fn,y){this.show({title:v,msg:x,buttons:this.YESNO,fn:fn,scope:y,modal:true});return this;},prompt:function(z,AA,fn,AB,AC){this.show({title:z,msg:AA,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:AB,prompt:true,multiline:AC,modal:true});return this;},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Roo.Msg=Roo.MessageBox; +d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(Q.animEl);}return this;},progress:function(Q,R){this.show({title:Q,msg:R,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true});return this;},alert:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.OK,fn:fn,scope:S,modal:true});return this;},wait:function(Q,R){this.show({title:R,msg:Q,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this;},confirm:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.YESNO,fn:fn,scope:S,modal:true});return this;},prompt:function(Q,R,fn,S,T){this.show({title:Q,msg:R,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:S,prompt:true,multiline:T,modal:true});return this;},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Roo.Msg=Roo.MessageBox; Roo.QuickTips=function(){var el,A,B,C,tm,D,E,F={},esc,removeCls=null,bdLeft,bdRight;var ce,bd,xy,dd;var G=false,H=true,I=false;var J=1,K=1,L=1,M=[];var N=function(e){if(H){return;}var t=e.getTarget();if(!t||t.nodeType!==1||t==document||t==document.body){return;}if(ce&&t==ce.el){clearTimeout(K);return;}if(t&&F[t.id]){F[t.id].el=t;J=S.defer(tm.showDelay,tm,[F[t.id]]);return;}var W,et=Roo.fly(t);var ns=D.namespace;if(tm.interceptTitles&&t.title){W=t.title;t.qtip=W;t.removeAttribute("title");e.preventDefault();}else {W=t.qtip||et.getAttributeNS(ns,D.attribute);}if(W){J=S.defer(tm.showDelay,tm,[{el:t,text:W,width:et.getAttributeNS(ns,D.width),autoHide:et.getAttributeNS(ns,D.hide)!="user",title:et.getAttributeNS(ns,D.title),cls:et.getAttributeNS(ns,D.cls)}]);}};var O=function(e){clearTimeout(J);var t=e.getTarget();if(t&&ce&&ce.el==t&&(tm.autoHide&&ce.autoHide!==false)){K=setTimeout(U,tm.hideDelay);}};var P=function(e){if(H){return;} xy=e.getXY();xy[1]+=18;if(tm.trackMouse&&ce){el.setXY(xy);}};var Q=function(e){clearTimeout(J);clearTimeout(K);if(!e.within(el)){if(tm.hideOnClick){U();tm.disable();tm.enable.defer(100,tm);}}};var R=function(){return 2;};var S=function(o){if(H){return;} clearTimeout(L);ce=o;if(removeCls){el.removeClass(removeCls);removeCls=null;}if(ce.cls){el.addClass(ce.cls);removeCls=ce.cls;}if(ce.title){C.update(ce.title);C.show();}else {C.update('');C.hide();} @@ -289,272 +289,272 @@ el.dom.style.width=tm.maxWidth+'px';B.update(o.text);var p=R(),w=ce.width;if(!w) el.setWidth(parseInt(w,10)+p);if(ce.autoHide===false){E.setDisplayed(true);if(dd){dd.unlock();}}else {E.setDisplayed(false);if(dd){dd.lock();}}if(xy){el.avoidY=xy[1]-18;el.setXY(xy);}if(tm.animate){el.setOpacity(.1);el.setStyle("visibility","visible");el.fadeIn({callback:T});}else {T();}};var T=function(){if(ce){el.show();esc.enable();if(tm.autoDismiss&&ce.autoHide!==false){L=setTimeout(U,tm.autoDismissDelay);}}};var U=function(W){clearTimeout(L);clearTimeout(K);ce=null;if(el.isVisible()){esc.disable();if(W!==true&&tm.animate){el.fadeOut({callback:V});}else {V();}}};var V=function(){el.hide();if(removeCls){el.removeClass(removeCls);removeCls=null;}};return {minWidth:40,maxWidth:300,interceptTitles:false,trackMouse:false,hideOnClick:true,showDelay:500,hideDelay:200,autoHide:true,autoDismiss:true,autoDismissDelay:5000,animate:false,title:'',text:'',cls:'',width:null,init:function(){tm=Roo.QuickTips;D=tm.tagConfig;if(!I){if(!Roo.isReady){Roo.onReady(Roo.QuickTips.init,Roo.QuickTips);return;} el=new Roo.Layer({cls:"x-tip",shadow:"drop",shim:true,constrain:true,shadowOffset:4});el.fxDefaults={stopFx:true};el.update('

    ');C=el.child('h3');C.enableDisplayMode("block");A=el.child('div.x-tip-bd');B=el.child('div.x-tip-bd-inner');E=el.child('div.x-tip-close');E.enableDisplayMode("block");E.on("click",U);var d=Roo.get(document);d.on("mousedown",Q);d.on("mouseover",N);d.on("mouseout",O);d.on("mousemove",P);esc=d.addKeyListener(27,U);esc.disable();if(Roo.dd.DD){dd=el.initDD("default",null,{onDrag:function(){el.sync();}});dd.setHandleElId(C.id);dd.lock();} I=true;} -this.enable();},register:function(X){var cs=X instanceof Array?X:arguments;for(var i=0,len=cs.length;i0){var f=function(Q,R){if(Q&&R){var n=R.findChild(N,v);if(n){n.select();if(O){O(true,n);}}else if(O){O(false,n);}}else {if(O){O(false,n);}}};this.expandPath(P.join(this.pathSeparator),N,f);}else {this.root.select();if(O){O(true,this.root);}}},getTreeEl:function(){return this.el;},render:function(){if(this.innerCt){return this;} +this.id=this.el.id;this.addEvents({"beforeload":true,"load":true,"textchange":true,"beforeexpand":true,"beforecollapse":true,"expand":true,"disabledchange":true,"collapse":true,"beforeclick":true,"checkchange":true,"click":true,"dblclick":true,"contextmenu":true,"beforechildrenrendered":true,"startdrag":true,"enddrag":true,"dragdrop":true,"beforenodedrop":true,"nodedrop":true,"nodedragover":true});if(this.singleExpand){this.on("beforeexpand",this.restrictExpand,this);}};Roo.extend(Roo.tree.TreePanel,Roo.data.Tree,{rootVisible:true,animate:Roo.enableFx,lines:true,enableDD:false,hlDrop:Roo.enableFx,renderer:false,rendererTip:false,restrictExpand:function(A){var p=A.parentNode;if(p){if(p.expandedChild&&p.expandedChild.parentNode==p){p.expandedChild.collapse();} +p.expandedChild=A;}},setRootNode:function(A){Roo.tree.TreePanel.superclass.setRootNode.call(this,A);if(!this.rootVisible){A.ui=new Roo.tree.RootTreeNodeUI(A);}return A;},getEl:function(){return this.el;},getLoader:function(){return this.loader;},expandAll:function(){this.root.expand(true);},collapseAll:function(){this.root.collapse(true);},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.tree.DefaultSelectionModel();}return this.selModel;},getChecked:function(a,A){A=A||this.root;var r=[];var f=function(){if(this.attributes.checked){r.push(!a?this:(a=='id'?this.id:this.attributes[a]));}} +A.cascade(f);return r;},expandPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var E=this.root;if(E.attributes[B]!=D[1]){if(C){C(false,null);}return;}var F=1;var f=function(){if(++F==D.length){if(C){C(true,E);}return;}var c=E.findChild(B,D[F]);if(!c){if(C){C(false,E);}return;} +E=c;c.expand(false,false,f);};E.expand(false,false,f);},selectPath:function(A,B,C){B=B||"id";var D=A.split(this.pathSeparator);var v=D.pop();if(D.length>0){var f=function(E,F){if(E&&F){var n=F.findChild(B,v);if(n){n.select();if(C){C(true,n);}}else if(C){C(false,n);}}else {if(C){C(false,n);}}};this.expandPath(D.join(this.pathSeparator),B,f);}else {this.root.select();if(C){C(true,this.root);}}},getTreeEl:function(){return this.el;},render:function(){if(this.innerCt){return this;} this.innerCt=this.el.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.lines?"x-tree-lines":"x-tree-no-lines")});if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Roo.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true});}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Roo.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll});} this.getSelectionModel().init(this);if(!this.root){console.log("ROOT not set in tree");return;} this.root.render();if(!this.rootVisible){this.root.renderChildren();}return this;}}); -Roo.tree.DefaultSelectionModel=function(){this.selNode=null;this.addEvents({"selectionchange":true,"beforeselect":true});};Roo.extend(Roo.tree.DefaultSelectionModel,Roo.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this);},onNodeClick:function(B,e){if(e.ctrlKey&&this.selNode==B){this.unselect(B);return;} -this.select(B);},select:function(C){var D=this.selNode;if(D!=C&&this.fireEvent('beforeselect',this,C,D)!==false){if(D){D.ui.onSelectedChange(false);} -this.selNode=C;C.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,C,D);}return C;},unselect:function(E){if(this.selNode==E){this.clearSelections();}},clearSelections:function(){var n=this.selNode;if(n){n.ui.onSelectedChange(false);this.selNode=null;this.fireEvent("selectionchange",this,null);}return n;},getSelectedNode:function(){return this.selNode;},isSelected:function(F){return this.selNode==F;},selectPrevious:function(){var s=this.selNode||this.lastSelNode;if(!s){return null;}var ps=s.previousSibling;if(ps){if(!ps.isExpanded()||ps.childNodes.length<1){return this.select(ps);}else {var lc=ps.lastChild;while(lc&&lc.isExpanded()&&lc.childNodes.length>0){lc=lc.lastChild;}return this.select(lc);}}else if(s.parentNode&&(this.tree.rootVisible||!s.parentNode.isRoot)){return this.select(s.parentNode);}return null;},selectNext:function(){var s=this.selNode||this.lastSelNode;if(!s){return null;}if(s.firstChild&&s.isExpanded()){return this.select(s.firstChild);}else if(s.nextSibling){return this.select(s.nextSibling);}else if(s.parentNode){var newS=null;s.parentNode.bubble(function(){if(this.nextSibling){newS=this.getOwnerTree().selModel.select(this.nextSibling);return false;}});return newS;}return null;},onKeyDown:function(e){var s=this.selNode||this.lastSelNode;var sm=this;if(!s){return;}var k=e.getKey();switch(k){case e.DOWN:e.stopEvent();this.selectNext();break;case e.UP:e.stopEvent();this.selectPrevious();break;case e.RIGHT:e.preventDefault();if(s.hasChildNodes()){if(!s.isExpanded()){s.expand();}else if(s.firstChild){this.select(s.firstChild,e);}}break;case e.LEFT:e.preventDefault();if(s.hasChildNodes()&&s.isExpanded()){s.collapse();}else if(s.parentNode&&(this.tree.rootVisible||s.parentNode!=this.tree.getRootNode())){this.select(s.parentNode,e);}break;};}});Roo.tree.MultiSelectionModel=function(){this.selNodes=[];this.selMap={};this.addEvents({"selectionchange":true});};Roo.extend(Roo.tree.MultiSelectionModel,Roo.util.Observable,{init:function(G){this.tree=G;G.getTreeEl().on("keydown",this.onKeyDown,this);G.on("click",this.onNodeClick,this);},onNodeClick:function(H,e){this.select(H,e,e.ctrlKey);},select:function(I,e,J){if(J!==true){this.clearSelections(true);}if(this.isSelected(I)){this.lastSelNode=I;return I;} -this.selNodes.push(I);this.selMap[I.id]=I;this.lastSelNode=I;I.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return I;},unselect:function(K){if(this.selMap[K.id]){K.ui.onSelectedChange(false);var sn=this.selNodes;var index=-1;if(sn.indexOf){index=sn.indexOf(K);}else {for(var i=0,len=sn.length;i0){for(var i=0,len=sn.length;i0){lc=lc.lastChild;}return this.select(lc);}}else if(s.parentNode&&(this.tree.rootVisible||!s.parentNode.isRoot)){return this.select(s.parentNode);}return null;},selectNext:function(){var s=this.selNode||this.lastSelNode;if(!s){return null;}if(s.firstChild&&s.isExpanded()){return this.select(s.firstChild);}else if(s.nextSibling){return this.select(s.nextSibling);}else if(s.parentNode){var newS=null;s.parentNode.bubble(function(){if(this.nextSibling){newS=this.getOwnerTree().selModel.select(this.nextSibling);return false;}});return newS;}return null;},onKeyDown:function(e){var s=this.selNode||this.lastSelNode;var sm=this;if(!s){return;}var k=e.getKey();switch(k){case e.DOWN:e.stopEvent();this.selectNext();break;case e.UP:e.stopEvent();this.selectPrevious();break;case e.RIGHT:e.preventDefault();if(s.hasChildNodes()){if(!s.isExpanded()){s.expand();}else if(s.firstChild){this.select(s.firstChild,e);}}break;case e.LEFT:e.preventDefault();if(s.hasChildNodes()&&s.isExpanded()){s.collapse();}else if(s.parentNode&&(this.tree.rootVisible||s.parentNode!=this.tree.getRootNode())){this.select(s.parentNode,e);}break;};}});Roo.tree.MultiSelectionModel=function(){this.selNodes=[];this.selMap={};this.addEvents({"selectionchange":true});};Roo.extend(Roo.tree.MultiSelectionModel,Roo.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this);},onNodeClick:function(A,e){this.select(A,e,e.ctrlKey);},select:function(A,e,B){if(B!==true){this.clearSelections(true);}if(this.isSelected(A)){this.lastSelNode=A;return A;} +this.selNodes.push(A);this.selMap[A.id]=A;this.lastSelNode=A;A.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return A;},unselect:function(A){if(this.selMap[A.id]){A.ui.onSelectedChange(false);var sn=this.selNodes;var index=-1;if(sn.indexOf){index=sn.indexOf(A);}else {for(var i=0,len=sn.length;i0){for(var i=0,len=sn.length;i
    ','',this.indentMarkup,"",'','',cb?('':' />')):'','',c,"
    ",'',""];if(b!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),g.join(""));}else {this.wrap=Roo.DomHelper.insertHtml("beforeEnd",Z,g.join(""));} -this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var h=3;if(cb){this.checkbox=cs[3];h++;} -this.anchor=cs[h];this.textNode=cs[h].firstChild;},getAnchor:function(){return this.anchor;},getTextEl:function(){return this.textNode;},getIconEl:function(){return this.iconNode;},isChecked:function(){return this.checkbox?this.checkbox.checked:false;},updateExpandIcon:function(){if(this.rendered){var n=this.node,c1,c2;var P=n.isLast()?"x-tree-elbow-end":"x-tree-elbow";var hasChild=n.hasChildNodes();if(hasChild){if(n.expanded){P+="-minus";c1="x-tree-node-collapsed";c2="x-tree-node-expanded";}else {P+="-plus";c1="x-tree-node-expanded";c2="x-tree-node-collapsed";}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false;}if(this.c1!=c1||this.c2!=c2){Roo.fly(this.elNode).replaceClass(c1,c2);this.c1=c1;this.c2=c2;}}else {if(!this.wasLeaf){Roo.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true;}}var ecc="x-tree-ec-icon "+P;if(this.ecc!=ecc){this.ecNode.className=ecc;this.ecc=ecc;}}},getChildIndent:function(){if(!this.childIndent){var g=[];var p=this.node;while(p){if(!p.isRoot||(p.isRoot&&p.ownerTree.rootVisible)){if(!p.isLast()){g.unshift('');}else {g.unshift('');}} +this.fireEvent("dblclick",this.node,e);},onCheckChange:function(){var A=this.checkbox.checked;this.node.attributes.checked=A;this.fireEvent('checkchange',this.node,A);},ecClick:function(e){if(!this.animating&&this.node.hasChildNodes()){this.node.toggle();}},startDrop:function(){this.dropping=true;},endDrop:function(){setTimeout(function(){this.dropping=false;}.createDelegate(this),50);},expand:function(){this.updateExpandIcon();this.ctNode.style.display="";},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus();}catch(e){}}else if(!Roo.isIE){try{var noscroll=this.node.getOwnerTree().getTreeEl().dom;var l=noscroll.scrollLeft;this.anchor.focus();noscroll.scrollLeft=l;}catch(e){}}},toggleCheck:function(A){var cb=this.checkbox;if(cb){cb.checked=(A===undefined?!cb.checked:A);}},blur:function(){try{this.anchor.blur();}catch(e){}},animExpand:function(A){var ct=Roo.get(this.ctNode);ct.stopFx();if(!this.node.hasChildNodes()){this.updateExpandIcon();this.ctNode.style.display="";Roo.callback(A);return;} +this.animating=true;this.updateExpandIcon();ct.slideIn('t',{callback:function(){this.animating=false;Roo.callback(A);},scope:this,duration:this.node.ownerTree.duration||.25});},highlight:function(){var A=this.node.getOwnerTree();Roo.fly(this.wrap).highlight(A.hlColor||"C3DAF9",{endColor:A.hlBaseColor});},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none";},animCollapse:function(A){var ct=Roo.get(this.ctNode);ct.enableDisplayMode('block');ct.stopFx();this.animating=true;this.updateExpandIcon();ct.slideOut('t',{callback:function(){this.animating=false;Roo.callback(A);},scope:this,duration:this.node.ownerTree.duration||.25});},getContainer:function(){return this.ctNode;},getEl:function(){return this.wrap;},appendDDGhost:function(A){A.appendChild(this.elNode.cloneNode(true));},getDDRepairXY:function(){return Roo.lib.Dom.getXY(this.iconNode);},onRender:function(){this.render();},render:function(A){var n=this.node,a=n.attributes;var B=n.parentNode?n.parentNode.ui.getContainer():n.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(n,a,B,A);if(a.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",a.qtipTitle);}}else {this.textNode.setAttribute("ext:qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttribute("ext:qtitle",a.qtipTitle);}}}else if(a.qtipCfg){a.qtipCfg.target=Roo.id(this.textNode);Roo.QuickTips.register(a.qtipCfg);} +this.initEvents();if(!this.node.expanded){this.updateExpandIcon();}}else {if(A===true){B.appendChild(this.wrap);}}},renderElements:function(n,a,A,B){this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';var t=n.getOwnerTree();var C=t.renderer?t.renderer(n.attributes):Roo.util.Format.htmlEncode(n.text);var D=t.rendererTip?t.rendererTip(n.attributes):C;var cb=typeof a.checked=='boolean';var E=a.href?a.href:Roo.isGecko?"":"#";var F=['
  • ','',this.indentMarkup,"",'','',cb?('':' />')):'','',C,"
    ",'',"
  • "];if(B!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),F.join(""));}else {this.wrap=Roo.DomHelper.insertHtml("beforeEnd",A,F.join(""));} +this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var G=3;if(cb){this.checkbox=cs[3];G++;} +this.anchor=cs[G];this.textNode=cs[G].firstChild;},getAnchor:function(){return this.anchor;},getTextEl:function(){return this.textNode;},getIconEl:function(){return this.iconNode;},isChecked:function(){return this.checkbox?this.checkbox.checked:false;},updateExpandIcon:function(){if(this.rendered){var n=this.node,c1,c2;var cls=n.isLast()?"x-tree-elbow-end":"x-tree-elbow";var hasChild=n.hasChildNodes();if(hasChild){if(n.expanded){cls+="-minus";c1="x-tree-node-collapsed";c2="x-tree-node-expanded";}else {cls+="-plus";c1="x-tree-node-expanded";c2="x-tree-node-collapsed";}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false;}if(this.c1!=c1||this.c2!=c2){Roo.fly(this.elNode).replaceClass(c1,c2);this.c1=c1;this.c2=c2;}}else {if(!this.wasLeaf){Roo.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true;}}var ecc="x-tree-ec-icon "+cls;if(this.ecc!=ecc){this.ecNode.className=ecc;this.ecc=ecc;}}},getChildIndent:function(){if(!this.childIndent){var buf=[];var p=this.node;while(p){if(!p.isRoot||(p.isRoot&&p.ownerTree.rootVisible)){if(!p.isLast()){buf.unshift('');}else {buf.unshift('');}} p=p.parentNode;} -this.childIndent=g.join("");}return this.childIndent;},renderIndent:function(){if(this.rendered){var indent="";var p=this.node.parentNode;if(p){indent=p.ui.getChildIndent();}if(this.indentMarkup!=indent){this.indentNode.innerHTML=indent;this.indentMarkup=indent;} -this.updateExpandIcon();}}};Roo.tree.RootTreeNodeUI=function(){Roo.tree.RootTreeNodeUI.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.tree.RootTreeNodeUI,Roo.tree.TreeNodeUI,{render:function(){if(!this.rendered){var Z=this.node.ownerTree.innerCt.dom;this.node.expanded=true;Z.innerHTML='
    ';this.wrap=this.ctNode=Z.firstChild;}},collapse:function(){},expand:function(){}}); -Roo.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Roo.apply(this,A);this.addEvents({beforeload:true,load:true,loadexception:true,create:true});Roo.tree.TreeLoader.superclass.constructor.call(this);};Roo.extend(Roo.tree.TreeLoader,Roo.util.Observable,{uiProviders:{},clearOnLoad:true,root:false,queryParam:false,load:function(B,C){if(this.clearOnLoad){while(B.firstChild){B.removeChild(B.firstChild);}}if(B.attributes.children){var cs=B.attributes.children;for(var i=0,len=cs.length;i';this.wrap=this.ctNode=targetNode.firstChild;}},collapse:function(){},expand:function(){}}); +Roo.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Roo.apply(this,A);this.addEvents({beforeload:true,load:true,loadexception:true,create:true});Roo.tree.TreeLoader.superclass.constructor.call(this);};Roo.extend(Roo.tree.TreeLoader,Roo.util.Observable,{uiProviders:{},clearOnLoad:true,root:false,queryParam:false,load:function(A,B){if(this.clearOnLoad){while(A.firstChild){A.removeChild(A.firstChild);}}if(A.attributes.children){var cs=A.attributes.children;for(var i=0,len=cs.length;iv2){return C?-1:+1;}else {return 0;}};};Roo.tree.TreeSorter.prototype={doSort:function(F){F.sort(this.sortFn);},compareNodes:function(n1,n2){return (n1.text.toUpperCase()>n2.text.toUpperCase()?1:-1);},updateSort:function(G,H){if(H.childrenRendered){this.doSort.defer(1,this,[H]);}}}; -if(Roo.dd.DropZone){Roo.tree.TreeDropZone=function(A,B){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Roo.tree.TreeDropZone.superclass.constructor.call(this,A.innerCt,B);this.tree=A;this.lastInsertClass="x-tree-no-status";this.dragOverData={};};Roo.extend(Roo.tree.TreeDropZone,Roo.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(C){if(C.hasChildNodes()&&!C.isExpanded()){C.expand(false,null,this.triggerCacheRefresh.createDelegate(this));}},queueExpand:function(D){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[D]);},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false;}},isValidDropPoint:function(n,pt,dd,e,E){if(!n||!E){return false;}var F=n.node;var G=E.node;if(!(F&&F.isTarget&&pt)){return false;}if(pt=="append"&&F.allowChildren===false){return false;}if((pt=="above"||pt=="below")&&(F.parentNode&&F.parentNode.allowChildren===false)){return false;}if(G&&(F==G||G.contains(F))){return false;}var H=this.dragOverData;H.tree=this.tree;H.target=F;H.data=E;H.point=pt;H.source=dd;H.rawEvent=e;H.dropNode=G;H.cancel=false;var I=this.tree.fireEvent("nodedragover",H);return H.cancel===false&&I!==false;},getDropPoint:function(e,n,dd){var tn=n.node;if(tn.isRoot){return tn.allowChildren!==false?"append":false;}var J=n.ddel;var t=Roo.lib.Dom.getY(J),b=t+J.offsetHeight;var y=Roo.lib.Event.getPageY(e);var K=tn.allowChildren===false||tn.isLeaf();if(this.appendOnly||tn.parentNode.allowChildren===false){return K?false:"append";}var L=false;if(!this.allowParentInsert){L=tn.hasChildNodes()&&tn.isExpanded();}var q=(b-t)/(K?2:3);if(y>=t&&y<(t+q)){return "above";}else if(!L&&(K||y>=b-q&&y<=b)){return "below";}else {return "append";}},onNodeEnter:function(n,dd,e,M){this.cancelExpand();},onNodeOver:function(n,dd,e,N){var pt=this.getDropPoint(e,n,dd);var O=n.node;if(!this.expandProcId&&pt=="append"&&O.hasChildNodes()&&!n.node.isExpanded()){this.queueExpand(O);}else if(pt!="append"){this.cancelExpand();}var P=this.dropNotAllowed;if(this.isValidDropPoint(n,pt,dd,e,N)){if(pt){var el=n.ddel;var cls;if(pt=="above"){P=n.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";cls="x-tree-drag-insert-above";}else if(pt=="below"){P=n.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";cls="x-tree-drag-insert-below";}else {P="x-tree-drop-ok-append";cls="x-tree-drag-append";}if(this.lastInsertClass!=cls){Roo.fly(el).replaceClass(this.lastInsertClass,cls);this.lastInsertClass=cls;}}}return P;},onNodeOut:function(n,dd,e,Q){this.cancelExpand();this.removeDropIndicators(n);},onNodeDrop:function(n,dd,e,R){var S=this.getDropPoint(e,n,dd);var T=n.node;T.ui.startDrop();if(!this.isValidDropPoint(n,S,dd,e,R)){T.ui.endDrop();return false;}var U=R.node||(dd.getTreeNode?dd.getTreeNode(R,T,S,e):null);var V={tree:this.tree,target:T,data:R,point:S,source:dd,rawEvent:e,dropNode:U,cancel:!U};var W=this.tree.fireEvent("beforenodedrop",V);if(W===false||V.cancel===true||!V.dropNode){T.ui.endDrop();return false;} -T=V.target;if(S=="append"&&!T.isExpanded()){T.expand(false,null,function(){this.completeDrop(V);}.createDelegate(this));}else {this.completeDrop(V);}return true;},completeDrop:function(de){var ns=de.dropNode,p=de.point,t=de.target;if(!(ns instanceof Array)){ns=[ns];}var n;for(var i=0,len=ns.length;iv2){return C?-1:+1;}else {return 0;}};};Roo.tree.TreeSorter.prototype={doSort:function(A){A.sort(this.sortFn);},compareNodes:function(n1,n2){return (n1.text.toUpperCase()>n2.text.toUpperCase()?1:-1);},updateSort:function(A,B){if(B.childrenRendered){this.doSort.defer(1,this,[B]);}}}; +if(Roo.dd.DropZone){Roo.tree.TreeDropZone=function(A,B){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Roo.tree.TreeDropZone.superclass.constructor.call(this,A.innerCt,B);this.tree=A;this.lastInsertClass="x-tree-no-status";this.dragOverData={};};Roo.extend(Roo.tree.TreeDropZone,Roo.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(A){if(A.hasChildNodes()&&!A.isExpanded()){A.expand(false,null,this.triggerCacheRefresh.createDelegate(this));}},queueExpand:function(A){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[A]);},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false;}},isValidDropPoint:function(n,pt,dd,e,A){if(!n||!A){return false;}var B=n.node;var C=A.node;if(!(B&&B.isTarget&&pt)){return false;}if(pt=="append"&&B.allowChildren===false){return false;}if((pt=="above"||pt=="below")&&(B.parentNode&&B.parentNode.allowChildren===false)){return false;}if(C&&(B==C||C.contains(B))){return false;}var D=this.dragOverData;D.tree=this.tree;D.target=B;D.data=A;D.point=pt;D.source=dd;D.rawEvent=e;D.dropNode=C;D.cancel=false;var E=this.tree.fireEvent("nodedragover",D);return D.cancel===false&&E!==false;},getDropPoint:function(e,n,dd){var tn=n.node;if(tn.isRoot){return tn.allowChildren!==false?"append":false;}var A=n.ddel;var t=Roo.lib.Dom.getY(A),b=t+A.offsetHeight;var y=Roo.lib.Event.getPageY(e);var B=tn.allowChildren===false||tn.isLeaf();if(this.appendOnly||tn.parentNode.allowChildren===false){return B?false:"append";}var C=false;if(!this.allowParentInsert){C=tn.hasChildNodes()&&tn.isExpanded();}var q=(b-t)/(B?2:3);if(y>=t&&y<(t+q)){return "above";}else if(!C&&(B||y>=b-q&&y<=b)){return "below";}else {return "append";}},onNodeEnter:function(n,dd,e,A){this.cancelExpand();},onNodeOver:function(n,dd,e,A){var pt=this.getDropPoint(e,n,dd);var B=n.node;if(!this.expandProcId&&pt=="append"&&B.hasChildNodes()&&!n.node.isExpanded()){this.queueExpand(B);}else if(pt!="append"){this.cancelExpand();}var C=this.dropNotAllowed;if(this.isValidDropPoint(n,pt,dd,e,A)){if(pt){var el=n.ddel;var cls;if(pt=="above"){C=n.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";cls="x-tree-drag-insert-above";}else if(pt=="below"){C=n.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";cls="x-tree-drag-insert-below";}else {C="x-tree-drop-ok-append";cls="x-tree-drag-append";}if(this.lastInsertClass!=cls){Roo.fly(el).replaceClass(this.lastInsertClass,cls);this.lastInsertClass=cls;}}}return C;},onNodeOut:function(n,dd,e,A){this.cancelExpand();this.removeDropIndicators(n);},onNodeDrop:function(n,dd,e,A){var B=this.getDropPoint(e,n,dd);var C=n.node;C.ui.startDrop();if(!this.isValidDropPoint(n,B,dd,e,A)){C.ui.endDrop();return false;}var D=A.node||(dd.getTreeNode?dd.getTreeNode(A,C,B,e):null);var E={tree:this.tree,target:C,data:A,point:B,source:dd,rawEvent:e,dropNode:D,cancel:!D};var F=this.tree.fireEvent("beforenodedrop",E);if(F===false||E.cancel===true||!E.dropNode){C.ui.endDrop();return false;} +C=E.target;if(B=="append"&&!C.isExpanded()){C.expand(false,null,function(){this.completeDrop(E);}.createDelegate(this));}else {this.completeDrop(E);}return true;},completeDrop:function(de){var ns=de.dropNode,p=de.point,t=de.target;if(!(ns instanceof Array)){ns=[ns];}var n;for(var i=0,len=ns.length;ind.offsetLeft){td.scrollLeft=nd.offsetLeft;}var w=Math.min(this.maxWidth,(td.clientWidth>20?td.clientWidth:td.offsetWidth)-Math.max(0,nd.offsetLeft-td.scrollLeft)-5);this.setSize(w,'');},triggerEdit:function(D){this.completeEdit();this.editNode=D;this.startEdit(D.ui.textNode,D.text);},bindScroll:function(){this.tree.getTreeEl().on('scroll',this.cancelEdit,this);},beforeNodeClick:function(E,e){var F=(this.lastClick?this.lastClick.getElapsed():0);this.lastClick=new Date();if(F>this.editDelay&&this.tree.getSelectionModel().isSelected(E)){e.stopEvent();this.triggerEdit(E);return false;}},updateNode:function(ed,G){this.tree.getTreeEl().un('scroll',this.cancelEdit,this);this.editNode.setText(G);},onHide:function(){Roo.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus();}},onSpecialKey:function(H,e){var k=e.getKey();if(k==e.ESC){e.stopEvent();this.cancelEdit();}else if(k==e.ENTER&&!e.hasModifier()){e.stopEvent();this.completeEdit();}}}); +if(Roo.dd.DragZone){Roo.tree.TreeDragZone=function(A,B){Roo.tree.TreeDragZone.superclass.constructor.call(this,A.getTreeEl(),B);this.tree=A;};Roo.extend(Roo.tree.TreeDragZone,Roo.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(A,e){var n=A.node;return n&&n.draggable&&!n.disabled;},onInitDrag:function(e){var A=this.dragData;this.tree.getSelectionModel().select(A.node);this.proxy.update("");A.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,A.node,e);},getRepairXY:function(e,A){return A.node.ui.getDDRepairXY();},onEndDrag:function(A,e){this.tree.fireEvent("enddrag",this.tree,A.node,e);},onValidDrop:function(dd,e,id){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,dd,e);this.hideProxy();},beforeInvalidDrop:function(e,id){var sm=this.tree.getSelectionModel();sm.clearSelections();sm.select(this.dragData.node);}});} +Roo.tree.TreeEditor=function(A,B){B=B||{};var C=B.events?B:new Roo.form.TextField(B);Roo.tree.TreeEditor.superclass.constructor.call(this,C);this.tree=A;A.on('beforeclick',this.beforeNodeClick,this);A.getTreeEl().on('mousedown',this.hide,this);this.on('complete',this.updateNode,this);this.on('beforestartedit',this.fitToTree,this);this.on('startedit',this.bindScroll,this,{delay:10});this.on('specialkey',this.onSpecialKey,this);};Roo.extend(Roo.tree.TreeEditor,Roo.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,fitToTree:function(ed,el){var td=this.tree.getTreeEl().dom,nd=el.dom;if(td.scrollLeft>nd.offsetLeft){td.scrollLeft=nd.offsetLeft;}var w=Math.min(this.maxWidth,(td.clientWidth>20?td.clientWidth:td.offsetWidth)-Math.max(0,nd.offsetLeft-td.scrollLeft)-5);this.setSize(w,'');},triggerEdit:function(A){this.completeEdit();this.editNode=A;this.startEdit(A.ui.textNode,A.text);},bindScroll:function(){this.tree.getTreeEl().on('scroll',this.cancelEdit,this);},beforeNodeClick:function(A,e){var B=(this.lastClick?this.lastClick.getElapsed():0);this.lastClick=new Date();if(B>this.editDelay&&this.tree.getSelectionModel().isSelected(A)){e.stopEvent();this.triggerEdit(A);return false;}},updateNode:function(ed,A){this.tree.getTreeEl().un('scroll',this.cancelEdit,this);this.editNode.setText(A);},onHide:function(){Roo.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus();}},onSpecialKey:function(A,e){var k=e.getKey();if(k==e.ESC){e.stopEvent();this.cancelEdit();}else if(k==e.ENTER&&!e.hasModifier()){e.stopEvent();this.completeEdit();}}}); Roo.tree.ColumnNodeUI=Roo.extend(Roo.tree.TreeNodeUI,{renderElements:function(n,a,A,B){this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';var t=n.getOwnerTree();var C=Pman.Tab.Document_TypesTree.tree.el.id;var D=t.columns;var bw=t.borderWidth;var c=D[0];var E=a.href?a.href:Roo.isGecko?"":"#";var cb=typeof a.checked=="boolean";var tx=String.format('{0}',n.text||(c.renderer?c.renderer(a[c.dataIndex],n,a):a[c.dataIndex]));var F='x-t-'+C+'-c0';var G=['
  • ','
    ','
    ','',this.indentMarkup,'','','',(cb?('':' />')):''),'','',tx,'','
    ','',];for(var i=1,len=D.length;i','
    ',tx,"
    ","
    ");} G.push('','
    ','',"
  • ");if(B!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),G.join(""));}else {this.wrap=Roo.DomHelper.insertHtml("beforeEnd",A,G.join(""));}var el=this.wrap.firstChild;this.elRow=el;this.elNode=el.firstChild;this.ranchor=el.childNodes[1];this.ctNode=this.wrap.childNodes[1];var cs=el.firstChild.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var H=3;if(cb){this.checkbox=cs[3];H++;} this.anchor=cs[H];this.textNode=cs[H].firstChild;},initEvents:function(){Roo.tree.ColumnNodeUI.superclass.initEvents.call(this);var a=this.ranchor;var el=Roo.get(a);if(Roo.isOpera){el.setStyle("text-decoration","none");} -el.on("click",this.onClick,this);el.on("dblclick",this.onDblClick,this);el.on("contextmenu",this.onContextMenu,this);},addClass:function(I){if(this.elRow){Roo.fly(this.elRow).addClass(I);}},removeClass:function(J){if(this.elRow){Roo.fly(this.elRow).removeClass(J);}}}); -Roo.tree.ColumnTree=function(el,A){Roo.tree.ColumnTree.superclass.constructor.call(this,el,A);this.addEvents({"resize":true});this.on('resize',this.onResize,this);};Roo.extend(Roo.tree.ColumnTree,Roo.tree.TreePanel,{borderWidth:Roo.isBorderBox?0:2,headEls:false,render:function(){Roo.tree.ColumnTree.superclass.render.apply(this);this.el.addClass('x-column-tree');this.headers=this.el.createChild({cls:'x-tree-headers'},this.innerCt.dom);var B=this.columns,c;var C=0;this.headEls=[];var D=B.length;for(var i=0;i=0&&i=0&&i0){E();}});}function E(){if(B&&B.length>0){var c=B.clone();c.each(function(m){m.hide();});}}function F(m){B.remove(m);if(B.length<1){Roo.get(document).un("mousedown",J);attached=false;}}function G(m){var L=B.last();lastShow=new Date();B.add(m);if(!attached){Roo.get(document).on("mousedown",J);attached=true;}if(m.parentMenu){m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"),10)+3);m.parentMenu.activeChild=m;}else if(L&&L.isVisible()){m.getEl().setZIndex(parseInt(L.getEl().getStyle("z-index"),10)+3);}}function H(m){if(m.activeChild){m.activeChild.hide();}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}function I(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){E();}else if(pm&&pm.activeChild&&B!=m){pm.activeChild.hide();}}function J(e){if(lastShow.getElapsed()>50&&B.length>0&&!e.getTarget(".x-menu")){E();}}function K(mi,L){if(L){var g=C[mi.group];for(var i=0,l=g.length;i0){E();}});}function E(){if(B&&B.length>0){var c=B.clone();c.each(function(m){m.hide();});}}function F(m){B.remove(m);if(B.length<1){Roo.get(document).un("mousedown",J);attached=false;}}function G(m){var L=B.last();lastShow=new Date();B.add(m);if(!attached){Roo.get(document).on("mousedown",J);attached=true;}if(m.parentMenu){m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"),10)+3);m.parentMenu.activeChild=m;}else if(L&&L.isVisible()){m.getEl().setZIndex(parseInt(L.getEl().getStyle("z-index"),10)+3);}}function H(m){if(m.activeChild){m.activeChild.hide();}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}function I(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){E();}else if(pm&&pm.activeChild&&B!=m){pm.activeChild.hide();}}function J(e){if(lastShow.getElapsed()>50&&B.length>0&&!e.getTarget(".x-menu")){E();}}function K(mi,L){if(L){var g=C[mi.group];for(var i=0,l=g.length;i{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||'');this.el=el;Roo.menu.Item.superclass.onRender.call(this,B,C);},setText:function(D){this.text=D;if(this.rendered){this.el.update(String.format('{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||''));this.parentMenu.autoWidth();}},handleClick:function(e){if(!this.href){e.stopEvent();} -Roo.menu.Item.superclass.handleClick.apply(this,arguments);},activate:function(E){if(Roo.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(E){this.expandMenu();}}return true;},shouldDeactivate:function(e){if(Roo.menu.Item.superclass.shouldDeactivate.call(this,e)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(e.getPoint());}return true;}return false;},deactivate:function(){Roo.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu();},expandMenu:function(F){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[F]);}else if(this.menu.isVisible()&&F){this.menu.tryActivate(0,1);}}},deferExpand:function(G){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(G){this.menu.tryActivate(0,1);}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this);}},deferHide:function(){delete this.hideTimer;this.menu.hide();}}); +Roo.menu.Item=function(A){Roo.menu.Item.superclass.constructor.call(this,A);if(this.menu){this.menu=Roo.menu.MenuMgr.get(this.menu);}};Roo.extend(Roo.menu.Item,Roo.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,hideDelay:200,ctype:"Roo.menu.Item",onRender:function(A,B){var el=document.createElement("a");el.hideFocus=true;el.unselectable="on";el.href=this.href||"#";if(this.hrefTarget){el.target=this.hrefTarget;} +el.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");el.innerHTML=String.format('{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||'');this.el=el;Roo.menu.Item.superclass.onRender.call(this,A,B);},setText:function(A){this.text=A;if(this.rendered){this.el.update(String.format('{1}',this.icon||Roo.BLANK_IMAGE_URL,this.text,this.iconCls||''));this.parentMenu.autoWidth();}},handleClick:function(e){if(!this.href){e.stopEvent();} +Roo.menu.Item.superclass.handleClick.apply(this,arguments);},activate:function(A){if(Roo.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(A){this.expandMenu();}}return true;},shouldDeactivate:function(e){if(Roo.menu.Item.superclass.shouldDeactivate.call(this,e)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(e.getPoint());}return true;}return false;},deactivate:function(){Roo.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu();},expandMenu:function(A){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[A]);}else if(this.menu.isVisible()&&A){this.menu.tryActivate(0,1);}}},deferExpand:function(A){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(A){this.menu.tryActivate(0,1);}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this);}},deferHide:function(){delete this.hideTimer;this.menu.hide();}}); Roo.menu.CheckItem=function(A){Roo.menu.CheckItem.superclass.constructor.call(this,A);this.addEvents({"beforecheckchange":true,"checkchange":true});if(this.checkHandler){this.on('checkchange',this.checkHandler,this.scope);}};Roo.extend(Roo.menu.CheckItem,Roo.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Roo.menu.CheckItem",onRender:function(c){Roo.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass);} Roo.menu.MenuMgr.registerCheckable(this);if(this.checked){this.checked=false;this.setChecked(true,true);}},destroy:function(){if(this.rendered){Roo.menu.MenuMgr.unregisterCheckable(this);} -Roo.menu.CheckItem.superclass.destroy.apply(this,arguments);},setChecked:function(B,C){if(this.checked!=B&&this.fireEvent("beforecheckchange",this,B)!==false){if(this.container){this.container[B?"addClass":"removeClass"]("x-menu-item-checked");} -this.checked=B;if(C!==true){this.fireEvent("checkchange",this,B);}}},handleClick:function(e){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked);} +Roo.menu.CheckItem.superclass.destroy.apply(this,arguments);},setChecked:function(A,B){if(this.checked!=A&&this.fireEvent("beforecheckchange",this,A)!==false){if(this.container){this.container[A?"addClass":"removeClass"]("x-menu-item-checked");} +this.checked=A;if(B!==true){this.fireEvent("checkchange",this,A);}}},handleClick:function(e){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked);} Roo.menu.CheckItem.superclass.handleClick.apply(this,arguments);}}); -Roo.menu.DateItem=function(A){Roo.menu.DateItem.superclass.constructor.call(this,new Roo.DatePicker(A),A);this.picker=this.component;this.addEvents({select:true});this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item");});this.picker.on("select",this.onSelect,this);};Roo.extend(Roo.menu.DateItem,Roo.menu.Adapter,{onSelect:function(B,C){this.fireEvent("select",this,C,B);Roo.menu.DateItem.superclass.handleClick.call(this);}}); +Roo.menu.DateItem=function(A){Roo.menu.DateItem.superclass.constructor.call(this,new Roo.DatePicker(A),A);this.picker=this.component;this.addEvents({select:true});this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item");});this.picker.on("select",this.onSelect,this);};Roo.extend(Roo.menu.DateItem,Roo.menu.Adapter,{onSelect:function(A,B){this.fireEvent("select",this,B,A);Roo.menu.DateItem.superclass.handleClick.call(this);}}); Roo.menu.ColorItem=function(A){Roo.menu.ColorItem.superclass.constructor.call(this,new Roo.ColorPalette(A),A);this.palette=this.component;this.relayEvents(this.palette,["select"]);if(this.selectHandler){this.on('select',this.selectHandler,this.scope);}};Roo.extend(Roo.menu.ColorItem,Roo.menu.Adapter); Roo.menu.DateMenu=function(A){Roo.menu.DateMenu.superclass.constructor.call(this,A);this.plain=true;var di=new Roo.menu.DateItem(A);this.add(di);this.picker=di.picker;this.relayEvents(di,["select"]);this.on('beforeshow',function(){if(this.picker){this.picker.hideMonthPicker(true);}},this);};Roo.extend(Roo.menu.DateMenu,Roo.menu.Menu,{cls:'x-date-menu'}); Roo.menu.ColorMenu=function(A){Roo.menu.ColorMenu.superclass.constructor.call(this,A);this.plain=true;var ci=new Roo.menu.ColorItem(A);this.add(ci);this.palette=ci.palette;this.relayEvents(ci,["select"]);};Roo.extend(Roo.menu.ColorMenu,Roo.menu.Menu); -Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,B){Roo.form.Field.superclass.onRender.call(this,ct,B);if(!this.el){var cfg=this.getAutoCreate();if(!cfg.name){cfg.name=this.name||this.id;}if(this.inputType){cfg.type=this.inputType;} -this.el=ct.createChild(cfg,B);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';} -this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);} -this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(D){this.allowDomMove=false;this.el=Roo.get(D);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.originalValue);this.clearInvalid();},initEvents:function(){this.el.on(Roo.isIE?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.originalValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);} +Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);if(!this.el){var cfg=this.getAutoCreate();if(!cfg.name){cfg.name=this.name||this.id;}if(this.inputType){cfg.type=this.inputType;} +this.el=ct.createChild(cfg,A);}var B=this.el.dom.type;if(B){if(B=='password'){B='text';} +this.el.addClass('x-form-'+B);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);} +this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.originalValue);this.clearInvalid();},initEvents:function(){this.el.on(Roo.isIE?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.originalValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);} this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);} -this.fireEvent("blur",this);},isValid:function(E){if(this.disabled){return true;}var F=this.preventMark;this.preventMark=E===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=F;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true;}return false;},processValue:function(G){return G;},validateValue:function(H){return true;},markInvalid:function(I){if(!this.rendered||this.preventMark){return;} -this.el.addClass(this.invalidClass);I=I||this.invalidText;switch(this.msgTarget){case 'qtip':this.el.dom.qtip=I;this.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=I;break;case 'under':if(!this.errorEl){var elp=this.el.findParent('.x-form-element',5,true);this.errorEl=elp.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(elp.getWidth(true)-20);} -this.errorEl.update(I);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var elp=this.el.findParent('.x-form-element',5,true);this.errorIcon=elp.createChild({cls:'x-form-invalid-icon'});} -this.alignErrorIcon();this.errorIcon.dom.qtip=I;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML=I;t.style.display=this.msgDisplay;break;} -this.fireEvent('invalid',this,I);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;} +this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;} +this.el.addClass(this.invalidClass);A=A||this.invalidText;switch(this.msgTarget){case 'qtip':this.el.dom.qtip=A;this.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;break;case 'under':if(!this.errorEl){var elp=this.el.findParent('.x-form-element',5,true);this.errorEl=elp.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(elp.getWidth(true)-20);} +this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var elp=this.el.findParent('.x-form-element',5,true);this.errorIcon=elp.createChild({cls:'x-form-invalid-icon'});} +this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML=A;t.style.display=this.msgDisplay;break;} +this.fireEvent('invalid',this,A);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;} this.el.removeClass(this.invalidClass);switch(this.msgTarget){case 'qtip':this.el.dom.qtip='';break;case 'title':this.el.dom.title='';break;case 'under':if(this.errorEl){Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);}break;case 'side':if(this.errorIcon){this.errorIcon.dom.qtip='';this.errorIcon.hide();this.un('resize',this.alignErrorIcon,this);}break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;} -this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();if(v===this.emptyText){v='';}return v;},getValue:function(){var v=this.el.getValue();if(v===this.emptyText||v===undefined){v='';}return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(J,w){J=J.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(J=='input'||J=='textarea')){if(J=='input'){return w+2;}if(J='textarea'){return w-2;}}else if(Roo.isOpera){if(J=='input'){return w+2;}if(J='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(K,f){K.setDisplayed('block');},hide:function(L,f){L.setDisplayed(false).update('');}},slide:{show:function(M,f){M.slideIn('t',{stopFx:true});},hide:function(N,f){N.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(O,f){O.fixDisplay();O.alignTo(f.el,'tl-tr');O.slideIn('l',{stopFx:true});},hide:function(P,f){P.slideOut('l',{stopFx:true,useDisplay:true});}}}; -Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:'x-form-empty-field',initEvents:function(){Roo.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.el.on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);if(this.emptyText){this.on('blur',this.postBlur,this);this.applyEmptyText();}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50});this.el.on("click",this.autoSize,this);}},processValue:function(B){if(this.stripCharsRe){var newValue=B.replace(this.stripCharsRe,'');if(newValue!==B){this.setRawValue(newValue);return newValue;}}return B;},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},onKeyUp:function(e){if(!e.isNavKeyPress()){this.autoSize();}},reset:function(){Roo.form.TextField.superclass.reset.call(this);this.applyEmptyText();},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass);}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue('');} +this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();if(v===this.emptyText){v='';}return v;},getValue:function(){var v=this.el.getValue();if(v===this.emptyText||v===undefined){v='';}return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;}if(A='textarea'){return w-2;}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true});},hide:function(A,f){A.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(A,f){A.fixDisplay();A.alignTo(f.el,'tl-tr');A.slideIn('l',{stopFx:true});},hide:function(A,f){A.slideOut('l',{stopFx:true,useDisplay:true});}}}; +Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:'x-form-empty-field',initEvents:function(){Roo.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.el.on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);if(this.emptyText){this.on('blur',this.postBlur,this);this.applyEmptyText();}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50});this.el.on("click",this.autoSize,this);}},processValue:function(A){if(this.stripCharsRe){var newValue=A.replace(this.stripCharsRe,'');if(newValue!==A){this.setRawValue(newValue);return newValue;}}return A;},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},onKeyUp:function(e){if(!e.isNavKeyPress()){this.autoSize();}},reset:function(){Roo.form.TextField.superclass.reset.call(this);this.applyEmptyText();},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass);}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue('');} this.el.removeClass(this.emptyClass);}if(this.selectOnFocus){this.el.dom.select();}},postBlur:function(){this.applyEmptyText();},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE &&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},setValue:function(v){if(this.emptyText&&this.el&&v!==undefined&&v!==null&&v!==''){this.el.removeClass(this.emptyClass);} -Roo.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();},validateValue:function(C){if(C.length<1||C===this.emptyText){if(this.allowBlank){this.clearInvalid();return true;}else {this.markInvalid(this.blankText);return false;}}if(C.lengththis.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](C,this)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;}}if(typeof this.validator=="function"){var msg=this.validator(C);if(msg!==true){this.markInvalid(msg);return false;}}if(this.regex&&!this.regex.test(C)){this.markInvalid(this.regexText);return false;}return true;},selectText:function(D,E){var v=this.getRawValue();if(v.length>0){D=D===undefined?0:D;E=E===undefined?v.length:E;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(D,E);}else if(d.createTextRange){var range=d.createTextRange();range.moveStart("character",D);range.moveEnd("character",v.length-E);range.select();}}},autoSize:function(){if(!this.grow||!this.rendered){return;}if(!this.metrics){this.metrics=Roo.util.TextMetrics.createInstance(this.el);}var el=this.el;var v=el.dom.value;var d=document.createElement('div');d.appendChild(document.createTextNode(v));v=d.innerHTML;d=null;v+=" ";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w);}}); +Roo.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();},validateValue:function(A){if(A.length<1||A===this.emptyText){if(this.allowBlank){this.clearInvalid();return true;}else {this.markInvalid(this.blankText);return false;}}if(A.lengththis.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;}}if(typeof this.validator=="function"){var msg=this.validator(A);if(msg!==true){this.markInvalid(msg);return false;}}if(this.regex&&!this.regex.test(A)){this.markInvalid(this.regexText);return false;}return true;},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var range=d.createTextRange();range.moveStart("character",A);range.moveEnd("character",v.length-B);range.select();}}},autoSize:function(){if(!this.grow||!this.rendered){return;}if(!this.metrics){this.metrics=Roo.util.TextMetrics.createInstance(this.el);}var el=this.el;var v=el.dom.value;var d=document.createElement('div');d.appendChild(document.createTextNode(v));v=d.innerHTML;d=null;v+=" ";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w);}}); Roo.form.Hidden=function(A){Roo.form.Hidden.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Hidden,Roo.form.TextField,{fieldLabel:'',inputType:'hidden',width:50,allowBlank:true,labelSeparator:'',hidden:true,itemCls:'x-form-item-display-none'}); -Roo.form.TriggerField=function(A){this.mimicing=false;Roo.form.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.TriggerField,Roo.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',onResize:function(w,h){Roo.form.TriggerField.superclass.onResize.apply(this,arguments);if(typeof w=='number'){this.el.setWidth(this.adjustWidth('input',w-this.trigger.getWidth()));}},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,'tl-tr',[2,0]);},onRender:function(ct,B){Roo.form.TriggerField.superclass.onRender.call(this,ct,B);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false);} +Roo.form.TriggerField=function(A){this.mimicing=false;Roo.form.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.TriggerField,Roo.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',onResize:function(w,h){Roo.form.TriggerField.superclass.onResize.apply(this,arguments);if(typeof w=='number'){this.el.setWidth(this.adjustWidth('input',w-this.trigger.getWidth()));}},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,'tl-tr',[2,0]);},onRender:function(ct,A){Roo.form.TriggerField.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false);} this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());}},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver('x-form-trigger-over');this.trigger.addClassOnClick('x-form-trigger-click');},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove();}if(this.wrap){this.wrap.remove();} Roo.form.TriggerField.superclass.onDestroy.call(this);},onFocus:function(){Roo.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass('x-trigger-wrap-focus');this.mimicing=true;Roo.get(Roo.isIE?document.body:document).on("mousedown",this.mimicBlur,this);if(this.monitorTab){this.el.on("keydown",this.checkTab,this);}}},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur();}},onBlur:function(){},mimicBlur:function(e,t){if(!this.wrap.contains(t)&&this.validateBlur()){this.triggerBlur();}},triggerBlur:function(){this.mimicing=false;Roo.get(Roo.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this);} -this.wrap.removeClass('x-trigger-wrap-focus');Roo.form.TriggerField.superclass.onBlur.call(this);},validateBlur:function(e,t){return true;},onDisable:function(){Roo.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass('x-item-disabled');}},onEnable:function(){Roo.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass('x-item-disabled');}},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible';}},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn});Roo.form.TwinTriggerField=Roo.extend(Roo.form.TriggerField,{initComponent:function(){Roo.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:'span',cls:'x-form-twin-triggers',cn:[{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]};},getTrigger:function(C){return this.triggers[C];},initTrigger:function(){var ts=this.trigger.select('.x-form-trigger',true);this.wrap.setStyle('overflow','hidden');var D=this;ts.each(function(t,E,F){t.hide=function(){var w=D.wrap.getWidth();this.dom.style.display='none';D.el.setWidth(w-D.trigger.getWidth());};t.show=function(){var w=D.wrap.getWidth();this.dom.style.display='';D.el.setWidth(w-D.trigger.getWidth());};var G='Trigger'+(F+1);if(this['hide'+G]){t.dom.style.display='none';} -t.on("click",this['on'+G+'Click'],this,{preventDefault:true});t.addClassOnOver('x-form-trigger-over');t.addClassOnClick('x-form-trigger-click');},this);this.triggers=ts.elements;},onTrigger1Click:Roo.emptyFn,onTrigger2Click:Roo.emptyFn}); -Roo.form.TextArea=function(A){Roo.form.TextArea.superclass.constructor.call(this,A);if(this.minHeight!==undefined){this.growMin=this.minHeight;}if(this.maxHeight!==undefined){this.growMax=this.maxHeight;}};Roo.extend(Roo.form.TextArea,Roo.form.TextField,{growMin:60,growMax:1000,preventScrollbars:false,onRender:function(ct,B){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} -Roo.form.TextArea.superclass.onRender.call(this,ct,B);if(this.grow){this.textSizeEl=Roo.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden");} +this.wrap.removeClass('x-trigger-wrap-focus');Roo.form.TriggerField.superclass.onBlur.call(this);},validateBlur:function(e,t){return true;},onDisable:function(){Roo.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass('x-item-disabled');}},onEnable:function(){Roo.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass('x-item-disabled');}},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible';}},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn});Roo.form.TwinTriggerField=Roo.extend(Roo.form.TriggerField,{initComponent:function(){Roo.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:'span',cls:'x-form-twin-triggers',cn:[{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Roo.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]};},getTrigger:function(A){return this.triggers[A];},initTrigger:function(){var ts=this.trigger.select('.x-form-trigger',true);this.wrap.setStyle('overflow','hidden');var A=this;ts.each(function(t,B,C){t.hide=function(){var w=A.wrap.getWidth();this.dom.style.display='none';A.el.setWidth(w-A.trigger.getWidth());};t.show=function(){var w=A.wrap.getWidth();this.dom.style.display='';A.el.setWidth(w-A.trigger.getWidth());};var D='Trigger'+(C+1);if(this['hide'+D]){t.dom.style.display='none';} +t.on("click",this['on'+D+'Click'],this,{preventDefault:true});t.addClassOnOver('x-form-trigger-over');t.addClassOnClick('x-form-trigger-click');},this);this.triggers=ts.elements;},onTrigger1Click:Roo.emptyFn,onTrigger2Click:Roo.emptyFn}); +Roo.form.TextArea=function(A){Roo.form.TextArea.superclass.constructor.call(this,A);if(this.minHeight!==undefined){this.growMin=this.minHeight;}if(this.maxHeight!==undefined){this.growMax=this.maxHeight;}};Roo.extend(Roo.form.TextArea,Roo.form.TextField,{growMin:60,growMax:1000,preventScrollbars:false,onRender:function(ct,A){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} +Roo.form.TextArea.superclass.onRender.call(this,ct,A);if(this.grow){this.textSizeEl=Roo.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden");} this.el.setHeight(this.growMin);}},onDestroy:function(){if(this.textSizeEl){this.textSizeEl.parentNode.removeChild(this.textSizeEl);} Roo.form.TextArea.superclass.onDestroy.call(this);},onKeyUp:function(e){if(!e.isNavKeyPress()||e.getKey()==e.ENTER){this.autoSize();}},autoSize:function(){if(!this.grow||!this.textSizeEl){return;}var el=this.el;var v=el.dom.value;var ts=this.textSizeEl;ts.innerHTML='';ts.appendChild(document.createTextNode(v));v=ts.innerHTML;Roo.fly(ts).setWidth(this.el.getWidth());if(v.length<1){v="  ";}else {if(Roo.isIE){v=v.replace(/\n/g,'

     

    ');} v+=" \n ";} ts.innerHTML=v;var h=Math.min(this.growMax,Math.max(ts.offsetHeight,this.growMin));if(h!=this.lastHeight){this.lastHeight=h;this.el.setHeight(h);this.fireEvent("autosize",this,h);}}}); -Roo.form.NumberField=function(A){Roo.form.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.NumberField,Roo.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",initEvents:function(){Roo.form.NumberField.superclass.initEvents.call(this);var B="0123456789";if(this.allowDecimals){B+=this.decimalSeparator;}if(this.allowNegative){B+="-";} -this.stripCharsRe=new RegExp('[^'+B+']','gi');var C=function(e){var k=e.getKey();if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE )){return;}var c=e.getCharCode();if(B.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",C,this);},validateValue:function(D){if(!Roo.form.NumberField.superclass.validateValue.call(this,D)){return false;}if(D.length<1){return true;}var E=this.parseValue(D);if(isNaN(E)){this.markInvalid(String.format(this.nanText,D));return false;}if(Ethis.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false;}return true;},getValue:function(){return this.fixPrecision(this.parseValue(Roo.form.NumberField.superclass.getValue.call(this)));},parseValue:function(F){F=parseFloat(String(F).replace(this.decimalSeparator,"."));return isNaN(F)?'':F;},fixPrecision:function(G){var H=isNaN(G);if(!this.allowDecimals||this.decimalPrecision==-1||H||!G){return H?'':G;}return parseFloat(G).toFixed(this.decimalPrecision);},setValue:function(v){Roo.form.NumberField.superclass.setValue.call(this,String(v).replace(".",this.decimalSeparator));},decimalPrecisionFcn:function(v){return Math.floor(v);},beforeBlur:function(){var v=this.parseValue(this.getRawValue());if(v){this.setValue(this.fixPrecision(v));}}}); +Roo.form.NumberField=function(A){Roo.form.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.NumberField,Roo.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",initEvents:function(){Roo.form.NumberField.superclass.initEvents.call(this);var A="0123456789";if(this.allowDecimals){A+=this.decimalSeparator;}if(this.allowNegative){A+="-";} +this.stripCharsRe=new RegExp('[^'+A+']','gi');var B=function(e){var k=e.getKey();if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE )){return;}var c=e.getCharCode();if(A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",B,this);},validateValue:function(A){if(!Roo.form.NumberField.superclass.validateValue.call(this,A)){return false;}if(A.length<1){return true;}var B=this.parseValue(A);if(isNaN(B)){this.markInvalid(String.format(this.nanText,A));return false;}if(Bthis.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false;}return true;},getValue:function(){return this.fixPrecision(this.parseValue(Roo.form.NumberField.superclass.getValue.call(this)));},parseValue:function(A){A=parseFloat(String(A).replace(this.decimalSeparator,"."));return isNaN(A)?'':A;},fixPrecision:function(A){var B=isNaN(A);if(!this.allowDecimals||this.decimalPrecision==-1||B||!A){return B?'':A;}return parseFloat(A).toFixed(this.decimalPrecision);},setValue:function(v){Roo.form.NumberField.superclass.setValue.call(this,String(v).replace(".",this.decimalSeparator));},decimalPrecisionFcn:function(v){return Math.floor(v);},beforeBlur:function(){var v=this.parseValue(this.getRawValue());if(v){this.setValue(this.fixPrecision(v));}}}); Roo.form.DateField=function(A){Roo.form.DateField.superclass.constructor.call(this,A);this.addEvents({'select':true});if(typeof this.minValue=="string")this.minValue=this.parseDate(this.minValue);if(typeof this.maxValue=="string")this.maxValue=this.parseDate(this.maxValue);this.ddMatch=null;if(this.disabledDates){var dd=this.disabledDates;var re="(?:";for(var i=0;ithis.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false;}if(this.disabledDays){var day=C.getDay();for(var i=0;ithis.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false;}if(this.disabledDays){var day=A.getDay();for(var i=0;i{'+this.displayField+'}';} -this.view=new Roo.View(this.innerList,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.collapse,this);if(this.resizable){this.resizer=new Roo.Resizable(this.list,{pinned:true,handles:'se'});this.resizer.on('resize',function(r,w,h){this.maxHeight=h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;this.listWidth=w;this.innerList.setWidth(w-this.list.getFrameWidth('lr'));this.restrictHeight();},this);this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom',this.handleHeight+'px');}if(!this.editable){this.editable=true;this.setEditable(false);}},initEvents:function(){Roo.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Roo.KeyNav(this.el,{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else {this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.onViewClick();},"esc":function(e){this.collapse();},"tab":function(e){this.onViewClick(false);return true;},scope:this,doRelay:function(D,E,F){if(F=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);}return true;},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this);}if(this.forceSelection){this.on('blur',this.doForce,this);}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners();}if(this.list){this.list.destroy();}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.collapse,this);} -Roo.form.ComboBox.superclass.onDestroy.call(this);},fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){Roo.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var lw=Math.max(w,this.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},setEditable:function(D){if(D==this.editable){return;} -this.editable=D;if(!D){this.el.dom.setAttribute('readOnly',true);this.el.on('mousedown',this.onTriggerClick,this);this.el.addClass('x-combo-noedit');}else {this.el.dom.setAttribute('readOnly',false);this.el.un('mousedown',this.onTriggerClick,this);this.el.removeClass('x-combo-noedit');}},onBeforeLoad:function(){if(!this.hasFocus){return;} -this.innerList.update(this.loadingText?'
    '+this.loadingText+'
    ':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){if(!this.hasFocus){return;}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select();}if(!this.selectByValue(this.value,true)){this.select(0,true);}}else {this.selectNext();if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE ){this.taTask.delay(this.typeAheadDelay);}}}else {this.onEmptyResults();}},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var newValue=r.data[this.displayField];var len=newValue.length;var selStart=this.getRawValue().length;if(selStart!=len){this.setRawValue(newValue);this.selectText(selStart,newValue.length);}}},onSelect:function(E,F){if(this.fireEvent('beforeselect',this,E,F)!==false){this.setFromData(F>-1?E.data:false);this.collapse();this.fireEvent('select',this,E,F);}},getValue:function(){if(this.valueField){return typeof this.value!='undefined'?this.value:'';}else {return Roo.form.ComboBox.superclass.getValue.call(this);}},clearValue:function(){if(this.hiddenField){this.hiddenField.value='';} -this.value='';this.setRawValue('');this.lastSelectionText='';this.applyEmptyText();},setValue:function(v){var G=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){G=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){G=this.valueNotFoundText;}} -this.lastSelectionText=G;if(this.hiddenField){this.hiddenField.value=v;} -Roo.form.ComboBox.superclass.setValue.call(this,G);this.value=v;},lastData:false,setFromData:function(o){var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else {console.log('no value field set for '+this.name);}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];}if(this.hiddenField){this.hiddenField.value=vv;this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return;} -this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.originalValue);this.clearInvalid();this.lastData=false;},findRecord:function(H,I){var J;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[H]==I){J=r;return false;}});}return J;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var K=this.view.findItemFromChild(t);if(K){var F=this.view.indexOf(K);this.select(F,false);}},onViewClick:function(L){var M=this.view.getSelectedIndexes()[0];var r=this.store.getAt(M);if(r){this.onSelect(r,M);}if(L!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var N=this.innerList.dom;var h=Math.max(N.clientHeight,N.offsetHeight,N.scrollHeight);this.innerList.setHeight(h0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;this.applyEmptyText();}},doQuery:function(q,R){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:R,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;} -q=qe.query;R=qe.forceAll;if(R===true||(q.length>=this.minChars)){if(this.lastQuery!=q){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;if(R){this.store.clearFilter();}else {this.store.filter(this.displayField,q);} +this.selectedIndex=-1;if(this.mode=='local'){if(A.queryDelay===undefined){this.queryDelay=10;}if(A.minChars===undefined){this.minChars=0;}}};Roo.extend(Roo.form.ComboBox,Roo.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listWidth:undefined,displayField:undefined,valueField:undefined,hiddenName:undefined,listClass:'',selectedClass:'x-combo-selected',triggerClass:'x-form-arrow-trigger',shadow:'sides',listAlign:'tl-bl?',maxHeight:300,triggerAction:'query',minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:'query',loadingText:'Loading...',resizable:false,handleHeight:8,editable:true,allQuery:'',mode:'remote',minListWidth:70,forceSelection:false,typeAheadDelay:250,valueNotFoundText:undefined,blockFocus:false,disableClear:false,onRender:function(ct,A){Roo.form.ComboBox.superclass.onRender.call(this,ct,A);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var B='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[B,this.listClass].join(' '),constrain:false});var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:B+'-hd',html:this.title});this.assetHeight+=this.header.getHeight();} +this.innerList=this.list.createChild({cls:B+'-inner'});this.innerList.on('mouseover',this.onViewOver,this);this.innerList.on('mousemove',this.onViewMove,this);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));if(this.allowBlank&&!this.pageSize&&!this.disableClear){this.footer=this.list.createChild({cls:B+'-ft'});this.pageTb=new Roo.Toolbar(this.footer);}if(this.pageSize){this.footer=this.list.createChild({cls:B+'-ft'});this.pageTb=new Roo.PagingToolbar(this.footer,this.store,{pageSize:this.pageSize});}if(this.pageTb&&this.allowBlank&&!this.disableClear){var _this=this;this.pageTb.add(new Roo.Toolbar.Fill(),{cls:'x-btn-icon x-btn-clear',text:' ',handler:function(){_this.collapse();_this.clearValue();_this.onSelect(false,-1);}});}if(this.footer){this.assetHeight+=this.footer.getHeight();}if(!this.tpl){this.tpl='
    {'+this.displayField+'}
    ';} +this.view=new Roo.View(this.innerList,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.collapse,this);if(this.resizable){this.resizer=new Roo.Resizable(this.list,{pinned:true,handles:'se'});this.resizer.on('resize',function(r,w,h){this.maxHeight=h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;this.listWidth=w;this.innerList.setWidth(w-this.list.getFrameWidth('lr'));this.restrictHeight();},this);this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom',this.handleHeight+'px');}if(!this.editable){this.editable=true;this.setEditable(false);}},initEvents:function(){Roo.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Roo.KeyNav(this.el,{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else {this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.onViewClick();},"esc":function(e){this.collapse();},"tab":function(e){this.onViewClick(false);return true;},scope:this,doRelay:function(A,B,C){if(C=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);}return true;},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this);}if(this.forceSelection){this.on('blur',this.doForce,this);}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners();}if(this.list){this.list.destroy();}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.collapse,this);} +Roo.form.ComboBox.superclass.onDestroy.call(this);},fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){Roo.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var lw=Math.max(w,this.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},setEditable:function(A){if(A==this.editable){return;} +this.editable=A;if(!A){this.el.dom.setAttribute('readOnly',true);this.el.on('mousedown',this.onTriggerClick,this);this.el.addClass('x-combo-noedit');}else {this.el.dom.setAttribute('readOnly',false);this.el.un('mousedown',this.onTriggerClick,this);this.el.removeClass('x-combo-noedit');}},onBeforeLoad:function(){if(!this.hasFocus){return;} +this.innerList.update(this.loadingText?'
    '+this.loadingText+'
    ':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){if(!this.hasFocus){return;}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select();}if(!this.selectByValue(this.value,true)){this.select(0,true);}}else {this.selectNext();if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE ){this.taTask.delay(this.typeAheadDelay);}}}else {this.onEmptyResults();}},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var newValue=r.data[this.displayField];var len=newValue.length;var selStart=this.getRawValue().length;if(selStart!=len){this.setRawValue(newValue);this.selectText(selStart,newValue.length);}}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromData(B>-1?A.data:false);this.collapse();this.fireEvent('select',this,A,B);}},getValue:function(){if(this.valueField){return typeof this.value!='undefined'?this.value:'';}else {return Roo.form.ComboBox.superclass.getValue.call(this);}},clearValue:function(){if(this.hiddenField){this.hiddenField.value='';} +this.value='';this.setRawValue('');this.lastSelectionText='';this.applyEmptyText();},setValue:function(v){var A=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){A=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){A=this.valueNotFoundText;}} +this.lastSelectionText=A;if(this.hiddenField){this.hiddenField.value=v;} +Roo.form.ComboBox.superclass.setValue.call(this,A);this.value=v;},lastData:false,setFromData:function(o){var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else {console.log('no value field set for '+this.name);}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];}if(this.hiddenField){this.hiddenField.value=vv;this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return;} +this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.originalValue);this.clearInvalid();this.lastData=false;},findRecord:function(A,B){var C;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;return false;}});}return C;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var A=this.view.findItemFromChild(t);if(A){var index=this.view.indexOf(A);this.select(index,false);}},onViewClick:function(A){var B=this.view.getSelectedIndexes()[0];var r=this.store.getAt(B);if(r){this.onSelect(r,B);}if(A!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var A=this.innerList.dom;var h=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight);this.innerList.setHeight(h0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;this.applyEmptyText();}},doQuery:function(q,A){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:A,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;} +q=qe.query;A=qe.forceAll;if(A===true||(q.length>=this.minChars)){if(this.lastQuery!=q){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;if(A){this.store.clearFilter();}else {this.store.filter(this.displayField,q);} this.onLoad();}else {this.store.baseParams[this.queryParam]=q;this.store.load({params:this.getParams(q)});this.expand();}}else {this.selectedIndex=-1;this.onLoad();}}},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize;}return p;},collapse:function(){if(!this.isExpanded()){return;} this.list.hide();Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);this.fireEvent('collapse',this);},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.list)){this.collapse();}},expand:function(){if(this.isExpanded()||!this.hasFocus){return;} this.list.alignTo(this.el,this.listAlign);this.list.show();Roo.get(document).on('mousedown',this.collapseIf,this);Roo.get(document).on('mousewheel',this.collapseIf,this);this.fireEvent('expand',this);},onTriggerClick:function(){if(this.disabled){return;}if(this.isExpanded()){this.collapse();if(!this.blockFocus){this.el.focus();}}else {this.hasFocus=true;if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);}else {this.doQuery(this.getRawValue());}if(!this.blockFocus){this.el.focus();}}}}); -Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"},boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this);},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,B){Roo.form.Checkbox.superclass.onRender.call(this,ct,B);this.wrap=this.el.wrap({cls:'x-menu-check-item '});var C=this.wrap.createChild({tag:'img',cls:'x-menu-item-icon',style:'margin: 0px;',src:Roo.BLANK_IMAGE_URL});this.viewEl=C;this.wrap.on('click',this.onClick,this);this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});} -this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff;}return this.valueOff;},onClick:function(){this.setChecked(!this.checked);},setValue:function(v,D){this.setChecked(String(v)===String(this.inputValue),D);},setChecked:function(E,F){if(this.inSetChecked){this.checked=E;return;}if(this.wrap){this.wrap[E?'addClass':'removeClass']('x-menu-item-checked');} -this.checked=E;if(F!==true){this.fireEvent('checkchange',this,E);} -this.inSetChecked=true;this.el.dom.value=E?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;} +Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"},boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo.form.Checkbox.superclass.initEvents.call(this);this.el.on("click",this.onClick,this);this.el.on("change",this.onClick,this);},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-menu-check-item '});var B=this.wrap.createChild({tag:'img',cls:'x-menu-item-icon',style:'margin: 0px;',src:Roo.BLANK_IMAGE_URL});this.viewEl=B;this.wrap.on('click',this.onClick,this);this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});} +this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff;}return this.valueOff;},onClick:function(){this.setChecked(!this.checked);},setValue:function(v,A){this.setChecked(String(v)===String(this.inputValue),A);},setChecked:function(A,B){if(this.inSetChecked){this.checked=A;return;}if(this.wrap){this.wrap[A?'addClass':'removeClass']('x-menu-item-checked');} +this.checked=A;if(B!==true){this.fireEvent('checkchange',this,A);} +this.inSetChecked=true;this.el.dom.value=A?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;} this.setValue(this.el.dom.value);},onDestroy:function(){if(this.viewEl){Roo.get(this.viewEl).remove();} Roo.form.Checkbox.superclass.onDestroy.call(this);}}); Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.form.Radio,Roo.form.Checkbox,{inputType:'radio',getGroupValue:function(){return this.el.up('form').child('input[name='+this.el.dom.name+']:checked',true).value;}}); -Roo.form.HtmlEditor=Roo.extend(Roo.form.Field,{toolbars:false,createLinkText:'Please enter the URL for the link:',defaultLinkValue:'http:/'+'/',frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true})},createToolbar:function(A){if(!A.toolbars||!A.toolbars.length){A.toolbars=[new Roo.form.HtmlEditor.ToolbarStandard()];}for(var i=0;i';},onRender:function(ct,B){Roo.form.HtmlEditor.superclass.onRender.call(this,ct,B);this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')} -this.wrap=this.el.wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.frameId=Roo.id();this.createToolbar(this);var C=this.wrap.createChild({tag:'iframe',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"});this.iframe=C.dom;this.assignDocWin();this.doc.designMode='on';this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var D={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;} -Roo.TaskMgr.stop(D);this.initEditor.defer(10,this);}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(D);if(!this.width){this.setSize(this.el.getSize());}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));this.iframe.style.width=aw+'px';}if(typeof h=='number'){var tbh=0;for(var i=0;i5){if(Roo.isSafari){G=G.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(G==' '){G='';}return G;},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var G=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs.match(/text-align:(.*?);/i);if(m&&m[1]){G='
    '+G+'
    ';}} -G=this.cleanHtml(G);if(this.fireEvent('beforesync',this,G)!==false){this.el.dom.value=G;this.fireEvent('sync',this,G);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value;if(v.length<1){v=' ';}if(this.fireEvent('beforepush',this,v)!==false){(this.doc.body||this.doc.documentElement).innerHTML=v;this.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else {this.el.focus();}},assignDocWin:function(){var H=this.iframe;if(Roo.isIE){this.doc=H.contentWindow.document;this.win=H.contentWindow;}else {this.doc=(H.contentDocument||Roo.get(this.frameId).dom.document);this.win=Roo.get(this.frameId).dom.contentWindow;}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var I=(this.doc.body||this.doc.documentElement);var ss=this.el.getStyles('font-size','background-image','background-repeat');ss['background-attachment']='fixed';I.bgProperties='fixed';Roo.DomHelper.applyStyles(I,ss);Roo.EventManager.on(this.doc,{'mousedown':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.applyCommand,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);} +Roo.form.HtmlEditor=Roo.extend(Roo.form.Field,{toolbars:false,createLinkText:'Please enter the URL for the link:',defaultLinkValue:'http:/'+'/',frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true})},createToolbar:function(A){if(!A.toolbars||!A.toolbars.length){A.toolbars=[new Roo.form.HtmlEditor.ToolbarStandard()];}for(var i=0;i';},onRender:function(ct,A){Roo.form.HtmlEditor.superclass.onRender.call(this,ct,A);this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')} +this.wrap=this.el.wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.frameId=Roo.id();this.createToolbar(this);var B=this.wrap.createChild({tag:'iframe',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"});this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on';this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;} +Roo.TaskMgr.stop(C);this.initEditor.defer(10,this);}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);if(!this.width){this.setSize(this.el.getSize());}},onResize:function(w,h){Roo.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.el.setWidth(this.adjustWidth('textarea',aw));this.iframe.style.width=aw+'px';}if(typeof h=='number'){var tbh=0;for(var i=0;i5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A==' '){A='';}return A;},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var html=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs.match(/text-align:(.*?);/i);if(m&&m[1]){html='
    '+html+'
    ';}} +html=this.cleanHtml(html);if(this.fireEvent('beforesync',this,html)!==false){this.el.dom.value=html;this.fireEvent('sync',this,html);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value;if(v.length<1){v=' ';}if(this.fireEvent('beforepush',this,v)!==false){(this.doc.body||this.doc.documentElement).innerHTML=v;this.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else {this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else {this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=Roo.get(this.frameId).dom.contentWindow;}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);var ss=this.el.getStyles('font-size','background-image','background-repeat');ss['background-attachment']='fixed';A.bgProperties='fixed';Roo.DomHelper.applyStyles(A,ss);Roo.EventManager.on(this.doc,{'mousedown':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.applyCommand,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);} this.initialized=true;this.fireEvent('initialize',this);this.pushValue();},onDestroy:function(){if(this.rendered){for(var i=0;i48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];} -v=Math.max(1,v+K);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.fireEvent('editorevent',this,e);this.syncValue();},insertTag:function(tg){this.execCmd("formatblock",tg);},insertText:function(L){range=this.createRange();range.deleteContents();range.insertNode(this.doc.createTextNode(L));},relayBtnCmd:function(M){this.relayCmd(M.cmd);},relayCmd:function(N,O){this.win.focus();this.execCmd(N,O);this.fireEvent('editorevent',this);this.deferFocus();},execCmd:function(P,Q){this.doc.execCommand(P,false,Q===undefined?null:Q);this.syncValue();},applyCommand:function(e){if(e.ctrlKey){var c=e.getCharCode(),P;if(c>0){c=String.fromCharCode(c);switch(c){case 'b':P='bold';break;case 'i':P='italic';break;case 'u':P='underline';break;}if(P){this.win.focus();this.execCmd(P);this.deferFocus();e.preventDefault();}}}},insertAtCursor:function(R){if(!this.activated){return;}if(Roo.isIE){this.win.focus();var r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML(R);this.syncValue();this.deferFocus();}}else if(Roo.isGecko||Roo.isOpera){this.win.focus();this.execCmd('InsertHTML',R);this.deferFocus();}else if(Roo.isSafari){this.execCmd('InsertText',R);this.deferFocus();}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}}else if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var target=r.parentElement();if(!target||target.tagName.toLowerCase()!='li'){e.stopEvent();r.pasteHTML('
    ');r.collapse(false);r.select();}}}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    ');this.deferFocus();}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;} -a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var S=this.createRange(this.getSelection());if(Roo.isIE){var parent=S.parentElement();while(true){var testRange=S.duplicate();testRange.moveToElementText(parent);if(testRange.inRange(S)){break;}if((parent.nodeType!=1)||(parent.tagName.toLowerCase()=='body')){break;} -parent=parent.parentElement;}return parent;}var ar=S.endContainer.childNodes;if(!ar.length){ar=S.commonAncestorContainer.childNodes;}var T=[];var U=[];var V=false;for(var i=0;i0)){U.push(ar[i]);continue;}if(!this.rangeIntersectsNode(S,ar[i])||(this.rangeCompareNode(S,ar[i])==0)){continue;} -V=true;}if(!T.length&&U.length){T=U;}if(V||!T.length||(T.length>1)){return false;}return T[0];},createRange:function(W){if(typeof W!="undefined"){try{return W.getRangeAt?W.getRangeAt(0):W.createRange();}catch(e){return this.doc.createRange();}}else {return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var X=Roo.isIE?this.doc.selection:this.win.getSelection();var Y=this.createRange(X);try{var p=Y.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(Z,b){var d=b.ownerDocument.createRange();try{d.selectNode(b);}catch(e){nodeRange.selectNodeContents(node);}return Z.compareBoundaryPoints(Range.END_TO_START,d)==-1&&Z.compareBoundaryPoints(Range.START_TO_END,d)==1;},rangeCompareNode:function(f,g){var j=g.ownerDocument.createRange();try{j.selectNode(g);}catch(e){nodeRange.selectNodeContents(node);}var k=f.compareBoundaryPoints(Range.START_TO_START,j)==1;var l=f.compareBoundaryPoints(Range.END_TO_END,j)==-1;if(k&&!l)return 0;if(!k&&l)return 1;if(k&&l)return 2;return 3;}}); +this.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10);if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];} +v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.fireEvent('editorevent',this,e);this.syncValue();},insertTag:function(tg){this.execCmd("formatblock",tg);},insertText:function(A){range=this.createRange();range.deleteContents();range.insertNode(this.doc.createTextNode(A));},relayBtnCmd:function(A){this.relayCmd(A.cmd);},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.fireEvent('editorevent',this);this.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);this.syncValue();},applyCommand:function(e){if(e.ctrlKey){var c=e.getCharCode(),cmd;if(c>0){c=String.fromCharCode(c);switch(c){case 'b':cmd='bold';break;case 'i':cmd='italic';break;case 'u':cmd='underline';break;}if(cmd){this.win.focus();this.execCmd(cmd);this.deferFocus();e.preventDefault();}}}},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isIE){this.win.focus();var r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML(A);this.syncValue();this.deferFocus();}}else if(Roo.isGecko||Roo.isOpera){this.win.focus();this.execCmd('InsertHTML',A);this.deferFocus();}else if(Roo.isSafari){this.execCmd('InsertText',A);this.deferFocus();}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}}else if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var target=r.parentElement();if(!target||target.tagName.toLowerCase()!='li'){e.stopEvent();r.pasteHTML('
    ');r.collapse(false);r.select();}}}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    ');this.deferFocus();}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;} +a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var A=this.createRange(this.getSelection());if(Roo.isIE){var parent=A.parentElement();while(true){var testRange=A.duplicate();testRange.moveToElementText(parent);if(testRange.inRange(A)){break;}if((parent.nodeType!=1)||(parent.tagName.toLowerCase()=='body')){break;} +parent=parent.parentElement;}return parent;}var ar=A.endContainer.childNodes;if(!ar.length){ar=A.commonAncestorContainer.childNodes;}var B=[];var C=[];var D=false;for(var i=0;i0)){C.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;} +D=true;}if(!B.length&&C.length){B=C;}if(D||!B.length||(B.length>1)){return false;}return B[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else {return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(node);}return A.compareBoundaryPoints(Range.END_TO_START,C)==-1&&A.compareBoundaryPoints(Range.START_TO_END,C)==1;},rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){nodeRange.selectNodeContents(node);}var D=A.compareBoundaryPoints(Range.START_TO_START,C)==1;var E=A.compareBoundaryPoints(Range.END_TO_END,C)==-1;if(D&&!E)return 0;if(!D&&E)return 1;if(D&&E)return 2;return 3;}}); Roo.form.HtmlEditor.ToolbarStandard=function(A){Roo.apply(this,A);} -Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,{tb:false,rendered:false,editor:false,disable:false,fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],specialChars:["©","®","™","£","…","÷","€","°"],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"]],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(B){this.editor=B;var C=B.frameId;var D=this;function E(id,G,H){var I=C+'-'+id;return {id:I,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:G!==false,scope:B,handler:H||B.relayBtnCmd,clickEvent:'mousedown',tooltip:D.buttonTips[id]||undefined,tabIndex:-1};}var tb=new Roo.Toolbar(B.wrap.dom.firstChild);this.tb=tb;tb.el.on('click',function(e){e.preventDefault();});if(!this.disable.font&&!Roo.isSafari){};if(!this.disable.formats){this.formatCombo=new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'tag',fields:['tag'],data:this.formats}),blockFocus:true,displayField:'tag',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Add tag',selectOnFocus:true,width:135,listeners:{'select':function(c,r,i){B.insertTag(r.get('tag'));B.focus();}}});tb.addField(this.formatCombo);}if(!this.disable.format){tb.add(E('bold'),E('italic'),E('underline'));};if(!this.disable.fontSize){tb.add('-',E('increasefontsize',false,B.adjustFont),E('decreasefontsize',false,B.adjustFont));};if(this.disable.colors){tb.add('-',{id:B.frameId+'-forecolor',cls:'x-btn-icon x-edit-forecolor',clickEvent:'mousedown',tooltip:this.buttonTips['forecolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({allowReselect:true,focus:Roo.emptyFn,value:'000000',plain:true,selectHandler:function(cp,G){B.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+G:G);B.deferFocus();},scope:B,clickEvent:'mousedown'})},{id:B.frameId+'backcolor',cls:'x-btn-icon x-edit-backcolor',clickEvent:'mousedown',tooltip:this.buttonTips['backcolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({focus:Roo.emptyFn,value:'FFFFFF',plain:true,allowReselect:true,selectHandler:function(cp,H){if(Roo.isGecko){B.execCmd('useCSS',false);B.execCmd('hilitecolor',H);B.execCmd('useCSS',true);B.deferFocus();}else {B.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+H:H);B.deferFocus();}},scope:B,clickEvent:'mousedown'})});};if(!this.disable.alignments){tb.add('-',E('justifyleft'),E('justifycenter'),E('justifyright'));};if(!this.disable.links){tb.add('-',E('createlink',false,B.createLink));};if(!this.disable.lists){tb.add('-',E('insertorderedlist'),E('insertunorderedlist'));}if(!this.disable.sourceEdit){tb.add('-',E('sourceedit',true,function(G){this.toggleSourceEdit(G.pressed);}));}var F={};if(!this.disable.special){F={text:"©",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i':'>'),ff,'');}return K.join('');},toggleSourceEdit:function(L){if(L===undefined){L=!this.sourceEditMode;} -this.sourceEditMode=L===true;var M=this.tb.items.get(this.editor.frameId+'-sourceedit');if(M.pressed!==this.editor.sourceEditMode){M.toggle(this.editor.sourceEditMode);return;}if(this.sourceEditMode){this.tb.items.each(function(N){if(N.cmd!='sourceedit'){N.disable();}});}else {if(this.initialized){this.tb.items.each(function(O){O.enable();});}} -this.editor.toggleSourceEdit(L);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(N){if(N.menu){N.menu.removeAll();if(N.menu.el){N.menu.el.destroy();}} -N.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(N){N.enable();});}}); +Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,{tb:false,rendered:false,editor:false,disable:false,fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],specialChars:["©","®","™","£","…","÷","€","°"],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"]],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function D(id,F,G){var H=B+'-'+id;return {id:H,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:F!==false,scope:A,handler:G||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var tb=new Roo.Toolbar(A.wrap.dom.firstChild);this.tb=tb;tb.el.on('click',function(e){e.preventDefault();});if(!this.disable.font&&!Roo.isSafari){};if(!this.disable.formats){this.formatCombo=new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'tag',fields:['tag'],data:this.formats}),blockFocus:true,displayField:'tag',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Add tag',selectOnFocus:true,width:135,listeners:{'select':function(c,r,i){A.insertTag(r.get('tag'));A.focus();}}});tb.addField(this.formatCombo);}if(!this.disable.format){tb.add(D('bold'),D('italic'),D('underline'));};if(!this.disable.fontSize){tb.add('-',D('increasefontsize',false,A.adjustFont),D('decreasefontsize',false,A.adjustFont));};if(this.disable.colors){tb.add('-',{id:A.frameId+'-forecolor',cls:'x-btn-icon x-edit-forecolor',clickEvent:'mousedown',tooltip:this.buttonTips['forecolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({allowReselect:true,focus:Roo.emptyFn,value:'000000',plain:true,selectHandler:function(cp,F){A.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+F:F);A.deferFocus();},scope:A,clickEvent:'mousedown'})},{id:A.frameId+'backcolor',cls:'x-btn-icon x-edit-backcolor',clickEvent:'mousedown',tooltip:this.buttonTips['backcolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({focus:Roo.emptyFn,value:'FFFFFF',plain:true,allowReselect:true,selectHandler:function(cp,F){if(Roo.isGecko){A.execCmd('useCSS',false);A.execCmd('hilitecolor',F);A.execCmd('useCSS',true);A.deferFocus();}else {A.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+F:F);A.deferFocus();}},scope:A,clickEvent:'mousedown'})});};if(!this.disable.alignments){tb.add('-',D('justifyleft'),D('justifycenter'),D('justifyright'));};if(!this.disable.links){tb.add('-',D('createlink',false,A.createLink));};if(!this.disable.lists){tb.add('-',D('insertorderedlist'),D('insertunorderedlist'));}if(!this.disable.sourceEdit){tb.add('-',D('sourceedit',true,function(F){this.toggleSourceEdit(F.pressed);}));}var E={};if(!this.disable.special){E={text:"©",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i':'>'),ff,'');}return A.join('');},toggleSourceEdit:function(A){if(A===undefined){A=!this.sourceEditMode;} +this.sourceEditMode=A===true;var B=this.tb.items.get(this.editor.frameId+'-sourceedit');if(B.pressed!==this.editor.sourceEditMode){B.toggle(this.editor.sourceEditMode);return;}if(this.sourceEditMode){this.tb.items.each(function(C){if(C.cmd!='sourceedit'){C.disable();}});}else {if(this.initialized){this.tb.items.each(function(C){C.enable();});}} +this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}} +A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});}}); Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);} -Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20},width:{title:"Width",width:40},height:{title:"Height",width:40},border:{title:"Border",width:20}},'TD':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["center"],["right"],["justify"],["char"]],width:40},valign:{title:"Valign",opts:[[""],["top"],["middle"],["bottom"],["baseline"]],width:40},colspan:{title:"Colspan",width:20}},'INPUT':{name:{title:"name",width:120},value:{title:"Value",width:120},width:{title:"Width",width:40}},'LABEL':{'for':{title:"For",width:120}},'TEXTAREA':{name:{title:"name",width:120},rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}},'SELECT':{name:{title:"name",width:120},selectoptions:{title:"Options",width:200}},'BODY':{title:{title:"title",width:120,disabled:true}}};Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,{tb:false,rendered:false,editor:false,disable:false,toolbars:false,init:function(B){this.editor=B;var C=B.frameId;var D=this;function E(id,G,H){var I=C+'-'+id;return {id:I,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:G!==false,scope:B,handler:H||B.relayBtnCmd,clickEvent:'mousedown',tooltip:D.buttonTips[id]||undefined,tabIndex:-1};}var F=B.wrap.createChild({tag:'div'},B.wrap.dom.firstChild.nextSibling,true);var ty=Roo.form.HtmlEditor.ToolbarContext.types;this.toolbars={};for(var i in ty){this.toolbars[i]=this.buildToolbar(ty[i],i);} -this.tb=this.toolbars.BODY;this.tb.el.show();this.rendered=true;B.on('editorevent',this.updateToolbar,this);},updateToolbar:function(){if(!this.editor.activated){this.editor.onFirstFocus();return;}var G=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;var H=G.length?(G[0]?G[0]:G[1]):this.editor.doc.body;H=H?H:this.editor.doc.body;H=H.tagName.length?H:this.editor.doc.body;var tn=H.tagName.toUpperCase();H=typeof(ty[tn])!='undefined'?H:this.editor.doc.body;tn=H.tagName.toUpperCase();if(this.tb.name==tn){return;} -this.tb.el.hide();this.tb=this.toolbars[tn];this.tb.el.show();this.tb.fields.each(function(e){e.setValue(H.getAttribute(e.name));});this.tb.selectedNode=H;Roo.menu.MenuMgr.hideAll();},onDestroy:function(){if(this.rendered){this.tb.items.each(function(I){if(I.menu){I.menu.removeAll();if(I.menu.el){I.menu.el.destroy();}} -I.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(I){I.enable();});},buildToolbar:function(I,nm){var J=this.editor;var K=J.wrap.createChild({tag:'div'},J.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(K);tb.add(nm+": ");for(var i in I){var item=I[i];tb.add(item.title+": ");if(item.opts){tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val'],data:item.opts}),name:i,displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:item.width?item.width:130,listeners:{'select':function(c,r,i){tb.selectedNode.setAttribute(c.name,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;} +Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20},width:{title:"Width",width:40},height:{title:"Height",width:40},border:{title:"Border",width:20}},'TD':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["center"],["right"],["justify"],["char"]],width:40},valign:{title:"Valign",opts:[[""],["top"],["middle"],["bottom"],["baseline"]],width:40},colspan:{title:"Colspan",width:20}},'INPUT':{name:{title:"name",width:120},value:{title:"Value",width:120},width:{title:"Width",width:40}},'LABEL':{'for':{title:"For",width:120}},'TEXTAREA':{name:{title:"name",width:120},rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}},'SELECT':{name:{title:"name",width:120},selectoptions:{title:"Options",width:200}},'BODY':{title:{title:"title",width:120,disabled:true}}};Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,{tb:false,rendered:false,editor:false,disable:false,toolbars:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function D(id,F,G){var H=B+'-'+id;return {id:H,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:F!==false,scope:A,handler:G||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var E=A.wrap.createChild({tag:'div'},A.wrap.dom.firstChild.nextSibling,true);var ty=Roo.form.HtmlEditor.ToolbarContext.types;this.toolbars={};for(var i in ty){this.toolbars[i]=this.buildToolbar(ty[i],i);} +this.tb=this.toolbars.BODY;this.tb.el.show();this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(){if(!this.editor.activated){this.editor.onFirstFocus();return;}var A=this.editor.getAllAncestors();var ty=Roo.form.HtmlEditor.ToolbarContext.types;var B=A.length?(A[0]?A[0]:A[1]):this.editor.doc.body;B=B?B:this.editor.doc.body;B=B.tagName.length?B:this.editor.doc.body;var tn=B.tagName.toUpperCase();B=typeof(ty[tn])!='undefined'?B:this.editor.doc.body;tn=B.tagName.toUpperCase();if(this.tb.name==tn){return;} +this.tb.el.hide();this.tb=this.toolbars[tn];this.tb.el.show();this.tb.fields.each(function(e){e.setValue(B.getAttribute(e.name));});this.tb.selectedNode=B;Roo.menu.MenuMgr.hideAll();},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}} +A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});},buildToolbar:function(A,nm){var B=this.editor;var C=B.wrap.createChild({tag:'div'},B.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(C);tb.add(nm+": ");for(var i in A){var item=A[i];tb.add(item.title+": ");if(item.opts){tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val'],data:item.opts}),name:i,displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:item.width?item.width:130,listeners:{'select':function(c,r,i){tb.selectedNode.setAttribute(c.name,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;} tb.addField(new Roo.form.TextField({name:i,width:item.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.name,nv);}}}));} tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();tb.name=nm;return tb;}}); Roo.form.BasicForm=function(el,A){this.allItems=[];this.childForms=[];Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);} -Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:undefined,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var B=true;this.items.each(function(f){if(!f.validate()){B=false;}});return B;},isDirty:function(){var C=false;this.items.each(function(f){if(f.isDirty()){C=true;return false;}});return C;},doAction:function(D,E){if(typeof D=='string'){D=new Roo.form.Action.ACTION_TYPES[D](this,E);}if(this.fireEvent('beforeaction',this,D)!==false){this.beforeAction(D);D.run.defer(100,D);}return this;},submit:function(F){this.doAction('submit',F);return this;},load:function(G){this.doAction('load',G);return this;},updateRecord:function(H){H.beginEdit();var fs=H.fields;fs.each(function(f){var I=this.findField(f.name);if(I){H.set(f.name,I.getValue());}},this);H.endEdit();return this;},loadRecord:function(I){this.setValues(I.data);return this;},beforeAction:function(J){var o=J.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.mask(o.waitMsg,'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg,'x-mask-loading');}else {Roo.MessageBox.wait(o.waitMsg,o.waitTitle||this.waitTitle||'Please Wait...');}}},afterAction:function(K,L){this.activeAction=null;var o=K.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else {Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}}if(L){if(o.reset){this.reset();} -Roo.callback(o.success,o.scope,[this,K]);this.fireEvent('actioncomplete',this,K);}else {Roo.callback(o.failure,o.scope,[this,K]);this.fireEvent('actionfailed',this,K);}},findField:function(id){var M=this.items.get(id);if(!M){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){M=f;return false;}});}return M||null;},addForm:function(N){if(this.childForms.indexOf(N)>-1){return;} -this.childForms.push(N);Roo.each(N.allItems,function(fe){if(this.findField(fe.name)){return;}var O=new Roo.form.Hidden({name:fe.name});O.render(this.el);this.add(O);},this);},markInvalid:function(O){if(O instanceof Array){for(var i=0,len=O.length;i-1){return;} +this.childForms.push(A);Roo.each(A.allItems,function(fe){if(this.findField(fe.name)){return;}var B=new Roo.form.Hidden({name:fe.name});B.render(this.el);this.add(B);},this);},markInvalid:function(A){if(A instanceof Array){for(var i=0,len=A.length;i1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return C;},fieldset:function(c){var fs=new Roo.form.FieldSet(c);this.start(fs);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return fs;},container:function(c){var l=new Roo.form.Layout(c);this.start(l);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return l;},start:function(c){Roo.applyIf(c,{'labelAlign':this.active.labelAlign,'labelWidth':this.active.labelWidth,'itemCls':this.active.itemCls});this.active.stack.push(c);c.ownerCt=this.active;this.active=c;return this;},end:function(){if(this.active==this.root){return this;} -this.active=this.active.ownerCt;return this;},add:function(){this.active.stack.push.apply(this.active.stack,arguments);this.allItems.push.apply(this.allItems,arguments);var r=[];for(var i=0,a=arguments,len=a.length;i0){Roo.form.Form.superclass.add.apply(this,r);}return this;},findbyId:function(id){var D=false;if(!id){return D;} -Ext.each(this.allItems,function(f){if(f.id==id||f.name==id){D=f;return false;}});return D;},render:function(ct){ct=Roo.get(ct);var o=this.autoCreate||{tag:'form',method:this.method||'POST',id:this.id||Roo.id()};this.initEl(ct.createChild(o));this.root.render(this.el);this.items.each(function(f){f.render('x-form-el-'+f.id);});if(this.buttons.length>0){var tb=this.el.createChild({cls:'x-form-btns-ct',cn:{cls:"x-form-btns x-form-btns-"+this.buttonAlign,html:'
    '}},null,true);var tr=tb.getElementsByTagName('tr')[0];for(var i=0,len=this.buttons.length;i1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return A;},fieldset:function(c){var fs=new Roo.form.FieldSet(c);this.start(fs);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return fs;},container:function(c){var l=new Roo.form.Layout(c);this.start(l);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return l;},start:function(c){Roo.applyIf(c,{'labelAlign':this.active.labelAlign,'labelWidth':this.active.labelWidth,'itemCls':this.active.itemCls});this.active.stack.push(c);c.ownerCt=this.active;this.active=c;return this;},end:function(){if(this.active==this.root){return this;} +this.active=this.active.ownerCt;return this;},add:function(){this.active.stack.push.apply(this.active.stack,arguments);this.allItems.push.apply(this.allItems,arguments);var r=[];for(var i=0,a=arguments,len=a.length;i0){Roo.form.Form.superclass.add.apply(this,r);}return this;},findbyId:function(id){var A=false;if(!id){return A;} +Ext.each(this.allItems,function(f){if(f.id==id||f.name==id){A=f;return false;}});return A;},render:function(ct){ct=Roo.get(ct);var o=this.autoCreate||{tag:'form',method:this.method||'POST',id:this.id||Roo.id()};this.initEl(ct.createChild(o));this.root.render(this.el);this.items.each(function(f){f.render('x-form-el-'+f.id);});if(this.buttons.length>0){var tb=this.el.createChild({cls:'x-form-btns-ct',cn:{cls:"x-form-btns x-form-btns-"+this.buttonAlign,html:'
    '}},null,true);var tr=tb.getElementsByTagName('tr')[0];for(var i=0,len=this.buttons.length;i0){if(!this.fieldTpl){var t=new Roo.Template('
    ','','
    ','
    ','
    ');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.fieldTpl=t;}for(var i=0;i','','
    ','
    ','');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.rowTpl=t;} -this.fieldTpl=this.rowTpl;var J=100;if((this.labelAlign!='top')){if(typeof this.labelWidth=='number'){J=this.labelWidth} -this.padWidth=20+J;} -Roo.form.Column.superclass.onRender.call(this,ct,I);if(this.width){this.el.setWidth(this.width);}if(this.height){this.el.setHeight(this.height);}},renderField:function(f){f.fieldEl=this.fieldTpl.append(this.el,[f.id,f.fieldLabel,f.labelStyle||this.labelStyle||'',this.elementStyle||'',typeof f.labelSeparator=='undefined'?this.labelSeparator:f.labelSeparator,f.itemCls||this.itemCls||'',f.width?f.width+this.padWidth:160+this.padWidth],true);}});Roo.form.FieldSet=function(K){Roo.form.FieldSet.superclass.constructor.call(this,K);};Roo.extend(Roo.form.FieldSet,Roo.form.Layout,{defaultAutoCreate:{tag:'fieldset',cn:{tag:'legend'}},onRender:function(ct,L){Roo.form.FieldSet.superclass.onRender.call(this,ct,L);if(this.legend){this.setLegend(this.legend);}},setLegend:function(M){if(this.rendered){this.el.child('legend').update(M);}}}); +Roo.form.Layout.superclass.constructor.call(this,A);this.stack=[];Roo.each(B,this.addxtype,this);};Roo.extend(Roo.form.Layout,Roo.Component,{clear:true,labelSeparator:':',hideLabels:false,defaultAutoCreate:{tag:'div',cls:'x-form-ct'},isLayout:true,onRender:function(ct,A){if(this.el){this.el=Roo.get(this.el);}else {var cfg=this.getAutoCreate();this.el=ct.createChild(cfg,A);}if(this.style){this.el.applyStyles(this.style);}if(this.labelAlign){this.el.addClass('x-form-label-'+this.labelAlign);}if(this.hideLabels){this.labelStyle="display:none";this.elementStyle="padding-left:0;";}else {if(typeof this.labelWidth=='number'){this.labelStyle="width:"+this.labelWidth+"px;";this.elementStyle="padding-left:"+((this.labelWidth+(typeof this.labelPad=='number'?this.labelPad:5))+'px')+";";}if(this.labelAlign=='top'){this.labelStyle="width:auto;";this.elementStyle="padding-left:0;";}}var B=this.stack;var C=B.length;if(C>0){if(!this.fieldTpl){var t=new Roo.Template('
    ','','
    ','
    ','
    ');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.fieldTpl=t;}for(var i=0;i','','
    ','
    ','');t.disableFormats=true;t.compile();Roo.form.Layout.prototype.rowTpl=t;} +this.fieldTpl=this.rowTpl;var B=100;if((this.labelAlign!='top')){if(typeof this.labelWidth=='number'){B=this.labelWidth} +this.padWidth=20+B;} +Roo.form.Column.superclass.onRender.call(this,ct,A);if(this.width){this.el.setWidth(this.width);}if(this.height){this.el.setHeight(this.height);}},renderField:function(f){f.fieldEl=this.fieldTpl.append(this.el,[f.id,f.fieldLabel,f.labelStyle||this.labelStyle||'',this.elementStyle||'',typeof f.labelSeparator=='undefined'?this.labelSeparator:f.labelSeparator,f.itemCls||this.itemCls||'',f.width?f.width+this.padWidth:160+this.padWidth],true);}});Roo.form.FieldSet=function(A){Roo.form.FieldSet.superclass.constructor.call(this,A);};Roo.extend(Roo.form.FieldSet,Roo.form.Layout,{defaultAutoCreate:{tag:'fieldset',cn:{tag:'legend'}},onRender:function(ct,A){Roo.form.FieldSet.superclass.onRender.call(this,ct,A);if(this.legend){this.setLegend(this.legend);}},setLegend:function(A){if(this.rendered){this.el.child('legend').update(A);}}}); Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;var D=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return {'email':function(v){return C.test(v);},'emailText':'This field should be an e-mail address in the format "user@domain.com"','emailMask':/[a-z0-9_\.\-@]/i,'url':function(v){return D.test(v);},'urlText':'This field should be a URL in the format "http:/'+'/www.domain.com"','alpha':function(v){return A.test(v);},'alphaText':'This field should only contain letters and _','alphaMask':/[a-z_]/i,'alphanum':function(v){return B.test(v);},'alphanumText':'This field should only contain letters, numbers and _','alphanumMask':/[a-z0-9_]/i};}(); -Roo.form.FCKeditor=function(A){Roo.form.FCKeditor.superclass.constructor.call(this,A);this.addEvents({editorinit:true});};Roo.form.FCKeditor.editors={};Roo.extend(Roo.form.FCKeditor,Roo.form.TextArea,{fckconfig:false,toolbarSet:'Basic',basePath:'/fckeditor/',frame:false,value:'',onRender:function(ct,B){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} -Roo.form.FCKeditor.superclass.onRender.call(this,ct,B);Roo.form.FCKeditor.editors[this.getId()]=this;this.replaceTextarea();},getEditor:function(){return this.fckEditor;},setValue:function(C){if(typeof(C)=='undefined'){return;} -Roo.form.FCKeditor.superclass.setValue.apply(this,[C]);if(!this.getEditor()){return;} -this.getEditor().SetData(C);},getValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getValue.call(this);}if(!this.el||!this.getEditor()){return this.value;}var D=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setValue.apply(this,[D]);return Roo.form.FCKeditor.superclass.getValue.call(this);},getRawValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getRawValue.call(this);}if(!this.el||!this.getEditor()){return this.value;return;}var E=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setRawValue.apply(this,[E]);return Roo.form.FCKeditor.superclass.getRawValue.call(this);},setSize:function(w,h){Roo.form.FCKeditor.superclass.setSize.apply(this,[w,h]);this.frame.dom.setAttribute('width',w);this.frame.dom.setAttribute('height',h);this.frame.setSize(w,h);},toggleSourceEdit:function(F){this.el.dom.style.display=F?'':'none';this.frame.dom.style.display=F?'none':'';},focus:function(G){if(this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.focus.call(this);}if(!this.el||!this.getEditor()){this.focus.defer(100,this,[G]);return;}var H=this.getEditor().EditorDocument.getElementsByTagName(G);this.getEditor().Focus();if(H.length){if(!this.getEditor().Selection.GetSelection()){this.focus.defer(100,this,[G]);return;}var r=this.getEditor().EditorDocument.createRange();r.setStart(H[0],0);r.setEnd(H[0],0);this.getEditor().Selection.GetSelection().removeAllRanges();this.getEditor().Selection.GetSelection().addRange(r);this.getEditor().Focus();}},replaceTextarea:function(){if(document.getElementById(this.getId()+'___Frame'))return;var I=document.getElementById(this.getId());var J=document.getElementsByName(this.getId());I.style.display='none';if(I.tabIndex){this.TabIndex=I.tabIndex;} -this._insertHtmlBefore(this._getConfigHtml(),I);this._insertHtmlBefore(this._getIFrameHtml(),I);this.frame=Roo.get(this.getId()+'___Frame')},_getConfigHtml:function(){var K='';for(var o in this.fckconfig){K+=K.length>0?'&':'';K+=encodeURIComponent(o)+'='+encodeURIComponent(this.fckconfig[o]);}return '';},_getIFrameHtml:function(){var L='fckeditor.html';var M=this.basePath+'editor/'+L+'?InstanceName='+encodeURIComponent(this.getId());M+=this.toolbarSet?('&Toolbar='+this.toolbarSet):'';var N='';return N;},_insertHtmlBefore:function(O,P){if(P.insertAdjacentHTML){P.insertAdjacentHTML('beforeBegin',O);}else {var oRange=document.createRange();oRange.setStartBefore(P);var oFragment=oRange.createContextualFragment(O);P.parentNode.insertBefore(oFragment,P);}}});function Q(R){var f=Roo.form.FCKeditor.editors[R.Name];f.fckEditor=R;f.fireEvent('editorinit',f,R);} -Roo.form.GridField=function(A){Roo.form.GridField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.GridField,Roo.form.Field,{width:100,height:50,xgrid:false,defaultAutoCreate:{tag:'input',type:'hidden',autocomplete:'off'},addTitle:false,onResize:function(){Roo.form.Field.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,B){this.style=this.style||'overflow: hidden; border:1px solid #c3daf9;';var C=this.style;delete this.style;Roo.form.DisplayImage.superclass.onRender.call(this,ct,B);this.wrap=this.el.wrap({cls:''});this.viewEl=this.wrap.createChild({tag:'div'});if(C){this.viewEl.applyStyles(C);}if(this.width){this.viewEl.setWidth(this.width);}if(this.height){this.viewEl.setHeight(this.height);} +Roo.form.FCKeditor=function(A){Roo.form.FCKeditor.superclass.constructor.call(this,A);this.addEvents({editorinit:true});};Roo.form.FCKeditor.editors={};Roo.extend(Roo.form.FCKeditor,Roo.form.TextArea,{fckconfig:false,toolbarSet:'Basic',basePath:'/fckeditor/',frame:false,value:'',onRender:function(ct,A){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:300px;height:60px;",autocomplete:"off"};} +Roo.form.FCKeditor.superclass.onRender.call(this,ct,A);Roo.form.FCKeditor.editors[this.getId()]=this;this.replaceTextarea();},getEditor:function(){return this.fckEditor;},setValue:function(A){if(typeof(A)=='undefined'){return;} +Roo.form.FCKeditor.superclass.setValue.apply(this,[A]);if(!this.getEditor()){return;} +this.getEditor().SetData(A);},getValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getValue.call(this);}if(!this.el||!this.getEditor()){return this.value;}var A=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setValue.apply(this,[A]);return Roo.form.FCKeditor.superclass.getValue.call(this);},getRawValue:function(){if(this.frame&&this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.getRawValue.call(this);}if(!this.el||!this.getEditor()){return this.value;return;}var A=this.getEditor().GetData();Roo.form.FCKeditor.superclass.setRawValue.apply(this,[A]);return Roo.form.FCKeditor.superclass.getRawValue.call(this);},setSize:function(w,h){Roo.form.FCKeditor.superclass.setSize.apply(this,[w,h]);this.frame.dom.setAttribute('width',w);this.frame.dom.setAttribute('height',h);this.frame.setSize(w,h);},toggleSourceEdit:function(A){this.el.dom.style.display=A?'':'none';this.frame.dom.style.display=A?'none':'';},focus:function(A){if(this.frame.dom.style.display=='none'){return Roo.form.FCKeditor.superclass.focus.call(this);}if(!this.el||!this.getEditor()){this.focus.defer(100,this,[A]);return;}var B=this.getEditor().EditorDocument.getElementsByTagName(A);this.getEditor().Focus();if(B.length){if(!this.getEditor().Selection.GetSelection()){this.focus.defer(100,this,[A]);return;}var r=this.getEditor().EditorDocument.createRange();r.setStart(B[0],0);r.setEnd(B[0],0);this.getEditor().Selection.GetSelection().removeAllRanges();this.getEditor().Selection.GetSelection().addRange(r);this.getEditor().Focus();}},replaceTextarea:function(){if(document.getElementById(this.getId()+'___Frame'))return;var A=document.getElementById(this.getId());var B=document.getElementsByName(this.getId());A.style.display='none';if(A.tabIndex){this.TabIndex=A.tabIndex;} +this._insertHtmlBefore(this._getConfigHtml(),A);this._insertHtmlBefore(this._getIFrameHtml(),A);this.frame=Roo.get(this.getId()+'___Frame')},_getConfigHtml:function(){var A='';for(var o in this.fckconfig){A+=A.length>0?'&':'';A+=encodeURIComponent(o)+'='+encodeURIComponent(this.fckconfig[o]);}return '';},_getIFrameHtml:function(){var A='fckeditor.html';var B=this.basePath+'editor/'+A+'?InstanceName='+encodeURIComponent(this.getId());B+=this.toolbarSet?('&Toolbar='+this.toolbarSet):'';var C='';return C;},_insertHtmlBefore:function(A,B){if(B.insertAdjacentHTML){B.insertAdjacentHTML('beforeBegin',A);}else {var oRange=document.createRange();oRange.setStartBefore(B);var oFragment=oRange.createContextualFragment(A);B.parentNode.insertBefore(oFragment,B);}}});function FCKeditor_OnComplete(A){var f=Roo.form.FCKeditor.editors[A.Name];f.fckEditor=A;f.fireEvent('editorinit',f,A);} +Roo.form.GridField=function(A){Roo.form.GridField.superclass.constructor.call(this,A);};Roo.extend(Roo.form.GridField,Roo.form.Field,{width:100,height:50,xgrid:false,defaultAutoCreate:{tag:'input',type:'hidden',autocomplete:'off'},addTitle:false,onResize:function(){Roo.form.Field.superclass.onResize.apply(this,arguments);},initEvents:function(){},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},onRender:function(ct,A){this.style=this.style||'overflow: hidden; border:1px solid #c3daf9;';var B=this.style;delete this.style;Roo.form.DisplayImage.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:''});this.viewEl=this.wrap.createChild({tag:'div'});if(B){this.viewEl.applyStyles(B);}if(this.width){this.viewEl.setWidth(this.width);}if(this.height){this.viewEl.setHeight(this.height);} this.grid=new Roo.grid[this.xgrid.xtype](this.viewEl,this.xgrid);this.grid.render();this.grid.getDataSource().on('remove',this.refreshValue,this);this.grid.getDataSource().on('update',this.refreshValue,this);this.grid.on('afteredit',this.refreshValue,this);},setValue:function(v){v=v||[];if(this.grid&&this.grid.getDataSource()&&typeof(v)!='undefined'){var ds=this.grid.getDataSource();var data={} data[ds.reader.meta.root]=typeof(v)=='string'?Roo.decode(v):v;ds.loadData(data);} -Roo.form.GridField.superclass.setValue.call(this,v);this.refreshValue();},refreshValue:function(){var D=[];this.grid.getDataSource().each(function(r){D.push(r.data);});this.el.dom.value=Roo.encode(D);}}); +Roo.form.GridField.superclass.setValue.call(this,v);this.refreshValue();},refreshValue:function(){var A=[];this.grid.getDataSource().each(function(r){A.push(r.data);});this.el.dom.value=Roo.encode(A);}}); Roo.DDView=function(A,B,C){Roo.DDView.superclass.constructor.apply(this,arguments);this.getEl().setStyle("outline","0px none");this.getEl().unselectable();if(this.dragGroup){this.setDraggable(this.dragGroup.split(","));}if(this.dropGroup){this.setDroppable(this.dropGroup.split(","));}if(this.deletable){this.setDeletable();} -this.isDirtyFlag=false;this.addEvents({"drop":true});};Roo.extend(Roo.DDView,Roo.View,{isFormField:true,reset:Roo.emptyFn,clearInvalid:Roo.form.Field.prototype.clearInvalid,validate:function(){return true;},destroy:function(){this.purgeListeners();this.getEl.removeAllListeners();this.getEl().remove();if(this.dragZone){if(this.dragZone.destroy){this.dragZone.destroy();}}if(this.dropZone){if(this.dropZone.destroy){this.dropZone.destroy();}}},getName:function(){return this.name;},setValue:function(v){if(!this.store){throw "DDView.setValue(). DDView must be constructed with a valid Store";}var D={};D[this.store.reader.meta.root]=v?[].concat(v):[];this.store.proxy=new Roo.data.MemoryProxy(D);this.store.load();},getValue:function(){var E='(';this.store.each(function(F){E+=F.id+',';});return E.substr(0,E.length-1)+')';},getIds:function(){var i=0,F=new Array(this.store.getCount());this.store.each(function(G){F[i++]=G.id;});return F;},isDirty:function(){return this.isDirtyFlag;},getTargetFromEvent:function(e){var G=e.getTarget();while((G!==null)&&(G.parentNode!=this.el.dom)){G=G.parentNode;}if(!G){G=this.el.dom.lastChild||this.el.dom;}return G;},getDragData:function(e){var H=this.findItemFromChild(e.getTarget());if(H){this.handleSelection(e);var selNodes=this.getSelectedNodes();var dragData={source:this,copy:this.copy||(this.allowCopy&&e.ctrlKey),nodes:selNodes,records:[]};var selectedIndices=this.getSelectedIndexes();for(var i=0;i-1){targets.remove(this.dropZone);}if(targets.length==1){this.dragZone.cachedTarget=null;var el=Roo.get(targets[0].getEl());var box=el.getBox(true);targets[0].onNodeDrop(el.dom,{target:el.dom,xy:[box.x,box.y+box.height-1]},null,this.getDragData(e));}}}},handleSelection:function(e){this.dragZone.cachedTarget=null;var U=this.findItemFromChild(e.getTarget());if(!U){this.clearSelections(true);return;}if(U&&(this.multiSelect||this.singleSelect)){if(this.multiSelect&&e.shiftKey&&(!e.ctrlKey)&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),U.nodeIndex),false);}else if(this.isSelected(this.getNode(U))&&e.ctrlKey){this.unselect(U);}else {this.select(U,this.multiSelect&&e.ctrlKey);this.lastSelection=U;}}},onItemClick:function(V,W,e){if(this.fireEvent("beforeclick",this,W,V,e)===false){return false;}return true;},unselect:function(X,Y){var Z=this.getNode(X);if(Z&&this.isSelected(Z)){if(this.fireEvent("beforeselect",this,Z,this.selections)!==false){Roo.fly(Z).removeClass(this.selectedClass);this.selections.remove(Z);if(!Y){this.fireEvent("selectionchange",this,this.selections);}}}}}); +this.dragZone.cachedTarget=null;return true;},removeDropIndicators:function(n){if(n){Roo.fly(n).removeClass(["x-view-drag-insert-above","x-view-drag-insert-below"]);this.lastInsertClass="_noclass";}},setDeletable:function(A){if(!this.singleSelect&&!this.multiSelect){this.singleSelect=true;}var c=this.getContextMenu();this.contextMenu.on("itemclick",function(B){switch(B.id){case "delete":this.remove(this.getSelectedIndexes());break;}},this);this.contextMenu.add({icon:A,id:"delete",text:'Delete'});},getContextMenu:function(){if(!this.contextMenu){this.contextMenu=new Roo.menu.Menu({id:this.id+"-contextmenu"});this.el.on("contextmenu",this.showContextMenu,this);}return this.contextMenu;},disableContextMenu:function(){if(this.contextMenu){this.el.un("contextmenu",this.showContextMenu,this);}},showContextMenu:function(e,A){A=this.findItemFromChild(e.getTarget());if(A){e.stopEvent();this.select(this.getNode(A),this.multiSelect&&e.ctrlKey,true);this.contextMenu.showAt(e.getXY());}},remove:function(A){A=[].concat(A);for(var i=0;i-1){targets.remove(this.dropZone);}if(targets.length==1){this.dragZone.cachedTarget=null;var el=Roo.get(targets[0].getEl());var box=el.getBox(true);targets[0].onNodeDrop(el.dom,{target:el.dom,xy:[box.x,box.y+box.height-1]},null,this.getDragData(e));}}}},handleSelection:function(e){this.dragZone.cachedTarget=null;var A=this.findItemFromChild(e.getTarget());if(!A){this.clearSelections(true);return;}if(A&&(this.multiSelect||this.singleSelect)){if(this.multiSelect&&e.shiftKey&&(!e.ctrlKey)&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),A.nodeIndex),false);}else if(this.isSelected(this.getNode(A))&&e.ctrlKey){this.unselect(A);}else {this.select(A,this.multiSelect&&e.ctrlKey);this.lastSelection=A;}}},onItemClick:function(A,B,e){if(this.fireEvent("beforeclick",this,B,A,e)===false){return false;}return true;},unselect:function(A,B){var C=this.getNode(A);if(C&&this.isSelected(C)){if(this.fireEvent("beforeselect",this,C,this.selections)!==false){Roo.fly(C).removeClass(this.selectedClass);this.selections.remove(C);if(!B){this.fireEvent("selectionchange",this,this.selections);}}}}}); Roo.LayoutManager=function(A,B){Roo.LayoutManager.superclass.constructor.call(this);this.el=Roo.get(A);if(this.el.dom==document.body&&Roo.isIE&&!B.allowScroll){document.body.scroll="no";}else if(this.el.dom!=document.body&&this.el.getStyle('position')=='static'){this.el.position('relative');} -this.id=this.el.id;this.el.addClass("x-layout-container");this.monitorWindowResize=true;this.regions={};this.addEvents({"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true});this.updating=false;Roo.EventManager.onWindowResize(this.onWindowResize,this,true);};Roo.extend(Roo.LayoutManager,Roo.util.Observable,{isUpdating:function(){return this.updating;},beginUpdate:function(){this.updating=true;},endUpdate:function(C){this.updating=false;if(!C){this.layout();}},layout:function(){},onRegionResized:function(D,E){this.fireEvent("regionresized",D,E);this.layout();},onRegionCollapsed:function(F){this.fireEvent("regioncollapsed",F);},onRegionExpanded:function(G){this.fireEvent("regionexpanded",G);},getViewSize:function(){var H;if(this.el.dom!=document.body){H=this.el.getSize();}else {H={width:Roo.lib.Dom.getViewWidth(),height:Roo.lib.Dom.getViewHeight()};} -H.width-=this.el.getBorderWidth("lr")-this.el.getPadding("lr");H.height-=this.el.getBorderWidth("tb")-this.el.getPadding("tb");return H;},getEl:function(){return this.el;},getRegion:function(I){return this.regions[I.toLowerCase()];},onWindowResize:function(){if(this.monitorWindowResize){this.layout();}}}); -Roo.BorderLayout=function(A,B){B=B||{};Roo.BorderLayout.superclass.constructor.call(this,A,B);this.factory=B.factory||Roo.BorderLayout.RegionFactory;for(var i=0,len=this.factory.validRegions.length;i1){for(var i=0,len=arguments.length;i1){for(var i=0,len=arguments.length;i0?K:" ");}},setActivePanel:function(L){L=this.getPanel(L);if(this.activePanel&&this.activePanel!=L){this.activePanel.setActiveState(false);} -this.activePanel=L;L.setActiveState(true);if(this.panelSize){L.setSize(this.panelSize.width,this.panelSize.height);}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&L.isClosable());} -this.updateTitle(L.getTitle());if(this.tabs){this.fireEvent("invalidated",this);} -this.fireEvent("panelactivated",this,L);},showPanel:function(M){if(M=this.getPanel(M)){if(this.tabs){var tab=this.tabs.getTab(M.getEl().id);if(tab.isHidden()){this.tabs.unhideTab(tab.id);} -tab.activate();}else {this.setActivePanel(M);}}return M;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle(" ");this.closeBtn.hide();this.hide();}else {if(!this.isVisible()){this.show();}}},add:function(N){if(arguments.length>1){for(var i=0,len=arguments.length;i0){this.remove(this.panels.first());}},remove:function(Q,R){Q=this.getPanel(Q);if(!Q){return null;}var e={};this.fireEvent("beforeremove",this,Q,e);if(e.cancel===true){return null;} -R=(typeof R!="undefined"?R:(this.config.preservePanels===true||Q.preserve===true));var S=Q.getId();this.panels.removeKey(S);if(R){document.body.appendChild(Q.getEl().dom);}if(this.tabs){this.tabs.removeTab(Q.getEl().id);}else if(!R){this.bodyEl.dom.removeChild(Q.getEl().dom);}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var tempEl=document.createElement("div");tempEl.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);tempEl=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);} -Q.setRegion(null);if(this.activePanel==Q){this.activePanel=null;}if(this.config.autoDestroy!==false&&R!==true){try{Q.destroy();}catch(e){}} -this.fireEvent("panelremoved",this,Q);return Q;},getTabs:function(){return this.tabs;},createTool:function(T,U){var V=Roo.DomHelper.append(T,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"x-layout-tools-button-inner "+U,html:" "}]},true);V.addClassOnOver("x-layout-tools-button-over");return V;}}); -Roo.SplitLayoutRegion=function(A,B,C,D){this.cursor=D;Roo.SplitLayoutRegion.superclass.constructor.call(this,A,B,C);};Roo.extend(Roo.SplitLayoutRegion,Roo.LayoutRegion,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(E){Roo.SplitLayoutRegion.superclass.applyConfig.call(this,E);if(E.split){if(!this.split){var splitEl=Roo.DomHelper.append(this.mgr.el.dom,{tag:"div",id:this.el.id+"-split",cls:"x-layout-split x-layout-split-"+this.position,html:" "});this.split=new Roo.SplitBar(splitEl,this.el,this.orientation);this.split.on("moved",this.onSplitMove,this);this.split.useShim=E.useShim===true;this.split.getMaximumSize=this[this.position=='north'||this.position=='south'?'getVMaxSize':'getHMaxSize'].createDelegate(this);if(this.useSplitTips){this.split.el.dom.title=E.collapsible?this.collapsibleSplitTip:this.splitTip;}if(E.collapsible){this.split.el.on("dblclick",this.collapse,this);}}if(typeof E.minSize!="undefined"){this.split.minSize=E.minSize;}if(typeof E.maxSize!="undefined"){this.split.maxSize=E.maxSize;}if(E.hideWhenEmpty||E.hidden||E.collapsed){this.hideSplitter();}}},getHMaxSize:function(){var F=this.config.maxSize||10000;var G=this.mgr.getRegion("center");return Math.min(F,(this.el.getWidth()+G.getEl().getWidth())-G.getMinWidth());},getVMaxSize:function(){var H=this.config.maxSize||10000;var I=this.mgr.getRegion("center");return Math.min(H,(this.el.getHeight()+I.getEl().getHeight())-I.getMinHeight());},onSplitMove:function(J,K){this.fireEvent("resized",this,K);},getSplitBar:function(){return this.split;},hide:function(){this.hideSplitter();Roo.SplitLayoutRegion.superclass.hide.call(this);},hideSplitter:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide();}},show:function(){if(this.split){this.split.el.show();} +this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;ts.monitorResize=false;ts.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");ts.bodyEl.addClass('x-layout-tabs-body');this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable());if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);} +ti.on("activate",function(){this.setActivePanel(A);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B);}if(this.tabs){var ti=this.tabs.getTab(A.getEl().id);ti.setText(B);if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}}},updateTitle:function(A){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof A!="undefined"&&A.length>0?A:" ");}},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false);} +this.activePanel=A;A.setActiveState(true);if(this.panelSize){A.setSize(this.panelSize.width,this.panelSize.height);}if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&A.isClosable());} +this.updateTitle(A.getTitle());if(this.tabs){this.fireEvent("invalidated",this);} +this.fireEvent("panelactivated",this,A);},showPanel:function(A){if(A=this.getPanel(A)){if(this.tabs){var tab=this.tabs.getTab(A.getEl().id);if(tab.isHidden()){this.tabs.unhideTab(tab.id);} +tab.activate();}else {this.setActivePanel(A);}}return A;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle(" ");this.closeBtn.hide();this.hide();}else {if(!this.isVisible()){this.show();}}},add:function(A){if(arguments.length>1){for(var i=0,len=arguments.length;i0){this.remove(this.panels.first());}},remove:function(A,B){A=this.getPanel(A);if(!A){return null;}var e={};this.fireEvent("beforeremove",this,A,e);if(e.cancel===true){return null;} +B=(typeof B!="undefined"?B:(this.config.preservePanels===true||A.preserve===true));var C=A.getId();this.panels.removeKey(C);if(B){document.body.appendChild(A.getEl().dom);}if(this.tabs){this.tabs.removeTab(A.getEl().id);}else if(!B){this.bodyEl.dom.removeChild(A.getEl().dom);}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var tempEl=document.createElement("div");tempEl.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);tempEl=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);} +A.setRegion(null);if(this.activePanel==A){this.activePanel=null;}if(this.config.autoDestroy!==false&&B!==true){try{A.destroy();}catch(e){}} +this.fireEvent("panelremoved",this,A);return A;},getTabs:function(){return this.tabs;},createTool:function(A,B){var C=Roo.DomHelper.append(A,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"x-layout-tools-button-inner "+B,html:" "}]},true);C.addClassOnOver("x-layout-tools-button-over");return C;}}); +Roo.SplitLayoutRegion=function(A,B,C,D){this.cursor=D;Roo.SplitLayoutRegion.superclass.constructor.call(this,A,B,C);};Roo.extend(Roo.SplitLayoutRegion,Roo.LayoutRegion,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(A){Roo.SplitLayoutRegion.superclass.applyConfig.call(this,A);if(A.split){if(!this.split){var splitEl=Roo.DomHelper.append(this.mgr.el.dom,{tag:"div",id:this.el.id+"-split",cls:"x-layout-split x-layout-split-"+this.position,html:" "});this.split=new Roo.SplitBar(splitEl,this.el,this.orientation);this.split.on("moved",this.onSplitMove,this);this.split.useShim=A.useShim===true;this.split.getMaximumSize=this[this.position=='north'||this.position=='south'?'getVMaxSize':'getHMaxSize'].createDelegate(this);if(this.useSplitTips){this.split.el.dom.title=A.collapsible?this.collapsibleSplitTip:this.splitTip;}if(A.collapsible){this.split.el.on("dblclick",this.collapse,this);}}if(typeof A.minSize!="undefined"){this.split.minSize=A.minSize;}if(typeof A.maxSize!="undefined"){this.split.maxSize=A.maxSize;}if(A.hideWhenEmpty||A.hidden||A.collapsed){this.hideSplitter();}}},getHMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getWidth()+B.getEl().getWidth())-B.getMinWidth());},getVMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getHeight()+B.getEl().getHeight())-B.getMinHeight());},onSplitMove:function(A,B){this.fireEvent("resized",this,B);},getSplitBar:function(){return this.split;},hide:function(){this.hideSplitter();Roo.SplitLayoutRegion.superclass.hide.call(this);},hideSplitter:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide();}},show:function(){if(this.split){this.split.el.show();} Roo.SplitLayoutRegion.superclass.show.call(this);},beforeSlide:function(){if(Roo.isGecko){this.bodyEl.clip();if(this.tabs)this.tabs.bodyEl.clip();if(this.activePanel){this.activePanel.getEl().clip();if(this.activePanel.beforeSlide){this.activePanel.beforeSlide();}}}},afterSlide:function(){if(Roo.isGecko){this.bodyEl.unclip();if(this.tabs)this.tabs.bodyEl.unclip();if(this.activePanel){this.activePanel.getEl().unclip();if(this.activePanel.afterSlide){this.activePanel.afterSlide();}}}},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var st=new Roo.util.DelayedTask(this.slideIn,this);this.autoHideHd={"mouseout":function(e){if(!e.within(this.el,true)){st.delay(500);}},"mouseover":function(e){st.cancel();},scope:this};} this.el.on(this.autoHideHd);}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);}},clearMonitor:function(){Roo.get(document).un("click",this.slideInIf,this);},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return;} this.isSlid=true;if(this.collapseBtn){this.collapseBtn.hide();} @@ -562,141 +562,141 @@ this.closeBtnState=this.closeBtn.getStyle('display');this.closeBtn.hide();if(thi this.el.show();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.beforeSlide();this.el.setStyle("z-index",10001);this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Roo.get(document).on("click",this.slideInIf,this);this.fireEvent("slideshow",this);},scope:this,block:true});},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");if(this.collapseBtn){this.collapseBtn.show();} this.closeBtn.setStyle('display',this.closeBtnState);if(this.stickBtn){this.stickBtn.hide();} this.fireEvent("slidehide",this);},slideIn:function(cb){if(!this.isSlid||this.el.hasActiveFx()){Roo.callback(cb);return;} -this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);this.afterSlide();this.afterSlideIn();Roo.callback(cb);},scope:this,block:true});},slideInIf:function(e){if(!e.within(this.el)){this.slideIn();}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var L=this.getSlideAnchor();this.el.slideOut(L,{callback:function(){this.el.setStyle("z-index","");this.collapsedEl.slideIn(L,{duration:.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this);},scope:this,block:true});},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show();} +this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);this.afterSlide();this.afterSlideIn();Roo.callback(cb);},scope:this,block:true});},slideInIf:function(e){if(!e.within(this.el)){this.slideIn();}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var A=this.getSlideAnchor();this.el.slideOut(A,{callback:function(){this.el.setStyle("z-index","");this.collapsedEl.slideIn(A,{duration:.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this);},scope:this,block:true});},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show();} this.fireEvent("invalidated",this);this.fireEvent("expanded",this);},scope:this,block:true});},anchors:{"west":"left","east":"right","north":"top","south":"bottom"},sanchors:{"west":"l","east":"r","north":"t","south":"b"},canchors:{"west":"tl-tr","east":"tr-tl","north":"tl-bl","south":"bl-tl"},getAnchor:function(){return this.anchors[this.position];},getCollapseAnchor:function(){return this.canchors[this.position];},getSlideAnchor:function(){return this.sanchors[this.position];},getAlignAdj:function(){var cm=this.cmargins;switch(this.position){case "west":return [0,0];break;case "east":return [0,0];break;case "north":return [0,0];break;case "south":return [0,0];break;}},getExpandAdj:function(){var c=this.collapsedEl,cm=this.cmargins;switch(this.position){case "west":return [-(cm.right+c.getWidth()+cm.left),0];break;case "east":return [cm.right+c.getWidth()+cm.left,0];break;case "north":return [0,-(cm.top+cm.bottom+c.getHeight())];break;case "south":return [0,cm.top+cm.bottom+c.getHeight()];break;}}}); -Roo.CenterLayoutRegion=function(A,B){Roo.LayoutRegion.call(this,A,B,"center");this.visible=true;this.minWidth=B.minWidth||20;this.minHeight=B.minHeight||20;};Roo.extend(Roo.CenterLayoutRegion,Roo.LayoutRegion,{hide:function(){},show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});Roo.NorthLayoutRegion=function(C,D){Roo.LayoutRegion.call(this,C,D,"north","n-resize");if(this.split){this.split.placement=Roo.SplitBar.TOP;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var E=D.initialSize||D.height;if(typeof E!="undefined"){this.el.setHeight(E);}};Roo.extend(Roo.NorthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var F=this.el.getBox();if(this.split){F.height+=this.split.el.getHeight();}return F;},updateBox:function(G){if(this.split&&!this.collapsed){G.height-=this.split.el.getHeight();this.split.el.setLeft(G.x);this.split.el.setTop(G.y+G.height);this.split.el.setWidth(G.width);}if(this.collapsed){this.updateBody(G.width,null);} -Roo.LayoutRegion.prototype.updateBox.call(this,G);}});Roo.SouthLayoutRegion=function(H,I){Roo.SplitLayoutRegion.call(this,H,I,"south","s-resize");if(this.split){this.split.placement=Roo.SplitBar.BOTTOM;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var J=I.initialSize||I.height;if(typeof J!="undefined"){this.el.setHeight(J);}};Roo.extend(Roo.SouthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var K=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();K.height+=sh;K.y-=sh;}return K;},updateBox:function(L){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();L.height-=sh;L.y+=sh;this.split.el.setLeft(L.x);this.split.el.setTop(L.y-sh);this.split.el.setWidth(L.width);}if(this.collapsed){this.updateBody(L.width,null);} -Roo.LayoutRegion.prototype.updateBox.call(this,L);}});Roo.EastLayoutRegion=function(M,N){Roo.SplitLayoutRegion.call(this,M,N,"east","e-resize");if(this.split){this.split.placement=Roo.SplitBar.RIGHT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var O=N.initialSize||N.width;if(typeof O!="undefined"){this.el.setWidth(O);}};Roo.extend(Roo.EastLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var P=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();P.width+=sw;P.x-=sw;}return P;},updateBox:function(Q){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();Q.width-=sw;this.split.el.setLeft(Q.x);this.split.el.setTop(Q.y);this.split.el.setHeight(Q.height);Q.x+=sw;}if(this.collapsed){this.updateBody(null,Q.height);} -Roo.LayoutRegion.prototype.updateBox.call(this,Q);}});Roo.WestLayoutRegion=function(R,S){Roo.SplitLayoutRegion.call(this,R,S,"west","w-resize");if(this.split){this.split.placement=Roo.SplitBar.LEFT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var T=S.initialSize||S.width;if(typeof T!="undefined"){this.el.setWidth(T);}};Roo.extend(Roo.WestLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var U=this.el.getBox();if(this.split){U.width+=this.split.el.getWidth();}return U;},updateBox:function(V){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();V.width-=sw;this.split.el.setLeft(V.x+V.width);this.split.el.setTop(V.y);this.split.el.setHeight(V.height);}if(this.collapsed){this.updateBody(null,V.height);} -Roo.LayoutRegion.prototype.updateBox.call(this,V);}}); -Roo.LayoutStateManager=function(A){this.state={north:{},south:{},east:{},west:{}};};Roo.LayoutStateManager.prototype={init:function(B,C){this.provider=C;var D=C.get(B.id+"-layout-state");if(D){var wasUpdating=B.isUpdating();if(!wasUpdating){B.beginUpdate();}for(var key in D){if(typeof D[key]!="function"){var rstate=D[key];var r=B.getRegion(key);if(r&&rstate){if(rstate.size){r.resizeTo(rstate.size);}if(rstate.collapsed==true){r.collapse(true);}else {r.expand(null,true);}}}}if(!wasUpdating){B.endUpdate();} -this.state=D;} -this.layout=B;B.on("regionresized",this.onRegionResized,this);B.on("regioncollapsed",this.onRegionCollapsed,this);B.on("regionexpanded",this.onRegionExpanded,this);},storeState:function(){this.provider.set(this.layout.id+"-layout-state",this.state);},onRegionResized:function(E,F){this.state[E.getPosition()].size=F;this.storeState();},onRegionCollapsed:function(G){this.state[G.getPosition()].collapsed=true;this.storeState();},onRegionExpanded:function(H){this.state[H.getPosition()].collapsed=false;this.storeState();}}; +Roo.CenterLayoutRegion=function(A,B){Roo.LayoutRegion.call(this,A,B,"center");this.visible=true;this.minWidth=B.minWidth||20;this.minHeight=B.minHeight||20;};Roo.extend(Roo.CenterLayoutRegion,Roo.LayoutRegion,{hide:function(){},show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});Roo.NorthLayoutRegion=function(A,B){Roo.LayoutRegion.call(this,A,B,"north","n-resize");if(this.split){this.split.placement=Roo.SplitBar.TOP;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var C=B.initialSize||B.height;if(typeof C!="undefined"){this.el.setHeight(C);}};Roo.extend(Roo.NorthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.height+=this.split.el.getHeight();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){A.height-=this.split.el.getHeight();this.split.el.setLeft(A.x);this.split.el.setTop(A.y+A.height);this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}});Roo.SouthLayoutRegion=function(A,B){Roo.SplitLayoutRegion.call(this,A,B,"south","s-resize");if(this.split){this.split.placement=Roo.SplitBar.BOTTOM;this.split.orientation=Roo.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var C=B.initialSize||B.height;if(typeof C!="undefined"){this.el.setHeight(C);}};Roo.extend(Roo.SouthLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();A.height+=sh;A.y-=sh;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();A.height-=sh;A.y+=sh;this.split.el.setLeft(A.x);this.split.el.setTop(A.y-sh);this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}});Roo.EastLayoutRegion=function(A,B){Roo.SplitLayoutRegion.call(this,A,B,"east","e-resize");if(this.split){this.split.placement=Roo.SplitBar.RIGHT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var C=B.initialSize||B.width;if(typeof C!="undefined"){this.el.setWidth(C);}};Roo.extend(Roo.EastLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();A.width+=sw;A.x-=sw;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();A.width-=sw;this.split.el.setLeft(A.x);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);A.x+=sw;}if(this.collapsed){this.updateBody(null,A.height);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}});Roo.WestLayoutRegion=function(A,B){Roo.SplitLayoutRegion.call(this,A,B,"west","w-resize");if(this.split){this.split.placement=Roo.SplitBar.LEFT;this.split.orientation=Roo.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var C=B.initialSize||B.width;if(typeof C!="undefined"){this.el.setWidth(C);}};Roo.extend(Roo.WestLayoutRegion,Roo.SplitLayoutRegion,{orientation:Roo.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.width+=this.split.el.getWidth();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();A.width-=sw;this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);}if(this.collapsed){this.updateBody(null,A.height);} +Roo.LayoutRegion.prototype.updateBox.call(this,A);}}); +Roo.LayoutStateManager=function(A){this.state={north:{},south:{},east:{},west:{}};};Roo.LayoutStateManager.prototype={init:function(A,B){this.provider=B;var C=B.get(A.id+"-layout-state");if(C){var wasUpdating=A.isUpdating();if(!wasUpdating){A.beginUpdate();}for(var key in C){if(typeof C[key]!="function"){var rstate=C[key];var r=A.getRegion(key);if(r&&rstate){if(rstate.size){r.resizeTo(rstate.size);}if(rstate.collapsed==true){r.collapse(true);}else {r.expand(null,true);}}}}if(!wasUpdating){A.endUpdate();} +this.state=C;} +this.layout=A;A.on("regionresized",this.onRegionResized,this);A.on("regioncollapsed",this.onRegionCollapsed,this);A.on("regionexpanded",this.onRegionExpanded,this);},storeState:function(){this.provider.set(this.layout.id+"-layout-state",this.state);},onRegionResized:function(A,B){this.state[A.getPosition()].size=B;this.storeState();},onRegionCollapsed:function(A){this.state[A.getPosition()].collapsed=true;this.storeState();},onRegionExpanded:function(A){this.state[A.getPosition()].collapsed=false;this.storeState();}}; Roo.ContentPanel=function(el,A,B){if(el.autoCreate){A=el;el=Roo.id();} this.el=Roo.get(el);if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=A.id||el;} this.el=Roo.DomHelper.append(document.body,A.autoCreate,true);}else {this.el=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-inactive-content",id:A.id||el},true);}} this.closable=false;this.loaded=false;this.active=false;if(typeof A=="string"){this.title=A;}else {Roo.apply(this,A);}if(this.toolbar&&!this.toolbar.el&&this.toolbar.xtype){this.wrapEl=this.el.wrap();this.toolbar=new Roo.Toolbar(this.el.insertSibling(false,'before'),[],this.toolbar);}if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl,true);}else {this.resizeEl=this.el;} this.addEvents({"activate":true,"deactivate":true,"resize":true});if(this.autoScroll){this.resizeEl.setStyle("overflow","auto");} B=B||this.content;if(B){this.setContent(B);}if(A&&A.url){this.setUrl(this.url,this.params,this.loadOnce);} -Roo.ContentPanel.superclass.constructor.call(this);};Roo.extend(Roo.ContentPanel,Roo.util.Observable,{tabTip:'',setRegion:function(C){this.region=C;if(C){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content");}else {this.el.replaceClass("x-layout-active-content","x-layout-inactive-content");}},getToolbar:function(){return this.toolbar;},setActiveState:function(D){this.active=D;if(!D){this.fireEvent("deactivate",this);}else {this.fireEvent("activate",this);}},setContent:function(E,F){this.el.update(E,F);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else {this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(G,H,I){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);} -this.refreshDelegate=this._handleRefresh.createDelegate(this,[G,H,I]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(J,K,L){if(!L||!this.loaded){var updater=this.el.getUpdateManager();updater.update(J,K,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(M,N){if(this.resizeEl!=this.el){M-=this.el.getFrameWidth('lr');N-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();N-=te.getHeight();te.setWidth(M);}if(this.adjustments){M+=this.adjustments[0];N+=this.adjustments[1];}return {"width":M,"height":N};},setSize:function(O,P){if(this.fitToFrame&&!this.ignoreResize(O,P)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(O,P);}var size=this.adjustForComponents(O,P);this.resizeEl.setSize(this.autoWidth?"auto":size.width,this.autoHeight?"auto":size.height);this.fireEvent('resize',this,size.width,size.height);}},getTitle:function(){return this.title;},setTitle:function(Q){this.title=Q;if(this.region){this.region.updatePanelTitle(this,Q);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var R=document.createElement("span");R.appendChild(this.el.dom);R.innerHTML="";this.el.remove();this.el=null;},addxtype:function(S){if(S.xtype.match(/^Form$/)){var el=this.el.createChild();this.form=new Roo.form.Form(S);if(this.form.allItems.length)this.form.render(el.dom);return this.form;}if(['View','JsonView'].indexOf(S.xtype)>-1){S.el=this.el.appendChild(document.createElement("div"));var ret=new Roo[S.xtype](S);ret.render(false,'');return ret;}return false;}});Roo.GridPanel=function(T,U){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(T.getGridEl().dom);Roo.GridPanel.superclass.constructor.call(this,this.wrapper,U);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){this.footer.container=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);} -T.monitorWindowResize=false;T.autoHeight=false;T.autoWidth=false;this.grid=T;this.grid.getGridEl().replaceClass("x-layout-inactive-content","x-layout-component-panel");};Roo.extend(Roo.GridPanel,Roo.ContentPanel,{getId:function(){return this.grid.id;},getGrid:function(){return this.grid;},setSize:function(V,W){if(!this.ignoreResize(V,W)){var T=this.grid;var size=this.adjustForComponents(V,W);T.getGridEl().setSize(size.width,size.height);T.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.GridPanel.superclass.destroy.call(this);}});Roo.NestedLayoutPanel=function(X,Y){Roo.NestedLayoutPanel.superclass.constructor.call(this,X.getEl(),Y);X.monitorWindowResize=false;this.layout=X;this.layout.getEl().addClass("x-layout-nested-layout");};Roo.extend(Roo.NestedLayoutPanel,Roo.ContentPanel,{setSize:function(Z,a){if(!this.ignoreResize(Z,a)){var size=this.adjustForComponents(Z,a);var el=this.layout.getEl();el.setSize(size.width,size.height);var touch=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(b){this.active=b;if(!b){this.fireEvent("deactivate",this);return;} -this.fireEvent("activate",this);if(!this.layout){return;}var c=false;for(var r in this.layout.regions){c=this.layout.getRegion(r);if(c.getActivePanel()){c.setActivePanel(c.getActivePanel());continue;}if(!c.panels.length){continue;} -c.showPanel(c.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(d){return this.layout.addxtype(d);}});Roo.ScrollPanel=function(el,e,f){e=e||{};e.fitToFrame=true;Roo.ScrollPanel.superclass.constructor.call(this,el,e,f);this.el.dom.style.overflow="hidden";var g=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var up=g.createChild({cls:"x-scroller-up",html:" "},this.el.dom);var i=g.createChild({cls:"x-scroller-down",html:" "});up.unselectable();i.unselectable();up.on("click",this.scrollUp,this);i.on("click",this.scrollDown,this);up.addClassOnOver("x-scroller-btn-over");i.addClassOnOver("x-scroller-btn-over");up.addClassOnClick("x-scroller-btn-click");i.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(up.getHeight()+i.getHeight())];this.resizeEl=this.el;this.el=g;this.up=up;this.down=i;};Roo.extend(Roo.ScrollPanel,Roo.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this});},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this});},afterScroll:function(){var el=this.resizeEl;var t=el.dom.scrollTop,h=el.dom.scrollHeight,ch=el.dom.clientHeight;this.up[t==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[h-t<=ch?"addClass":"removeClass"]("x-scroller-btn-disabled");},setSize:function(){Roo.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll();},onWheel:function(e){var d=e.getWheelDelta();this.resizeEl.dom.scrollTop-=(d*this.wheelIncrement);this.afterScroll();e.stopEvent();},setContent:function(j,k){this.resizeEl.update(j,k);}});Roo.TreePanel=function(l){var el=l.el;var m=l.tree;delete l.tree;delete l.el;Roo.TreePanel.superclass.constructor.call(this,el,l);var n=el.createChild();this.tree=new Roo.tree.TreePanel(n,m);this.on('activate',function(){if(this.tree.rendered){return;} +Roo.ContentPanel.superclass.constructor.call(this);};Roo.extend(Roo.ContentPanel,Roo.util.Observable,{tabTip:'',setRegion:function(A){this.region=A;if(A){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content");}else {this.el.replaceClass("x-layout-active-content","x-layout-inactive-content");}},getToolbar:function(){return this.toolbar;},setActiveState:function(A){this.active=A;if(!A){this.fireEvent("deactivate",this);}else {this.fireEvent("activate",this);}},setContent:function(A,B){this.el.update(A,B);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else {this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);} +this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var updater=this.el.getUpdateManager();updater.update(A,B,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();B-=te.getHeight();te.setWidth(A);}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);}var size=this.adjustForComponents(A,B);this.resizeEl.setSize(this.autoWidth?"auto":size.width,this.autoHeight?"auto":size.height);this.fireEvent('resize',this,size.width,size.height);}},getTitle:function(){return this.title;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},addxtype:function(A){if(A.xtype.match(/^Form$/)){var el=this.el.createChild();this.form=new Roo.form.Form(A);if(this.form.allItems.length)this.form.render(el.dom);return this.form;}if(['View','JsonView'].indexOf(A.xtype)>-1){A.el=this.el.appendChild(document.createElement("div"));var ret=new Roo[A.xtype](A);ret.render(false,'');return ret;}return false;}});Roo.GridPanel=function(A,B){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(A.getGridEl().dom);Roo.GridPanel.superclass.constructor.call(this,this.wrapper,B);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){this.footer.container=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);} +A.monitorWindowResize=false;A.autoHeight=false;A.autoWidth=false;this.grid=A;this.grid.getGridEl().replaceClass("x-layout-inactive-content","x-layout-component-panel");};Roo.extend(Roo.GridPanel,Roo.ContentPanel,{getId:function(){return this.grid.id;},getGrid:function(){return this.grid;},setSize:function(A,B){if(!this.ignoreResize(A,B)){var grid=this.grid;var size=this.adjustForComponents(A,B);grid.getGridEl().setSize(size.width,size.height);grid.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.GridPanel.superclass.destroy.call(this);}});Roo.NestedLayoutPanel=function(A,B){Roo.NestedLayoutPanel.superclass.constructor.call(this,A.getEl(),B);A.monitorWindowResize=false;this.layout=A;this.layout.getEl().addClass("x-layout-nested-layout");};Roo.extend(Roo.NestedLayoutPanel,Roo.ContentPanel,{setSize:function(A,B){if(!this.ignoreResize(A,B)){var size=this.adjustForComponents(A,B);var el=this.layout.getEl();el.setSize(size.width,size.height);var touch=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(A){this.active=A;if(!A){this.fireEvent("deactivate",this);return;} +this.fireEvent("activate",this);if(!this.layout){return;}var B=false;for(var r in this.layout.regions){B=this.layout.getRegion(r);if(B.getActivePanel()){B.setActivePanel(B.getActivePanel());continue;}if(!B.panels.length){continue;} +B.showPanel(B.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(A){return this.layout.addxtype(A);}});Roo.ScrollPanel=function(el,A,B){A=A||{};A.fitToFrame=true;Roo.ScrollPanel.superclass.constructor.call(this,el,A,B);this.el.dom.style.overflow="hidden";var C=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var up=C.createChild({cls:"x-scroller-up",html:" "},this.el.dom);var D=C.createChild({cls:"x-scroller-down",html:" "});up.unselectable();D.unselectable();up.on("click",this.scrollUp,this);D.on("click",this.scrollDown,this);up.addClassOnOver("x-scroller-btn-over");D.addClassOnOver("x-scroller-btn-over");up.addClassOnClick("x-scroller-btn-click");D.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(up.getHeight()+D.getHeight())];this.resizeEl=this.el;this.el=C;this.up=up;this.down=D;};Roo.extend(Roo.ScrollPanel,Roo.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this});},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this});},afterScroll:function(){var el=this.resizeEl;var t=el.dom.scrollTop,h=el.dom.scrollHeight,ch=el.dom.clientHeight;this.up[t==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[h-t<=ch?"addClass":"removeClass"]("x-scroller-btn-disabled");},setSize:function(){Roo.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll();},onWheel:function(e){var d=e.getWheelDelta();this.resizeEl.dom.scrollTop-=(d*this.wheelIncrement);this.afterScroll();e.stopEvent();},setContent:function(A,B){this.resizeEl.update(A,B);}});Roo.TreePanel=function(A){var el=A.el;var B=A.tree;delete A.tree;delete A.el;Roo.TreePanel.superclass.constructor.call(this,el,A);var C=el.createChild();this.tree=new Roo.tree.TreePanel(C,B);this.on('activate',function(){if(this.tree.rendered){return;} this.tree.render();});this.on('resize',function(cp,w,h){this.tree.innerCt.setWidth(w);this.tree.innerCt.setHeight(h);this.tree.innerCt.setStyle('overflow-y','auto');});};Roo.extend(Roo.TreePanel,Roo.ContentPanel); Roo.ReaderLayout=function(A,B){var c=A||{size:{}};Roo.ReaderLayout.superclass.constructor.call(this,B||document.body,{north:c.north!==false?Roo.apply({split:false,initialSize:32,titlebar:false},c.north):false,west:c.west!==false?Roo.apply({split:true,initialSize:200,minSize:175,maxSize:400,titlebar:true,collapsible:true,animate:true,margins:{left:5,right:0,bottom:5,top:5},cmargins:{left:5,right:5,bottom:5,top:5}},c.west):false,east:c.east!==false?Roo.apply({split:true,initialSize:200,minSize:175,maxSize:400,titlebar:true,collapsible:true,animate:true,margins:{left:0,right:5,bottom:5,top:5},cmargins:{left:5,right:5,bottom:5,top:5}},c.east):false,center:Roo.apply({tabPosition:'top',autoScroll:false,closeOnTab:true,titlebar:false,margins:{left:c.west!==false?0:5,right:c.east!==false?0:5,bottom:5,top:2}},c.center)});this.el.addClass('x-reader');this.beginUpdate();var C=new Roo.BorderLayout(Roo.get(document.body).createChild(),{south:c.preview!==false?Roo.apply({split:true,initialSize:200,minSize:100,autoScroll:true,collapsible:true,titlebar:true,cmargins:{top:5,left:0,right:0,bottom:0}},c.preview):false,center:Roo.apply({autoScroll:false,titlebar:false,minHeight:200},c.listView)});this.add('center',new Roo.NestedLayoutPanel(C,Roo.apply({title:c.mainTitle||'',tabTip:''},c.innerPanelCfg)));this.endUpdate();this.regions.preview=C.getRegion('south');this.regions.listView=C.getRegion('center');};Roo.extend(Roo.ReaderLayout,Roo.BorderLayout); Roo.grid.Grid=function(A,B){this.container=Roo.get(A);this.container.update("");this.container.setStyle("overflow","hidden");this.container.addClass('x-grid-container');this.id=this.container.id;Roo.apply(this,B);if(this.ds){this.dataSource=this.ds;delete this.ds;}if(this.cm){this.colModel=this.cm;delete this.cm;}if(this.sm){this.selModel=this.sm;delete this.sm;}if(this.selModel){this.selModel=Roo.factory(this.selModel,Roo.grid);this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(typeof(this.colModel.config)=='undefined'){this.colModel=new Roo.grid.ColumnModel(this.colModel);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.dataSource){this.dataSource=Roo.factory(this.dataSource,Roo.data);this.ds=this.dataSource;this.ds.xmodule=this.xmodule||false;}if(this.width){this.container.setWidth(this.width);}if(this.height){this.container.setHeight(this.height);} -this.addEvents({"click":true,"dblclick":true,"contextmenu":true,"mousedown":true,"mouseup":true,"mouseover":true,"mouseout":true,"keypress":true,"keydown":true,"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"headerclick":true,"headerdblclick":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"bodyscroll":true,"columnresize":true,"columnmove":true,"startdrag":true,"enddrag":true,"dragdrop":true,"dragover":true,"dragenter":true,"dragout":true,render:true});Roo.grid.Grid.superclass.constructor.call(this);};Roo.extend(Roo.grid.Grid,Roo.util.Observable,{minColumnWidth:25,autoSizeColumns:false,autoSizeHeaders:true,monitorWindowResize:true,maxRowsToMeasure:0,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableColumnHide:true,enableRowHeightSync:false,stripeRows:true,autoHeight:false,autoExpandColumn:false,autoExpandMin:50,autoExpandMax:1000,view:null,loadMask:false,rendered:false,render:function(){var c=this.container;if((!c.dom.offsetHeight||c.dom.offsetHeight<20)||c.getStyle("height")=="auto"){this.autoHeight=true;}var C=this.getView();C.init(this);c.on("click",this.onClick,this);c.on("dblclick",this.onDblClick,this);c.on("contextmenu",this.onContextMenu,this);c.on("keydown",this.onKeyDown,this);this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);C.render();if(this.loadMask){this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:this.dataSource},this.loadMask));}if(this.toolbar&&this.toolbar.xtype){this.toolbar.container=this.getView().getHeaderPanel(true);this.toolbar=new Ext.Toolbar(this.toolbar);}if(this.footer&&this.footer.xtype){this.footer.dataSource=this.getDataSource();this.footer.container=this.getView().getFooterPanel(true);this.footer=Roo.factory(this.footer,Roo);} -this.rendered=true;this.fireEvent('render',this);return this;},reconfigure:function(D,E){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:D},this.loadMask));} -this.view.bind(D,E);this.dataSource=D;this.colModel=E;this.view.refresh(true);},onKeyDown:function(e){this.fireEvent("keydown",e);},destroy:function(F,G){if(this.loadMask){this.loadMask.destroy();}var c=this.container;c.removeAllListeners();this.view.destroy();this.colModel.purgeListeners();if(!G){this.purgeListeners();} -c.update("");if(F===true){c.remove();}},processEvent:function(H,e){this.fireEvent(H,e);var t=e.getTarget();var v=this.view;var I=v.findHeaderIndex(t);if(I!==false){this.fireEvent("header"+H,this,I,e);}else {var row=v.findRowIndex(t);var cell=v.findCellIndex(t);if(row!==false){this.fireEvent("row"+H,this,row,e);if(cell!==false){this.fireEvent("cell"+H,this,row,cell,e);}}}},onClick:function(e){this.processEvent("click",e);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},onDblClick:function(e){this.processEvent("dblclick",e);},walkCells:function(J,K,L,fn,M){var cm=this.colModel,N=cm.getColumnCount();var ds=this.dataSource,O=ds.getCount(),P=true;if(L<0){if(K<0){J--;P=false;}while(J>=0){if(!P){K=N-1;} -P=false;while(K>=0){if(fn.call(M||this,J,K,cm)===true){return [J,K];} -K--;} -J--;}}else {if(K>=N){J++;P=false;}while(J=0){if(!G){B=E-1;} +G=false;while(B>=0){if(fn.call(D||this,A,B,cm)===true){return [A,B];} +B--;} +A--;}}else {if(B>=E){A++;G=false;}while(A','
    ','
    ','
    ','
    {lockedHeader}
    ','
    {lockedBody}
    ',"
    ",'
    ','
    {header}
    ','
    {body}
    ',"
    ",'
    ','','
     
    ',"");C.master.disableformats=true;}if(!C.header){C.header=new Roo.Template('','{cells}',"
    {splits}");C.header.disableformats=true;} -C.header.compile();if(!C.hcell){C.hcell=new Roo.Template('
    ','
    {value}
    ',"
    ");C.hcell.disableFormats=true;} -C.hcell.compile();if(!C.hsplit){C.hsplit=new Roo.Template('
     
    ');C.hsplit.disableFormats=true;} -C.hsplit.compile();if(!C.body){C.body=new Roo.Template('',"{rows}","
    ");C.body.disableFormats=true;} -C.body.compile();if(!C.row){C.row=new Roo.Template('{cells}');C.row.disableFormats=true;} -C.row.compile();if(!C.cell){C.cell=new Roo.Template('','
    {value}
    ',"");C.cell.disableFormats=true;} -C.cell.compile();this.templates=C;},onColWidthChange:function(){this.updateColumns.apply(this,arguments);},onHeaderChange:function(){this.updateHeaders.apply(this,arguments);},onHiddenChange:function(){this.handleHiddenChange.apply(this,arguments);},onColumnMove:function(){this.handleColumnMove.apply(this,arguments);},onColumnLock:function(){this.handleLockChange.apply(this,arguments);},onDataChange:function(){this.refresh();this.updateHeaderSortState();},onClear:function(){this.refresh();},onUpdate:function(ds,D){this.refreshRow(D);},refreshRow:function(E){var ds=this.ds,F;if(typeof E=='number'){F=E;E=ds.getAt(F);}else {F=ds.indexOf(E);} -this.insertRows(ds,F,F,true);this.onRemove(ds,E,F+1,true);this.syncRowHeights(F,F);this.layout();this.fireEvent("rowupdated",this,F,E);},onAdd:function(ds,G,H){this.insertRows(ds,H,H+(G.length-1));},onRemove:function(ds,I,J,K){if(K!==true){this.fireEvent("beforerowremoved",this,J,I);}var bt=this.getBodyTable(),lt=this.getLockedTable();if(bt.rows[J]){bt.firstChild.removeChild(bt.rows[J]);}if(lt.rows[J]){lt.firstChild.removeChild(lt.rows[J]);}if(K!==true){this.stripeRows(J);this.syncRowHeights(J,J);this.layout();this.fireEvent("rowremoved",this,J,I);}},onLoad:function(){this.scrollToTop();},scrollToTop:function(){if(this.scroller){this.scroller.dom.scrollTop=0;this.syncScroll();}},getHeaderPanel:function(L){if(L){this.headerPanel.show();}return this.headerPanel;},getFooterPanel:function(M){if(M){this.footerPanel.show();}return this.footerPanel;},initElements:function(){var E=Roo.Element;var el=this.grid.getGridEl().dom.firstChild;var cs=el.childNodes;this.el=new E(el);this.headerPanel=new E(el.firstChild);this.headerPanel.enableDisplayMode("block");this.scroller=new E(cs[1]);this.scrollSizer=new E(this.scroller.dom.firstChild);this.lockedWrap=new E(cs[2]);this.lockedHd=new E(this.lockedWrap.dom.firstChild);this.lockedBody=new E(this.lockedWrap.dom.childNodes[1]);this.mainWrap=new E(cs[3]);this.mainHd=new E(this.mainWrap.dom.firstChild);this.mainBody=new E(this.mainWrap.dom.childNodes[1]);this.footerPanel=new E(cs[4]);this.footerPanel.enableDisplayMode("block");this.focusEl=new E(cs[5]);this.focusEl.swallowEvent("click",true);this.resizeProxy=new E(cs[6]);this.headerSelector=String.format('#{0} td.x-grid-hd, #{1} td.x-grid-hd',this.lockedHd.id,this.mainHd.id);this.splitterSelector=String.format('#{0} div.x-grid-split, #{1} div.x-grid-split',this.idToCssName(this.lockedHd.id),this.idToCssName(this.mainHd.id));},idToCssName:function(s){return s.replace(/[^a-z0-9]+/ig,'-');},getHeaderCell:function(N){return Roo.DomQuery.select(this.headerSelector)[N];},getHeaderCellMeasure:function(O){return this.getHeaderCell(O).firstChild;},getHeaderCellText:function(P){return this.getHeaderCell(P).firstChild.firstChild;},getLockedTable:function(){return this.lockedBody.dom.firstChild;},getBodyTable:function(){return this.mainBody.dom.firstChild;},getLockedRow:function(Q){return this.getLockedTable().rows[Q];},getRow:function(R){return this.getBodyTable().rows[R];},getRowComposite:function(S){if(!this.rowEl){this.rowEl=new Roo.CompositeElementLite();}var T=[],U,V;if(U=this.getLockedRow(S)){T.push(U);}if(V=this.getRow(S)){T.push(V);} -this.rowEl.elements=T;return this.rowEl;},getCell:function(W,X){var Y=this.cm.getLockedCount();var Z;if(X=this.ds.getCount()){return;} -AC=(AC!==undefined?AC:0);var cm=this.grid.colModel;while(cm.isHidden(AC)){AC++;}var el=this.getCell(AB,AC);if(!el){return;}var c=this.scroller.dom;var AE=parseInt(el.offsetTop,10);var AF=parseInt(el.offsetLeft,10);var AG=AE+el.offsetHeight;var AH=AF+el.offsetWidth;var ch=c.clientHeight-this.mainHd.dom.offsetHeight;var AI=parseInt(c.scrollTop,10);var AJ=parseInt(c.scrollLeft,10);var AK=AI+ch;var AL=AJ+c.clientWidth;if(AEAK){c.scrollTop=AG-ch;}if(AD!==false){if(AFAL){c.scrollLeft=AH-c.clientWidth;}}return el;},updateColumns:function(){this.grid.stopEditing();var cm=this.grid.colModel,AM=this.getColumnIds();var AN=0;for(var i=0,len=cm.getColumnCount();i