~flavour/sahana-eden/trunk

« back to all changes in this revision

Viewing changes to static/scripts/ext/ext-all-debug.js

  • Committer: Fran Boon
  • Date: 2012-01-21 16:10:49 UTC
  • Revision ID: fran@aidiq.com-20120121161049-u2ytuiymn1t312c6
JS upgrade: jQuery, jQueryUI, OpenLayers, Ext, GeoExt

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
        return node;
447
447
    }
448
448
 
449
 
 
 
449
       
 
450
    function createContextualFragment(html){
 
451
        var div = document.createElement("div"),
 
452
            fragment = document.createDocumentFragment(),
 
453
            i = 0,
 
454
            length, childNodes;
 
455
        
 
456
        div.innerHTML = html;
 
457
        childNodes = div.childNodes;
 
458
        length = childNodes.length;
 
459
        
 
460
        for (; i < length; i++) {
 
461
            fragment.appendChild(childNodes[i].cloneNode(true));
 
462
        }
 
463
        
 
464
        return fragment;
 
465
    }
 
466
    
450
467
    pub = {
451
468
        
452
469
        markup : function(o){
473
490
                }
474
491
            }
475
492
        },
476
 
 
477
493
        
478
494
        insertHtml : function(where, el, html){
479
495
            var hash = {},
480
496
                hashVal,
 
497
                range,
 
498
                rangeEl,
481
499
                setStart,
482
 
                range,
483
500
                frag,
484
 
                rangeEl,
485
501
                rs;
486
502
 
487
503
            where = where.toLowerCase();
505
521
                setStart = 'setStart' + (endRe.test(where) ? 'After' : 'Before');
506
522
                if (hash[where]) {
507
523
                    range[setStart](el);
508
 
                    frag = range.createContextualFragment(html);
 
524
                    if (!range.createContextualFragment) {
 
525
                        frag = createContextualFragment(html);
 
526
                    }
 
527
                    else {
 
528
                        frag = range.createContextualFragment(html);
 
529
                    }
509
530
                    el.parentNode.insertBefore(frag, where == beforebegin ? el : el.nextSibling);
510
531
                    return el[(where == beforebegin ? 'previous' : 'next') + 'Sibling'];
511
532
                } else {
512
533
                    rangeEl = (where == afterbegin ? 'first' : 'last') + 'Child';
513
534
                    if (el.firstChild) {
514
535
                        range[setStart](el[rangeEl]);
515
 
                        frag = range.createContextualFragment(html);
 
536
                        if (!range.createContextualFragment) {
 
537
                            frag = createContextualFragment(html);
 
538
                        }
 
539
                        else {
 
540
                            frag = range.createContextualFragment(html);
 
541
                        }
516
542
                        if(where == afterbegin){
517
543
                            el.insertBefore(frag, el.firstChild);
518
544
                        }else{
588
614
};
589
615
Ext.Template.prototype = {
590
616
    
591
 
    re : /\{([\w-]+)\}/g,
 
617
    re : /\{([\w\-]+)\}/g,
592
618
    
593
619
 
594
620
    
677
703
        trimRe = /^\s+|\s+$/g,
678
704
        tplRe = /\{(\d+)\}/g,
679
705
        modeRe = /^(\s?[\/>+~]\s?|\s|$)/,
680
 
        tagTokenRe = /^(#)?([\w-\*]+)/,
 
706
        tagTokenRe = /^(#)?([\w\-\*]+)/,
681
707
        nthRe = /(\d*)n\+?(\d*)/, 
682
708
        nthRe2 = /\D/,
683
709
        
1217
1243
 
1218
1244
        
1219
1245
        matchers : [{
1220
 
                re: /^\.([\w-]+)/,
 
1246
                re: /^\.([\w\-]+)/,
1221
1247
                select: 'n = byClassName(n, " {1} ");'
1222
1248
            }, {
1223
 
                re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
 
1249
                re: /^\:([\w\-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
1224
1250
                select: 'n = byPseudo(n, "{1}", "{2}");'
1225
1251
            },{
1226
 
                re: /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
1227
 
                select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
 
1252
                re: /^(?:([\[\{])(?:@)?([\w\-]+)\s?(?:(=|.=)\s?(["']?)(.*?)\4)?[\]\}])/,
 
1253
                select: 'n = byAttribute(n, "{2}", "{5}", "{3}", "{1}");'
1228
1254
            }, {
1229
 
                re: /^#([\w-]+)/,
 
1255
                re: /^#([\w\-]+)/,
1230
1256
                select: 'n = byId(n, "{1}");'
1231
1257
            },{
1232
 
                re: /^@([\w-]+)/,
 
1258
                re: /^@([\w\-]+)/,
1233
1259
                select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'
1234
1260
            }
1235
1261
        ],
1236
1262
 
1237
 
        
 
1263
        /**
 
1264
         * Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
 
1265
         * New operators can be added as long as the match the format <i>c</i>= where <i>c</i> is any character other than space, &gt; &lt;.
 
1266
         */
1238
1267
        operators : {
1239
1268
            "=" : function(a, v){
1240
1269
                return a == v;
1262
1291
            }
1263
1292
        },
1264
1293
 
1265
 
        
 
1294
        /**
 
1295
         * <p>Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed
 
1296
         * two parameters:</p><div class="mdetail-params"><ul>
 
1297
         * <li><b>c</b> : Array<div class="sub-desc">An Array of DOM elements to filter.</div></li>
 
1298
         * <li><b>v</b> : String<div class="sub-desc">The argument (if any) supplied in the selector.</div></li>
 
1299
         * </ul></div>
 
1300
         * <p>A filter function returns an Array of DOM elements which conform to the pseudo class.</p>
 
1301
         * <p>In addition to the provided pseudo classes listed above such as <code>first-child</code> and <code>nth-child</code>,
 
1302
         * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.</p>
 
1303
         * <p>For example, to filter <code>&lt;a></code> elements to only return links to <i>external</i> resources:</p>
 
1304
         * <code><pre>
 
1305
Ext.DomQuery.pseudos.external = function(c, v){
 
1306
    var r = [], ri = -1;
 
1307
    for(var i = 0, ci; ci = c[i]; i++){
 
1308
//      Include in result set only if it's a link to an external resource
 
1309
        if(ci.hostname != location.hostname){
 
1310
            r[++ri] = ci;
 
1311
        }
 
1312
    }
 
1313
    return r;
 
1314
};</pre></code>
 
1315
         * Then external links could be gathered with the following statement:<code><pre>
 
1316
var externalLinks = Ext.select("a:external");
 
1317
</code></pre>
 
1318
         */
1266
1319
        pseudos : {
1267
1320
            "first-child" : function(c){
1268
1321
                var r = [], ri = -1, n;
1447
1500
    };
1448
1501
}();
1449
1502
 
1450
 
 
 
1503
/**
 
1504
 * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of {@link Ext.DomQuery#select}
 
1505
 * @param {String} path The selector/xpath query
 
1506
 * @param {Node} root (optional) The start of the query (defaults to document).
 
1507
 * @return {Array}
 
1508
 * @member Ext
 
1509
 * @method query
 
1510
 */
1451
1511
Ext.query = Ext.DomQuery.select;
1452
 
 
 
1512
/**
 
1513
 * @class Ext.util.DelayedTask
 
1514
 * <p> The DelayedTask class provides a convenient way to "buffer" the execution of a method,
 
1515
 * performing setTimeout where a new timeout cancels the old timeout. When called, the
 
1516
 * task will wait the specified time period before executing. If durng that time period,
 
1517
 * the task is called again, the original call will be cancelled. This continues so that
 
1518
 * the function is only called a single time for each iteration.</p>
 
1519
 * <p>This method is especially useful for things like detecting whether a user has finished
 
1520
 * typing in a text field. An example would be performing validation on a keypress. You can
 
1521
 * use this class to buffer the keypress events for a certain number of milliseconds, and
 
1522
 * perform only if they stop for that amount of time.  Usage:</p><pre><code>
 
1523
var task = new Ext.util.DelayedTask(function(){
 
1524
    alert(Ext.getDom('myInputField').value.length);
 
1525
});
 
1526
// Wait 500ms before calling our function. If the user presses another key 
 
1527
// during that 500ms, it will be cancelled and we'll wait another 500ms.
 
1528
Ext.get('myInputField').on('keypress', function(){
 
1529
    task.{@link #delay}(500); 
 
1530
});
 
1531
 * </code></pre> 
 
1532
 * <p>Note that we are using a DelayedTask here to illustrate a point. The configuration
 
1533
 * option <tt>buffer</tt> for {@link Ext.util.Observable#addListener addListener/on} will
 
1534
 * also setup a delayed task for you to buffer events.</p> 
 
1535
 * @constructor The parameters to this constructor serve as defaults and are not required.
 
1536
 * @param {Function} fn (optional) The default function to call.
 
1537
 * @param {Object} scope The default scope (The <code><b>this</b></code> reference) in which the
 
1538
 * function is called. If not specified, <code>this</code> will refer to the browser window.
 
1539
 * @param {Array} args (optional) The default Array of arguments.
 
1540
 */
1453
1541
Ext.util.DelayedTask = function(fn, scope, args){
1454
1542
    var me = this,
1455
1543
        id,     
1459
1547
                fn.apply(scope, args || []);
1460
1548
            };
1461
1549
            
1462
 
    
 
1550
    /**
 
1551
     * Cancels any pending timeout and queues a new one
 
1552
     * @param {Number} delay The milliseconds to delay
 
1553
     * @param {Function} newFn (optional) Overrides function passed to constructor
 
1554
     * @param {Object} newScope (optional) Overrides scope passed to constructor. Remember that if no scope
 
1555
     * is specified, <code>this</code> will refer to the browser window.
 
1556
     * @param {Array} newArgs (optional) Overrides args passed to constructor
 
1557
     */
1463
1558
    me.delay = function(delay, newFn, newScope, newArgs){
1464
1559
        me.cancel();
1465
1560
        fn = newFn || fn;
1468
1563
        id = setInterval(call, delay);
1469
1564
    };
1470
1565
 
1471
 
    
 
1566
    /**
 
1567
     * Cancel the last queued timeout
 
1568
     */
1472
1569
    me.cancel = function(){
1473
1570
        if(id){
1474
1571
            clearInterval(id);
1475
1572
            id = null;
1476
1573
        }
1477
1574
    };
 
1575
};/**
 
1576
 * @class Ext.Element
 
1577
 * <p>Encapsulates a DOM element, adding simple DOM manipulation facilities, normalizing for browser differences.</p>
 
1578
 * <p>All instances of this class inherit the methods of {@link Ext.Fx} making visual effects easily available to all DOM elements.</p>
 
1579
 * <p>Note that the events documented in this class are not Ext events, they encapsulate browser events. To
 
1580
 * access the underlying browser event, see {@link Ext.EventObject#browserEvent}. Some older
 
1581
 * browsers may not support the full range of events. Which events are supported is beyond the control of ExtJs.</p>
 
1582
 * Usage:<br>
 
1583
<pre><code>
 
1584
// by id
 
1585
var el = Ext.get("my-div");
 
1586
 
 
1587
// by DOM element reference
 
1588
var el = Ext.get(myDivElement);
 
1589
</code></pre>
 
1590
 * <b>Animations</b><br />
 
1591
 * <p>When an element is manipulated, by default there is no animation.</p>
 
1592
 * <pre><code>
 
1593
var el = Ext.get("my-div");
 
1594
 
 
1595
// no animation
 
1596
el.setWidth(100);
 
1597
 * </code></pre>
 
1598
 * <p>Many of the functions for manipulating an element have an optional "animate" parameter.  This
 
1599
 * parameter can be specified as boolean (<tt>true</tt>) for default animation effects.</p>
 
1600
 * <pre><code>
 
1601
// default animation
 
1602
el.setWidth(100, true);
 
1603
 * </code></pre>
 
1604
 *
 
1605
 * <p>To configure the effects, an object literal with animation options to use as the Element animation
 
1606
 * configuration object can also be specified. Note that the supported Element animation configuration
 
1607
 * options are a subset of the {@link Ext.Fx} animation options specific to Fx effects.  The supported
 
1608
 * Element animation configuration options are:</p>
 
1609
<pre>
 
1610
Option    Default   Description
 
1611
--------- --------  ---------------------------------------------
 
1612
{@link Ext.Fx#duration duration}  .35       The duration of the animation in seconds
 
1613
{@link Ext.Fx#easing easing}    easeOut   The easing method
 
1614
{@link Ext.Fx#callback callback}  none      A function to execute when the anim completes
 
1615
{@link Ext.Fx#scope scope}     this      The scope (this) of the callback function
 
1616
</pre>
 
1617
 *
 
1618
 * <pre><code>
 
1619
// Element animation options object
 
1620
var opt = {
 
1621
    {@link Ext.Fx#duration duration}: 1,
 
1622
    {@link Ext.Fx#easing easing}: 'elasticIn',
 
1623
    {@link Ext.Fx#callback callback}: this.foo,
 
1624
    {@link Ext.Fx#scope scope}: this
1478
1625
};
 
1626
// animation with some options set
 
1627
el.setWidth(100, opt);
 
1628
 * </code></pre>
 
1629
 * <p>The Element animation object being used for the animation will be set on the options
 
1630
 * object as "anim", which allows you to stop or manipulate the animation. Here is an example:</p>
 
1631
 * <pre><code>
 
1632
// using the "anim" property to get the Anim object
 
1633
if(opt.anim.isAnimated()){
 
1634
    opt.anim.stop();
 
1635
}
 
1636
 * </code></pre>
 
1637
 * <p>Also see the <tt>{@link #animate}</tt> method for another animation technique.</p>
 
1638
 * <p><b> Composite (Collections of) Elements</b></p>
 
1639
 * <p>For working with collections of Elements, see {@link Ext.CompositeElement}</p>
 
1640
 * @constructor Create a new Element directly.
 
1641
 * @param {String/HTMLElement} element
 
1642
 * @param {Boolean} forceNew (optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class).
 
1643
 */
1479
1644
(function(){
1480
1645
var DOC = document;
1481
1646
 
1488
1653
 
1489
1654
    id = dom.id;
1490
1655
 
1491
 
    if(!forceNew && id && Ext.elCache[id]){ 
 
1656
    if(!forceNew && id && Ext.elCache[id]){ // element object already exists
1492
1657
        return Ext.elCache[id].el;
1493
1658
    }
1494
1659
 
1495
 
    
 
1660
    /**
 
1661
     * The DOM element
 
1662
     * @type HTMLElement
 
1663
     */
1496
1664
    this.dom = dom;
1497
1665
 
1498
 
    
 
1666
    /**
 
1667
     * The DOM element ID
 
1668
     * @type String
 
1669
     */
1499
1670
    this.id = id || Ext.id(dom);
1500
1671
};
1501
1672
 
1504
1675
    EC = Ext.elCache;
1505
1676
 
1506
1677
El.prototype = {
1507
 
    
 
1678
    /**
 
1679
     * Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function)
 
1680
     * @param {Object} o The object with the attributes
 
1681
     * @param {Boolean} useSet (optional) false to override the default setAttribute to use expandos.
 
1682
     * @return {Ext.Element} this
 
1683
     */
1508
1684
    set : function(o, useSet){
1509
1685
        var el = this.dom,
1510
1686
            attr,
1528
1704
        return this;
1529
1705
    },
1530
1706
 
1531
 
 
1532
 
    
1533
 
    
1534
 
    
1535
 
    
1536
 
    
1537
 
    
1538
 
    
1539
 
    
1540
 
    
1541
 
    
1542
 
 
1543
 
 
1544
 
    
1545
 
    
1546
 
    
1547
 
 
1548
 
 
1549
 
 
1550
 
    
1551
 
    
1552
 
    
1553
 
    
1554
 
    
1555
 
    
1556
 
 
1557
 
 
1558
 
    
1559
 
    
1560
 
    
1561
 
    
1562
 
    
1563
 
    
1564
 
 
1565
 
 
1566
 
    
1567
 
    
1568
 
    
1569
 
 
1570
 
 
1571
 
    
1572
 
    
1573
 
    
1574
 
    
1575
 
    
1576
 
    
1577
 
    
1578
 
 
1579
 
    
 
1707
//  Mouse events
 
1708
    /**
 
1709
     * @event click
 
1710
     * Fires when a mouse click is detected within the element.
 
1711
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1712
     * @param {HtmlElement} t The target of the event.
 
1713
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1714
     */
 
1715
    /**
 
1716
     * @event contextmenu
 
1717
     * Fires when a right click is detected within the element.
 
1718
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1719
     * @param {HtmlElement} t The target of the event.
 
1720
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1721
     */
 
1722
    /**
 
1723
     * @event dblclick
 
1724
     * Fires when a mouse double click is detected within the element.
 
1725
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1726
     * @param {HtmlElement} t The target of the event.
 
1727
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1728
     */
 
1729
    /**
 
1730
     * @event mousedown
 
1731
     * Fires when a mousedown is detected within the element.
 
1732
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1733
     * @param {HtmlElement} t The target of the event.
 
1734
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1735
     */
 
1736
    /**
 
1737
     * @event mouseup
 
1738
     * Fires when a mouseup is detected within the element.
 
1739
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1740
     * @param {HtmlElement} t The target of the event.
 
1741
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1742
     */
 
1743
    /**
 
1744
     * @event mouseover
 
1745
     * Fires when a mouseover is detected within the element.
 
1746
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1747
     * @param {HtmlElement} t The target of the event.
 
1748
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1749
     */
 
1750
    /**
 
1751
     * @event mousemove
 
1752
     * Fires when a mousemove is detected with the element.
 
1753
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1754
     * @param {HtmlElement} t The target of the event.
 
1755
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1756
     */
 
1757
    /**
 
1758
     * @event mouseout
 
1759
     * Fires when a mouseout is detected with the element.
 
1760
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1761
     * @param {HtmlElement} t The target of the event.
 
1762
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1763
     */
 
1764
    /**
 
1765
     * @event mouseenter
 
1766
     * Fires when the mouse enters the element.
 
1767
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1768
     * @param {HtmlElement} t The target of the event.
 
1769
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1770
     */
 
1771
    /**
 
1772
     * @event mouseleave
 
1773
     * Fires when the mouse leaves the element.
 
1774
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1775
     * @param {HtmlElement} t The target of the event.
 
1776
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1777
     */
 
1778
 
 
1779
//  Keyboard events
 
1780
    /**
 
1781
     * @event keypress
 
1782
     * Fires when a keypress is detected within the element.
 
1783
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1784
     * @param {HtmlElement} t The target of the event.
 
1785
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1786
     */
 
1787
    /**
 
1788
     * @event keydown
 
1789
     * Fires when a keydown is detected within the element.
 
1790
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1791
     * @param {HtmlElement} t The target of the event.
 
1792
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1793
     */
 
1794
    /**
 
1795
     * @event keyup
 
1796
     * Fires when a keyup is detected within the element.
 
1797
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1798
     * @param {HtmlElement} t The target of the event.
 
1799
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1800
     */
 
1801
 
 
1802
 
 
1803
//  HTML frame/object events
 
1804
    /**
 
1805
     * @event load
 
1806
     * Fires when the user agent finishes loading all content within the element. Only supported by window, frames, objects and images.
 
1807
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1808
     * @param {HtmlElement} t The target of the event.
 
1809
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1810
     */
 
1811
    /**
 
1812
     * @event unload
 
1813
     * Fires when the user agent removes all content from a window or frame. For elements, it fires when the target element or any of its content has been removed.
 
1814
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1815
     * @param {HtmlElement} t The target of the event.
 
1816
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1817
     */
 
1818
    /**
 
1819
     * @event abort
 
1820
     * Fires when an object/image is stopped from loading before completely loaded.
 
1821
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1822
     * @param {HtmlElement} t The target of the event.
 
1823
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1824
     */
 
1825
    /**
 
1826
     * @event error
 
1827
     * Fires when an object/image/frame cannot be loaded properly.
 
1828
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1829
     * @param {HtmlElement} t The target of the event.
 
1830
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1831
     */
 
1832
    /**
 
1833
     * @event resize
 
1834
     * Fires when a document view is resized.
 
1835
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1836
     * @param {HtmlElement} t The target of the event.
 
1837
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1838
     */
 
1839
    /**
 
1840
     * @event scroll
 
1841
     * Fires when a document view is scrolled.
 
1842
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1843
     * @param {HtmlElement} t The target of the event.
 
1844
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1845
     */
 
1846
 
 
1847
//  Form events
 
1848
    /**
 
1849
     * @event select
 
1850
     * Fires when a user selects some text in a text field, including input and textarea.
 
1851
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1852
     * @param {HtmlElement} t The target of the event.
 
1853
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1854
     */
 
1855
    /**
 
1856
     * @event change
 
1857
     * Fires when a control loses the input focus and its value has been modified since gaining focus.
 
1858
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1859
     * @param {HtmlElement} t The target of the event.
 
1860
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1861
     */
 
1862
    /**
 
1863
     * @event submit
 
1864
     * Fires when a form is submitted.
 
1865
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1866
     * @param {HtmlElement} t The target of the event.
 
1867
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1868
     */
 
1869
    /**
 
1870
     * @event reset
 
1871
     * Fires when a form is reset.
 
1872
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1873
     * @param {HtmlElement} t The target of the event.
 
1874
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1875
     */
 
1876
    /**
 
1877
     * @event focus
 
1878
     * Fires when an element receives focus either via the pointing device or by tab navigation.
 
1879
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1880
     * @param {HtmlElement} t The target of the event.
 
1881
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1882
     */
 
1883
    /**
 
1884
     * @event blur
 
1885
     * Fires when an element loses focus either via the pointing device or by tabbing navigation.
 
1886
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1887
     * @param {HtmlElement} t The target of the event.
 
1888
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1889
     */
 
1890
 
 
1891
//  User Interface events
 
1892
    /**
 
1893
     * @event DOMFocusIn
 
1894
     * Where supported. Similar to HTML focus event, but can be applied to any focusable element.
 
1895
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1896
     * @param {HtmlElement} t The target of the event.
 
1897
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1898
     */
 
1899
    /**
 
1900
     * @event DOMFocusOut
 
1901
     * Where supported. Similar to HTML blur event, but can be applied to any focusable element.
 
1902
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1903
     * @param {HtmlElement} t The target of the event.
 
1904
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1905
     */
 
1906
    /**
 
1907
     * @event DOMActivate
 
1908
     * Where supported. Fires when an element is activated, for instance, through a mouse click or a keypress.
 
1909
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1910
     * @param {HtmlElement} t The target of the event.
 
1911
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1912
     */
 
1913
 
 
1914
//  DOM Mutation events
 
1915
    /**
 
1916
     * @event DOMSubtreeModified
 
1917
     * Where supported. Fires when the subtree is modified.
 
1918
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1919
     * @param {HtmlElement} t The target of the event.
 
1920
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1921
     */
 
1922
    /**
 
1923
     * @event DOMNodeInserted
 
1924
     * Where supported. Fires when a node has been added as a child of another node.
 
1925
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1926
     * @param {HtmlElement} t The target of the event.
 
1927
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1928
     */
 
1929
    /**
 
1930
     * @event DOMNodeRemoved
 
1931
     * Where supported. Fires when a descendant node of the element is removed.
 
1932
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1933
     * @param {HtmlElement} t The target of the event.
 
1934
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1935
     */
 
1936
    /**
 
1937
     * @event DOMNodeRemovedFromDocument
 
1938
     * Where supported. Fires when a node is being removed from a document.
 
1939
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1940
     * @param {HtmlElement} t The target of the event.
 
1941
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1942
     */
 
1943
    /**
 
1944
     * @event DOMNodeInsertedIntoDocument
 
1945
     * Where supported. Fires when a node is being inserted into a document.
 
1946
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1947
     * @param {HtmlElement} t The target of the event.
 
1948
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1949
     */
 
1950
    /**
 
1951
     * @event DOMAttrModified
 
1952
     * Where supported. Fires when an attribute has been modified.
 
1953
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1954
     * @param {HtmlElement} t The target of the event.
 
1955
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1956
     */
 
1957
    /**
 
1958
     * @event DOMCharacterDataModified
 
1959
     * Where supported. Fires when the character data has been modified.
 
1960
     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
 
1961
     * @param {HtmlElement} t The target of the event.
 
1962
     * @param {Object} o The options configuration passed to the {@link #addListener} call.
 
1963
     */
 
1964
 
 
1965
    /**
 
1966
     * The default unit to append to CSS values where a unit isn't provided (defaults to px).
 
1967
     * @type String
 
1968
     */
1580
1969
    defaultUnit : "px",
1581
1970
 
1582
 
    
 
1971
    /**
 
1972
     * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child)
 
1973
     * @param {String} selector The simple selector to test
 
1974
     * @return {Boolean} True if this element matches the selector, else false
 
1975
     */
1583
1976
    is : function(simpleSelector){
1584
1977
        return Ext.DomQuery.is(this.dom, simpleSelector);
1585
1978
    },
1586
1979
 
1587
 
    
1588
 
    focus : function(defer,  dom) {
 
1980
    /**
 
1981
     * Tries to focus the element. Any exceptions are caught and ignored.
 
1982
     * @param {Number} defer (optional) Milliseconds to defer the focus
 
1983
     * @return {Ext.Element} this
 
1984
     */
 
1985
    focus : function(defer, /* private */ dom) {
1589
1986
        var me = this,
1590
1987
            dom = dom || me.dom;
1591
1988
        try{
1598
1995
        return me;
1599
1996
    },
1600
1997
 
1601
 
    
 
1998
    /**
 
1999
     * Tries to blur the element. Any exceptions are caught and ignored.
 
2000
     * @return {Ext.Element} this
 
2001
     */
1602
2002
    blur : function() {
1603
2003
        try{
1604
2004
            this.dom.blur();
1606
2006
        return this;
1607
2007
    },
1608
2008
 
1609
 
    
 
2009
    /**
 
2010
     * Returns the value of the "value" attribute
 
2011
     * @param {Boolean} asNumber true to parse the value as a number
 
2012
     * @return {String/Number}
 
2013
     */
1610
2014
    getValue : function(asNumber){
1611
2015
        var val = this.dom.value;
1612
2016
        return asNumber ? parseInt(val, 10) : val;
1613
2017
    },
1614
2018
 
1615
 
    
 
2019
    /**
 
2020
     * Appends an event handler to this element.  The shorthand version {@link #on} is equivalent.
 
2021
     * @param {String} eventName The name of event to handle.
 
2022
     * @param {Function} fn The handler function the event invokes. This function is passed
 
2023
     * the following parameters:<ul>
 
2024
     * <li><b>evt</b> : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>
 
2025
     * <li><b>el</b> : HtmlElement<div class="sub-desc">The DOM element which was the target of the event.
 
2026
     * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>
 
2027
     * <li><b>o</b> : Object<div class="sub-desc">The options object from the addListener call.</div></li>
 
2028
     * </ul>
 
2029
     * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
 
2030
     * <b>If omitted, defaults to this Element.</b>.
 
2031
     * @param {Object} options (optional) An object containing handler configuration properties.
 
2032
     * This may contain any of the following properties:<ul>
 
2033
     * <li><b>scope</b> Object : <div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
 
2034
     * <b>If omitted, defaults to this Element.</b></div></li>
 
2035
     * <li><b>delegate</b> String: <div class="sub-desc">A simple selector to filter the target or look for a descendant of the target. See below for additional details.</div></li>
 
2036
     * <li><b>stopEvent</b> Boolean: <div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>
 
2037
     * <li><b>preventDefault</b> Boolean: <div class="sub-desc">True to prevent the default action</div></li>
 
2038
     * <li><b>stopPropagation</b> Boolean: <div class="sub-desc">True to prevent event propagation</div></li>
 
2039
     * <li><b>normalized</b> Boolean: <div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>
 
2040
     * <li><b>target</b> Ext.Element: <div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>
 
2041
     * <li><b>delay</b> Number: <div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
 
2042
     * <li><b>single</b> Boolean: <div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
 
2043
     * <li><b>buffer</b> Number: <div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed
 
2044
     * by the specified number of milliseconds. If the event fires again within that time, the original
 
2045
     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
 
2046
     * </ul><br>
 
2047
     * <p>
 
2048
     * <b>Combining Options</b><br>
 
2049
     * In the following examples, the shorthand form {@link #on} is used rather than the more verbose
 
2050
     * addListener.  The two are equivalent.  Using the options argument, it is possible to combine different
 
2051
     * types of listeners:<br>
 
2052
     * <br>
 
2053
     * A delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the
 
2054
     * options object. The options object is available as the third parameter in the handler function.<div style="margin: 5px 20px 20px;">
 
2055
     * Code:<pre><code>
 
2056
el.on('click', this.onClick, this, {
 
2057
    single: true,
 
2058
    delay: 100,
 
2059
    stopEvent : true,
 
2060
    forumId: 4
 
2061
});</code></pre></p>
 
2062
     * <p>
 
2063
     * <b>Attaching multiple handlers in 1 call</b><br>
 
2064
     * The method also allows for a single argument to be passed which is a config object containing properties
 
2065
     * which specify multiple handlers.</p>
 
2066
     * <p>
 
2067
     * Code:<pre><code>
 
2068
el.on({
 
2069
    'click' : {
 
2070
        fn: this.onClick,
 
2071
        scope: this,
 
2072
        delay: 100
 
2073
    },
 
2074
    'mouseover' : {
 
2075
        fn: this.onMouseOver,
 
2076
        scope: this
 
2077
    },
 
2078
    'mouseout' : {
 
2079
        fn: this.onMouseOut,
 
2080
        scope: this
 
2081
    }
 
2082
});</code></pre>
 
2083
     * <p>
 
2084
     * Or a shorthand syntax:<br>
 
2085
     * Code:<pre><code></p>
 
2086
el.on({
 
2087
    'click' : this.onClick,
 
2088
    'mouseover' : this.onMouseOver,
 
2089
    'mouseout' : this.onMouseOut,
 
2090
    scope: this
 
2091
});
 
2092
     * </code></pre></p>
 
2093
     * <p><b>delegate</b></p>
 
2094
     * <p>This is a configuration option that you can pass along when registering a handler for
 
2095
     * an event to assist with event delegation. Event delegation is a technique that is used to
 
2096
     * reduce memory consumption and prevent exposure to memory-leaks. By registering an event
 
2097
     * for a container element as opposed to each element within a container. By setting this
 
2098
     * configuration option to a simple selector, the target element will be filtered to look for
 
2099
     * a descendant of the target.
 
2100
     * For example:<pre><code>
 
2101
// using this markup:
 
2102
&lt;div id='elId'>
 
2103
    &lt;p id='p1'>paragraph one&lt;/p>
 
2104
    &lt;p id='p2' class='clickable'>paragraph two&lt;/p>
 
2105
    &lt;p id='p3'>paragraph three&lt;/p>
 
2106
&lt;/div>
 
2107
// utilize event delegation to registering just one handler on the container element:
 
2108
el = Ext.get('elId');
 
2109
el.on(
 
2110
    'click',
 
2111
    function(e,t) {
 
2112
        // handle click
 
2113
        console.info(t.id); // 'p2'
 
2114
    },
 
2115
    this,
 
2116
    {
 
2117
        // filter the target element to be a descendant with the class 'clickable'
 
2118
        delegate: '.clickable'
 
2119
    }
 
2120
);
 
2121
     * </code></pre></p>
 
2122
     * @return {Ext.Element} this
 
2123
     */
1616
2124
    addListener : function(eventName, fn, scope, options){
1617
2125
        Ext.EventManager.on(this.dom,  eventName, fn, scope || this, options);
1618
2126
        return this;
1619
2127
    },
1620
2128
 
1621
 
    
 
2129
    /**
 
2130
     * Removes an event handler from this element.  The shorthand version {@link #un} is equivalent.
 
2131
     * <b>Note</b>: if a <i>scope</i> was explicitly specified when {@link #addListener adding} the
 
2132
     * listener, the same scope must be specified here.
 
2133
     * Example:
 
2134
     * <pre><code>
 
2135
el.removeListener('click', this.handlerFn);
 
2136
// or
 
2137
el.un('click', this.handlerFn);
 
2138
</code></pre>
 
2139
     * @param {String} eventName The name of the event from which to remove the handler.
 
2140
     * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
 
2141
     * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added,
 
2142
     * then this must refer to the same object.
 
2143
     * @return {Ext.Element} this
 
2144
     */
1622
2145
    removeListener : function(eventName, fn, scope){
1623
2146
        Ext.EventManager.removeListener(this.dom,  eventName, fn, scope || this);
1624
2147
        return this;
1625
2148
    },
1626
2149
 
1627
 
    
 
2150
    /**
 
2151
     * Removes all previous added listeners from this element
 
2152
     * @return {Ext.Element} this
 
2153
     */
1628
2154
    removeAllListeners : function(){
1629
2155
        Ext.EventManager.removeAll(this.dom);
1630
2156
        return this;
1631
2157
    },
1632
2158
 
1633
 
    
 
2159
    /**
 
2160
     * Recursively removes all previous added listeners from this element and its children
 
2161
     * @return {Ext.Element} this
 
2162
     */
1634
2163
    purgeAllListeners : function() {
1635
2164
        Ext.EventManager.purgeElement(this, true);
1636
2165
        return this;
1637
2166
    },
1638
 
    
 
2167
    /**
 
2168
     * @private Test if size has a unit, otherwise appends the default
 
2169
     */
1639
2170
    addUnits : function(size){
1640
2171
        if(size === "" || size == "auto" || size === undefined){
1641
2172
            size = size || '';
1645
2176
        return size;
1646
2177
    },
1647
2178
 
1648
 
    
 
2179
    /**
 
2180
     * <p>Updates the <a href="http:
 
2181
     * from a specified URL. Note that this is subject to the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">Same Origin Policy</a></p>
 
2182
     * <p>Updating innerHTML of an element will <b>not</b> execute embedded <tt>&lt;script></tt> elements. This is a browser restriction.</p>
 
2183
     * @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying
 
2184
     * exactly how to request the HTML.
 
2185
     * @return {Ext.Element} this
 
2186
     */
1649
2187
    load : function(url, params, cb){
1650
2188
        Ext.Ajax.request(Ext.apply({
1651
2189
            params: params,
1692
2230
    },
1693
2231
 
1694
2232
    
1695
 
    getAttribute : Ext.isIE ? function(name, ns){
1696
 
        var d = this.dom,
1697
 
            type = typeof d[ns + ":" + name];
1698
 
 
1699
 
        if(['undefined', 'unknown'].indexOf(type) == -1){
1700
 
            return d[ns + ":" + name];
 
2233
    getAttribute: (function(){
 
2234
        var test = document.createElement('table'),
 
2235
            isBrokenOnTable = false,
 
2236
            hasGetAttribute = 'getAttribute' in test,
 
2237
            unknownRe = /undefined|unknown/;
 
2238
            
 
2239
        if (hasGetAttribute) {
 
2240
            
 
2241
            try {
 
2242
                test.getAttribute('ext:qtip');
 
2243
            } catch (e) {
 
2244
                isBrokenOnTable = true;
 
2245
            }
 
2246
            
 
2247
            return function(name, ns) {
 
2248
                var el = this.dom,
 
2249
                    value;
 
2250
                
 
2251
                if (el.getAttributeNS) {
 
2252
                    value  = el.getAttributeNS(ns, name) || null;
 
2253
                }
 
2254
            
 
2255
                if (value == null) {
 
2256
                    if (ns) {
 
2257
                        if (isBrokenOnTable && el.tagName.toUpperCase() == 'TABLE') {
 
2258
                            try {
 
2259
                                value = el.getAttribute(ns + ':' + name);
 
2260
                            } catch (e) {
 
2261
                                value = '';
 
2262
                            }
 
2263
                        } else {
 
2264
                            value = el.getAttribute(ns + ':' + name);
 
2265
                        }
 
2266
                    } else {
 
2267
                        value = el.getAttribute(name) || el[name];
 
2268
                    }
 
2269
                }
 
2270
                return value || '';
 
2271
            };
 
2272
        } else {
 
2273
            return function(name, ns) {
 
2274
                var el = this.om,
 
2275
                    value,
 
2276
                    attribute;
 
2277
                
 
2278
                if (ns) {
 
2279
                    attribute = el[ns + ':' + name];
 
2280
                    value = unknownRe.test(typeof attribute) ? undefined : attribute;
 
2281
                } else {
 
2282
                    value = el[name];
 
2283
                }
 
2284
                return value || '';
 
2285
            };
1701
2286
        }
1702
 
        return d[name];
1703
 
    } : function(name, ns){
1704
 
        var d = this.dom;
1705
 
        return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name) || d.getAttribute(name) || d[name];
1706
 
    },
1707
 
 
 
2287
        test = null;
 
2288
    })(),
 
2289
        
1708
2290
    
1709
2291
    update : function(html) {
1710
2292
        if (this.dom) {
4023
4605
                    url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));
4024
4606
                }
4025
4607
 
4026
 
                o.headers = Ext.apply(o.headers || {}, me.defaultHeaders || {});
 
4608
                o.headers = Ext.applyIf(o.headers || {}, me.defaultHeaders || {});
4027
4609
 
4028
4610
                if(o.autoAbort === true || me.autoAbort) {
4029
4611
                    me.abort();
4230
4812
            return n < 10 ? "0" + n : n;
4231
4813
        },
4232
4814
        doDecode = function(json){
4233
 
            return eval("(" + json + ")");    
 
4815
            return json ? eval("(" + json + ")") : "";    
4234
4816
        },
4235
4817
        doEncode = function(o){
4236
4818
            if(!Ext.isDefined(o) || o === null){
4841
5423
        if (!bd) {
4842
5424
            return false;
4843
5425
        }
4844
 
        
 
5426
 
4845
5427
        var cls = [' ',
4846
 
                Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : 'ext-ie8'))
 
5428
                Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : (Ext.isIE8 ? 'ext-ie8' : 'ext-ie9')))
4847
5429
                : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3')
4848
5430
                : Ext.isOpera ? "ext-opera"
4849
5431
                : Ext.isWebKit ? "ext-webkit" : ""];
4865
5447
        if (Ext.isStrict || Ext.isBorderBox) {
4866
5448
            var p = bd.parentNode;
4867
5449
            if (p) {
 
5450
                if (!Ext.isStrict) {
 
5451
                    Ext.fly(p, '_internal').addClass('x-quirks');
 
5452
                    if (Ext.isIE && !Ext.isStrict) {
 
5453
                        Ext.isIEQuirks = true;
 
5454
                    }
 
5455
                }
4868
5456
                Ext.fly(p, '_internal').addClass(((Ext.isStrict && Ext.isIE ) || (!Ext.enableForcedBoxModel && !Ext.isIE)) ? ' ext-strict' : ' ext-border-box');
4869
5457
            }
4870
5458
        }
5085
5673
 
5086
5674
    return new Ext.EventObjectImpl();
5087
5675
}();
5088
 
 
5089
5676
Ext.Loader = Ext.apply({}, {
5090
5677
    
5091
5678
    load: function(fileList, callback, scope, preserveOrder) {
5155
5742
 
5156
5743
 
5157
5744
Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
5158
 
       "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct");
 
5745
       "Ext.state", "Ext.layout.boxOverflow", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct", "Ext.slider");
5159
5746
    
5160
5747
 
5161
5748
Ext.apply(Ext, function(){
5746
6333
    
5747
6334
 
5748
6335
    
5749
 
    re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
 
6336
    re : /\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
5750
6337
    argsRe : /^\s*['"](.*)["']\s*$/,
5751
6338
    compileARe : /\\/g,
5752
6339
    compileBRe : /(\r\n|\n)/g,
6283
6870
       textSize,
6284
6871
       D = Ext.lib.Dom,
6285
6872
       propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,
 
6873
       unload = Ext.EventManager._unload,
6286
6874
       curWidth = 0,
6287
6875
       curHeight = 0,
6288
6876
       
6293
6881
                   !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera);
6294
6882
 
6295
6883
   return {
 
6884
       _unload: function(){
 
6885
           Ext.EventManager.un(window, "resize", this.fireWindowResize, this);
 
6886
           unload.call(Ext.EventManager);    
 
6887
       },
 
6888
       
6296
6889
       
6297
6890
       doResizeEvent: function(){
6298
6891
           var h = D.getViewHeight(),
7593
8186
                    el,
7594
8187
                    mask;
7595
8188
 
7596
 
                if (!(/^body/i.test(dom.tagName) && me.getStyle('position') == 'static')) {
 
8189
                if (!/^body/i.test(dom.tagName) && me.getStyle('position') == 'static') {
7597
8190
                    me.addClass(XMASKEDRELATIVE);
7598
8191
                }
7599
8192
                if (el = data(dom, 'maskMsg')) {
8206
8799
        
8207
8800
        return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
8208
8801
    },
 
8802
    
 
8803
    
 
8804
    formatContainsHourInfo : (function(){
 
8805
        var stripEscapeRe = /(\\.)/g,
 
8806
            hourInfoRe = /([gGhHisucUOPZ]|M\$)/;
 
8807
        return function(format){
 
8808
            return hourInfoRe.test(format.replace(stripEscapeRe, ''));
 
8809
        };
 
8810
    })(),
8209
8811
 
8210
8812
    
8211
8813
    formatCodes : {
9687
10289
};
9688
10290
Ext.extend(Ext.XTemplate, Ext.Template, {
9689
10291
    
9690
 
    re : /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,
 
10292
    re : /\{([\w\-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,
9691
10293
    
9692
10294
    codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g,
9693
10295
 
10116
10718
    del : false,
10117
10719
    home : false,
10118
10720
    end : false,
 
10721
    space : false,
10119
10722
 
10120
10723
    
10121
10724
    keyToHandler : {
10130
10733
        35 : "end",
10131
10734
        13 : "enter",
10132
10735
        27 : "esc",
10133
 
        9  : "tab"
 
10736
        9  : "tab",
 
10737
        32 : "space"
10134
10738
    },
10135
10739
    
10136
10740
    stopKeyUp: function(e) {
11566
12170
    enableShadow : function(show){
11567
12171
        if(this.shadow){
11568
12172
            this.shadowDisabled = false;
11569
 
            this.shadowOffset = this.lastShadowOffset;
11570
 
            delete this.lastShadowOffset;
 
12173
            if(Ext.isDefined(this.lastShadowOffset)) {
 
12174
                this.shadowOffset = this.lastShadowOffset;
 
12175
                delete this.lastShadowOffset;
 
12176
            }
11571
12177
            if(show){
11572
12178
                this.sync(true);
11573
12179
            }
14739
15345
 
14740
15346
    
14741
15347
    getTemplateArgs: function(field) {
14742
 
        var noLabelSep = !field.fieldLabel || field.hideLabel;
 
15348
        var noLabelSep = !field.fieldLabel || field.hideLabel,
 
15349
            itemCls = (field.itemCls || this.container.itemCls || '') + (field.hideLabel ? ' x-hide-label' : '');
 
15350
 
 
15351
        
 
15352
        if (Ext.isIE9 && Ext.isIEQuirks && field instanceof Ext.form.TextField) {
 
15353
            itemCls += ' x-input-wrapper';
 
15354
        }
14743
15355
 
14744
15356
        return {
14745
15357
            id            : field.id,
14746
15358
            label         : field.fieldLabel,
14747
 
            itemCls       : (field.itemCls || this.container.itemCls || '') + (field.hideLabel ? ' x-hide-label' : ''),
 
15359
            itemCls       : itemCls,
14748
15360
            clearCls      : field.clearCls || 'x-form-clear-left',
14749
15361
            labelStyle    : this.getLabelStyle(field.labelStyle),
14750
15362
            elementStyle  : this.elementStyle || '',
15272
15884
 
15273
15885
 
15274
15886
 
15275
 
Ext.ns('Ext.layout.boxOverflow');
15276
 
 
15277
 
 
15278
 
 
15279
15887
Ext.layout.boxOverflow.None = Ext.extend(Object, {
15280
15888
    constructor: function(layout, config) {
15281
15889
        this.layout = layout;
16178
16786
            boxes        = [],
16179
16787
            
16180
16788
            
16181
 
            child, childWidth, childHeight, childSize, childMargins, canLayout, i, calcs, flexedWidth, 
16182
 
            horizMargins, vertMargins, stretchWidth;
 
16789
            child, childWidth, childHeight, childSize, childMargins, canLayout, i, calcs, flexedHeight, 
 
16790
            horizMargins, vertMargins, stretchWidth, length;
16183
16791
 
16184
16792
        
16185
16793
        for (i = 0; i < visibleCount; i++) {
16789
17397
            if(w){
16790
17398
                ct.setWidth(w);
16791
17399
            }else if(Ext.isIE){
16792
 
                ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8) ? 'auto' : ct.minWidth);
 
17400
                ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8 || Ext.isIE9) ? 'auto' : ct.minWidth);
16793
17401
                var el = ct.getEl(), t = el.dom.offsetWidth; 
16794
17402
                ct.setWidth(ct.getLayoutTarget().getWidth() + el.getFrameWidth('lr'));
16795
17403
            }
18980
19588
            um.un('failure', this.onLoad, this);
18981
19589
        }
18982
19590
    }
18983
 
};Ext.ns('Ext.slider');
18984
 
 
18985
 
 
 
19591
};
18986
19592
Ext.slider.Thumb = Ext.extend(Object, {
18987
19593
    
18988
19594
    
21047
21653
                return null;
21048
21654
            }
21049
21655
 
21050
 
            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
 
21656
            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l, region;
21051
21657
 
21052
21658
            try {
21053
21659
                pos= Ext.lib.Dom.getXY(el);
21067
21673
            b = y2 + oDD.padding[2];
21068
21674
            l = x1 - oDD.padding[3];
21069
21675
 
21070
 
            return new Ext.lib.Region( t, r, b, l );
 
21676
            region = new Ext.lib.Region( t, r, b, l );
 
21677
            
 
21678
            el = Ext.get(el.parentNode);
 
21679
            while (el && region) {
 
21680
                    if (el.isScrollable()) {
 
21681
                        
 
21682
                        region = region.intersect(el.getRegion());
 
21683
                    }
 
21684
                    el = el.parent();
 
21685
            }
 
21686
            return region;
21071
21687
        },
21072
21688
 
21073
21689
        
21123
21739
 
21124
21740
        
21125
21741
        _onUnload: function(e, me) {
 
21742
            Event.removeListener(document, "mouseup",   this.handleMouseUp, this);
 
21743
            Event.removeListener(document, "mousemove", this.handleMouseMove, this);
 
21744
            Event.removeListener(window,   "resize",    this._onResize, this);
21126
21745
            Ext.dd.DragDropMgr.unregAll();
21127
21746
        },
21128
21747
 
23422
24041
    },
23423
24042
    
23424
24043
    
23425
 
    doUpdate : function(rec){
23426
 
        this.data.replace(rec.id, rec);
23427
 
        if(this.snapshot){
23428
 
            this.snapshot.replace(rec.id, rec);
 
24044
    doUpdate: function(rec){
 
24045
        var id = rec.id;
 
24046
        
 
24047
        this.getById(id).join(null);
 
24048
        
 
24049
        this.data.replace(id, rec);
 
24050
        if (this.snapshot) {
 
24051
            this.snapshot.replace(id, rec);
23429
24052
        }
 
24053
        rec.join(this);
23430
24054
        this.fireEvent('update', this, rec, Ext.data.Record.COMMIT);
23431
24055
    },
23432
24056
 
23827
24451
        if (success === true) {
23828
24452
            try {
23829
24453
                this.reader.realize(rs, data);
23830
 
                this.reMap(rs);
23831
24454
            }
23832
24455
            catch (e) {
23833
24456
                this.handleException(e);
24478
25101
            rs.data = data;
24479
25102
 
24480
25103
            rs.commit();
 
25104
            rs.store.reMap(rs);
24481
25105
        }
24482
25106
    },
24483
25107
 
25383
26007
            throw new Ext.data.JsonReader.Error('response');
25384
26008
        }
25385
26009
 
25386
 
        var root = this.getRoot(o);
25387
 
        if (action === Ext.data.Api.actions.create) {
 
26010
        var root = this.getRoot(o),
 
26011
            success = this.getSuccess(o);
 
26012
        if (success && action === Ext.data.Api.actions.create) {
25388
26013
            var def = Ext.isDefined(root);
25389
26014
            if (def && Ext.isEmpty(root)) {
25390
26015
                throw new Ext.data.JsonReader.Error('root-empty', this.meta.root);
25397
26022
        
25398
26023
        var res = new Ext.data.Response({
25399
26024
            action: action,
25400
 
            success: this.getSuccess(o),
 
26025
            success: success,
25401
26026
            data: (root) ? this.extractData(root, false) : [],
25402
26027
            message: this.getMessage(o),
25403
26028
            raw: o
27508
28133
 
27509
28134
   
27510
28135
    onEsc : function(k, e){
 
28136
        if (this.activeGhost) {
 
28137
            this.unghost();
 
28138
        }
27511
28139
        e.stopEvent();
27512
28140
        this[this.closeAction]();
27513
28141
    },
27822
28450
                var s = this.getSize();
27823
28451
                offsets = {
27824
28452
                    right:-(s.width - 100),
27825
 
                    bottom:-(s.height - 25)
 
28453
                    bottom:-(s.height - 25 + this.el.getConstrainOffset())
27826
28454
                };
27827
28455
            }
27828
28456
 
30771
31399
 
30772
31400
    initComponent : function(){
30773
31401
        if(this.menu){
 
31402
            
 
31403
            
 
31404
            if (Ext.isArray(this.menu)){
 
31405
                this.menu = { items: this.menu };
 
31406
            }
 
31407
            
 
31408
            
 
31409
            
 
31410
            if (Ext.isObject(this.menu)){
 
31411
                this.menu.ownerCt = this;
 
31412
            }
 
31413
            
30774
31414
            this.menu = Ext.menu.MenuMgr.get(this.menu);
30775
 
            this.menu.ownerCt = this;
 
31415
            this.menu.ownerCt = undefined;
30776
31416
        }
30777
31417
        
30778
31418
        Ext.Button.superclass.initComponent.call(this);
30796
31436
            'menutriggerout'
30797
31437
        );
30798
31438
        
30799
 
        if (this.menu){
30800
 
            this.menu.ownerCt = undefined;
30801
 
        }
30802
31439
        if(Ext.isString(this.toggleGroup)){
30803
31440
            this.enableToggle = true;
30804
31441
        }
31409
32046
            }
31410
32047
            this.activeItem = item;
31411
32048
            if(!item.checked){
31412
 
                item.setChecked(true, false);
 
32049
                item.setChecked(true, suppressEvent);
31413
32050
            }
31414
32051
            if(this.forceIcon){
31415
32052
                this.setIconClass(this.forceIcon);
32168
32805
    var currentToken;
32169
32806
 
32170
32807
    function getHash() {
32171
 
        var href = location.href, i = href.indexOf("#");
32172
 
        return i >= 0 ? href.substr(i + 1) : null;
 
32808
        var href = location.href, i = href.indexOf("#"),
 
32809
            hash = i >= 0 ? href.substr(i + 1) : null;
 
32810
             
 
32811
        if (Ext.isGecko) {
 
32812
            hash = decodeURIComponent(hash);
 
32813
        }
 
32814
        return hash;
32173
32815
    }
32174
32816
 
32175
32817
    function doSave() {
32218
32860
            if (newtoken !== token) {
32219
32861
                token = newtoken;
32220
32862
                handleStateChange(token);
32221
 
                top.location.hash = token;
 
32863
                location.hash = token;
32222
32864
                hash = token;
32223
32865
                doSave();
32224
32866
            } else if (newHash !== hash) {
32299
32941
            if (Ext.isIE) {
32300
32942
                return updateIFrame(token);
32301
32943
            } else {
32302
 
                top.location.hash = token;
 
32944
                location.hash = token;
32303
32945
                return true;
32304
32946
            }
32305
32947
        },
32842
33484
 
32843
33485
    
32844
33486
    adjustPosition : function(x, y){
32845
 
        if(this.contstrainPosition){
 
33487
        if(this.constrainPosition){
32846
33488
            var ay = this.targetXY[1], h = this.getSize().height;
32847
33489
            if(y <= ay && (y+h) >= ay){
32848
33490
                y = ay-h-5;
36043
36685
    });
36044
36686
 
36045
36687
    var desc = this.dir && this.dir.toLowerCase() == 'desc',
36046
 
        prop = this.property || 'text';
36047
 
        sortType = this.sortType;
36048
 
        folderSort = this.folderSort;
36049
 
        caseSensitive = this.caseSensitive === true;
 
36688
        prop = this.property || 'text',
 
36689
        sortType = this.sortType,
 
36690
        folderSort = this.folderSort,
 
36691
        caseSensitive = this.caseSensitive === true,
36050
36692
        leafAttr = this.leafAttr || 'leaf';
36051
36693
 
36052
36694
    if(Ext.isString(sortType)){
36066
36708
        }
36067
36709
        var prop1 = attr1[prop],
36068
36710
            prop2 = attr2[prop],
36069
 
            v1 = sortType ? sortType(prop1) : (caseSensitive ? prop1 : prop1.toUpperCase());
 
36711
            v1 = sortType ? sortType(prop1) : (caseSensitive ? prop1 : prop1.toUpperCase()),
36070
36712
            v2 = sortType ? sortType(prop2) : (caseSensitive ? prop2 : prop2.toUpperCase());
36071
36713
            
36072
36714
        if(v1 < v2){
36095
36737
        }
36096
36738
    }    
36097
36739
});
 
36740
 
36098
36741
if(Ext.dd.DropZone){
36099
36742
    
36100
36743
Ext.tree.TreeDropZone = function(tree, config){
37150
37793
                    swfobject[l] = null;
37151
37794
                }
37152
37795
                swfobject = null;
 
37796
                window.detachEvent('onunload', arguments.callee);
37153
37797
            });
37154
37798
        }
37155
37799
    }();
38466
39110
 
38467
39111
    
38468
39112
    getMenuItem : function(config) {
 
39113
        config.ownerCt = this;
 
39114
        
38469
39115
        if (!config.isXType) {
38470
39116
            if (!config.xtype && Ext.isBoolean(config.checked)) {
38471
39117
                return new Ext.menu.CheckItem(config);
38598
39244
}());
38599
39245
 
38600
39246
Ext.menu.MenuMgr = function(){
38601
 
   var menus, active, groups = {}, attached = false, lastShow = new Date();
 
39247
   var menus, 
 
39248
       active, 
 
39249
       map,
 
39250
       groups = {}, 
 
39251
       attached = false, 
 
39252
       lastShow = new Date();
 
39253
   
38602
39254
 
38603
39255
   
38604
39256
   function init(){
38605
39257
       menus = {};
38606
39258
       active = new Ext.util.MixedCollection();
38607
 
       Ext.getDoc().addKeyListener(27, function(){
38608
 
           if(active.length > 0){
38609
 
               hideAll();
38610
 
           }
38611
 
       });
 
39259
       map = Ext.getDoc().addKeyListener(27, hideAll);
 
39260
       map.disable();
38612
39261
   }
38613
39262
 
38614
39263
   
38627
39276
   function onHide(m){
38628
39277
       active.remove(m);
38629
39278
       if(active.length < 1){
 
39279
           map.disable();
38630
39280
           Ext.getDoc().un("mousedown", onMouseDown);
38631
39281
           attached = false;
38632
39282
       }
38638
39288
       lastShow = new Date();
38639
39289
       active.add(m);
38640
39290
       if(!attached){
 
39291
           map.enable();
38641
39292
           Ext.getDoc().on("mousedown", onMouseDown);
38642
39293
           attached = true;
38643
39294
       }
38881
39532
        var pm = this.parentMenu;
38882
39533
        if(this.hideOnClick){
38883
39534
            if(pm.floating){
38884
 
                pm.hide.defer(this.clickHideDelay, pm, [true]);
 
39535
                this.clickHideDelayTimer = pm.hide.defer(this.clickHideDelay, pm, [true]);
38885
39536
            }else{
38886
39537
                pm.deactivateActive();
38887
39538
            }
38888
39539
        }
38889
39540
    },
 
39541
    
 
39542
    beforeDestroy: function(){
 
39543
        clearTimeout(this.clickHideDelayTimer);
 
39544
        Ext.menu.BaseItem.superclass.beforeDestroy.call(this);    
 
39545
    },
38890
39546
 
38891
39547
    
38892
39548
    expandMenu : Ext.emptyFn,
38968
39624
    initComponent : function(){
38969
39625
        Ext.menu.Item.superclass.initComponent.call(this);
38970
39626
        if(this.menu){
 
39627
            
 
39628
            
 
39629
            if (Ext.isArray(this.menu)){
 
39630
                this.menu = { items: this.menu };
 
39631
            }
 
39632
            
 
39633
            
 
39634
            
 
39635
            if (Ext.isObject(this.menu)){
 
39636
                this.menu.ownerCt = this;
 
39637
            }
 
39638
            
38971
39639
            this.menu = Ext.menu.MenuMgr.get(this.menu);
38972
 
            this.menu.ownerCt = this;
 
39640
            this.menu.ownerCt = undefined;
38973
39641
        }
38974
39642
    },
38975
39643
 
39030
39698
 
39031
39699
    
39032
39700
    beforeDestroy: function(){
 
39701
        clearTimeout(this.showTimer);
 
39702
        clearTimeout(this.hideTimer);
39033
39703
        if (this.menu){
39034
39704
            delete this.menu.ownerCt;
39035
39705
            this.menu.destroy();
39511
40181
        }
39512
40182
        var restore = this.preventMark;
39513
40183
        this.preventMark = preventMark === true;
39514
 
        var v = this.validateValue(this.processValue(this.getRawValue()));
 
40184
        var v = this.validateValue(this.processValue(this.getRawValue()), preventMark);
39515
40185
        this.preventMark = restore;
39516
40186
        return v;
39517
40187
    },
40586
41256
    },
40587
41257
 
40588
41258
    setValue : function(v) {
 
41259
        v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
40589
41260
        v = this.fixPrecision(v);
40590
 
        v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
40591
41261
        v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator);
40592
41262
        return Ext.form.NumberField.superclass.setValue.call(this, v);
40593
41263
    },
40670
41340
 
40671
41341
    
40672
41342
    safeParse : function(value, format) {
40673
 
        if (/[gGhH]/.test(format.replace(/(\\.)/g, ''))) {
 
41343
        if (Date.formatContainsHourInfo(format)) {
40674
41344
            
40675
41345
            return Date.parseDate(value, format);
40676
41346
        } else {
40677
41347
            
40678
41348
            var parsedDate = Date.parseDate(value + ' ' + this.initTime, format + ' ' + this.initTimeFormat);
40679
 
 
 
41349
 
40680
41350
            if (parsedDate) {
40681
41351
                return parsedDate.clearTime();
40682
41352
            }
41976
42646
        var checked = this.checked,
41977
42647
            inputVal = this.inputValue;
41978
42648
            
41979
 
        this.checked = (v === true || v === 'true' || v == '1' || (inputVal ? v == inputVal : String(v).toLowerCase() == 'on'));
 
42649
        if (v === false) {
 
42650
            this.checked = false;
 
42651
        } else {
 
42652
            this.checked = (v === true || v === 'true' || v == '1' || (inputVal ? v == inputVal : String(v).toLowerCase() == 'on'));
 
42653
        }
 
42654
        
41980
42655
        if(this.rendered){
41981
42656
            this.el.dom.checked = this.checked;
41982
42657
            this.el.dom.defaultChecked = this.checked;
42494
43169
 
42495
43170
        this.fieldErrors.replace(name, error);
42496
43171
 
42497
 
        field.el.addClass(field.invalidClass);
 
43172
        if (!field.preventMark) {
 
43173
            field.el.addClass(field.invalidClass);
 
43174
        }
42498
43175
    },
42499
43176
 
42500
43177
    
42529
43206
    },
42530
43207
 
42531
43208
    
42532
 
    validateValue: function() {
 
43209
    validateValue: function(value, preventMark) {
42533
43210
        var valid = true;
42534
43211
 
42535
43212
        this.eachItem(function(field) {
42536
 
            if (!field.isValid()) valid = false;
 
43213
            if (!field.isValid(preventMark)) {
 
43214
                valid = false;
 
43215
            }
42537
43216
        });
42538
43217
 
42539
43218
        return valid;
42695
43374
    
42696
43375
    getGroupValue : function(){
42697
43376
        var p = this.el.up('form') || Ext.getBody();
42698
 
        var c = p.child('input[name='+this.el.dom.name+']:checked', true);
 
43377
        var c = p.child('input[name="'+this.el.dom.name+'"]:checked', true);
42699
43378
        return c ? c.value : null;
42700
43379
    },
42701
43380
 
42708
43387
            Ext.form.Radio.superclass.setValue.call(this, v);
42709
43388
        } else if (this.rendered) {
42710
43389
            checkEl = this.getCheckEl();
42711
 
            radio = checkEl.child('input[name=' + this.el.dom.name + '][value=' + v + ']', true);
 
43390
            radio = checkEl.child('input[name="' + this.el.dom.name + '"][value="' + v + '"]', true);
42712
43391
            if(radio){
42713
43392
                Ext.getCmp(radio.id).setValue(true);
42714
43393
            }
42715
43394
        }
42716
43395
        if(this.rendered && this.checked){
42717
43396
            checkEl = checkEl || this.getCheckEl();
42718
 
            els = this.getCheckEl().select('input[name=' + this.el.dom.name + ']');
 
43397
            els = this.getCheckEl().select('input[name="' + this.el.dom.name + '"]');
42719
43398
                        els.each(function(el){
42720
43399
                                if(el.dom.id != this.id){
42721
43400
                                        Ext.getCmp(el.dom.id).setValue(false);
43004
43683
            field = this.findField(f.name);
43005
43684
            if(field){
43006
43685
                value = field.getValue();
43007
 
                if (typeof value != undefined && value.getGroupValue) {
 
43686
                if (Ext.type(value) !== false && value.getGroupValue) {
43008
43687
                    value = value.getGroupValue();
43009
43688
                } else if ( field.eachItem ) {
43010
43689
                    value = [];
44926
45605
        this.result = this.handleResponse(response);
44927
45606
        return this.result;
44928
45607
    },
 
45608
    
 
45609
    decodeResponse: function(response) {
 
45610
        try {
 
45611
            return Ext.decode(response.responseText);
 
45612
        } catch(e) {
 
45613
            return false;
 
45614
        } 
 
45615
    },
44929
45616
 
44930
45617
    
44931
45618
    getUrl : function(appendParams){
45058
45745
                errors : errors
45059
45746
            };
45060
45747
        }
45061
 
        return Ext.decode(response.responseText);
 
45748
        return this.decodeResponse(response);
45062
45749
    }
45063
45750
});
45064
45751
 
45107
45794
                data : data
45108
45795
            };
45109
45796
        }
45110
 
        return Ext.decode(response.responseText);
 
45797
        return this.decodeResponse(response);
45111
45798
    }
45112
45799
});
45113
45800
 
45211
45898
    
45212
45899
    var alpha = /^[a-zA-Z_]+$/,
45213
45900
        alphanum = /^[a-zA-Z0-9_]+$/,
45214
 
        email = /^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,
 
45901
        email = /^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,
45215
45902
        url = /(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
45216
45903
 
45217
45904
    
45223
45910
        
45224
45911
        'emailText' : 'This field should be an e-mail address in the format "user@example.com"',
45225
45912
        
45226
 
        'emailMask' : /[a-z0-9_\.\-@\+]/i,
 
45913
        'emailMask' : /[a-z0-9_\.\-\+\'@]/i,
45227
45914
 
45228
 
        
 
45915
        /**
 
45916
         * The function used to validate URLs
 
45917
         * @param {String} value The URL
 
45918
         * @return {Boolean} true if the RegExp test passed, and false if not.
 
45919
         */
45229
45920
        'url' : function(v){
45230
45921
            return url.test(v);
45231
45922
        },
45232
 
        
 
45923
        /**
 
45924
         * The error text to display when the url validation function returns false.  Defaults to:
 
45925
         * <tt>'This field should be a URL in the format "http:/'+'/www.example.com"'</tt>
 
45926
         * @type String
 
45927
         */
45233
45928
        'urlText' : 'This field should be a URL in the format "http:/'+'/www.example.com"',
45234
45929
 
45235
 
        
 
45930
        /**
 
45931
         * The function used to validate alpha values
 
45932
         * @param {String} value The value
 
45933
         * @return {Boolean} true if the RegExp test passed, and false if not.
 
45934
         */
45236
45935
        'alpha' : function(v){
45237
45936
            return alpha.test(v);
45238
45937
        },
45239
 
        
 
45938
        /**
 
45939
         * The error text to display when the alpha validation function returns false.  Defaults to:
 
45940
         * <tt>'This field should only contain letters and _'</tt>
 
45941
         * @type String
 
45942
         */
45240
45943
        'alphaText' : 'This field should only contain letters and _',
45241
 
        
 
45944
        /**
 
45945
         * The keystroke filter mask to be applied on alpha input.  Defaults to:
 
45946
         * <tt>/[a-z_]/i</tt>
 
45947
         * @type RegExp
 
45948
         */
45242
45949
        'alphaMask' : /[a-z_]/i,
45243
45950
 
45244
 
        
 
45951
        /**
 
45952
         * The function used to validate alphanumeric values
 
45953
         * @param {String} value The value
 
45954
         * @return {Boolean} true if the RegExp test passed, and false if not.
 
45955
         */
45245
45956
        'alphanum' : function(v){
45246
45957
            return alphanum.test(v);
45247
45958
        },
45248
 
        
 
45959
        /**
 
45960
         * The error text to display when the alphanumeric validation function returns false.  Defaults to:
 
45961
         * <tt>'This field should only contain letters, numbers and _'</tt>
 
45962
         * @type String
 
45963
         */
45249
45964
        'alphanumText' : 'This field should only contain letters, numbers and _',
45250
 
        
 
45965
        /**
 
45966
         * The keystroke filter mask to be applied on alphanumeric input.  Defaults to:
 
45967
         * <tt>/[a-z0-9_]/i</tt>
 
45968
         * @type RegExp
 
45969
         */
45251
45970
        'alphanumMask' : /[a-z0-9_]/i
45252
45971
    };
45253
45972
}();
 
45973
/**
 
45974
 * @class Ext.grid.GridPanel
 
45975
 * @extends Ext.Panel
 
45976
 * <p>This class represents the primary interface of a component based grid control to represent data
 
45977
 * in a tabular format of rows and columns. The GridPanel is composed of the following:</p>
 
45978
 * <div class="mdetail-params"><ul>
 
45979
 * <li><b>{@link Ext.data.Store Store}</b> : The Model holding the data records (rows)
 
45980
 * <div class="sub-desc"></div></li>
 
45981
 * <li><b>{@link Ext.grid.ColumnModel Column model}</b> : Column makeup
 
45982
 * <div class="sub-desc"></div></li>
 
45983
 * <li><b>{@link Ext.grid.GridView View}</b> : Encapsulates the user interface
 
45984
 * <div class="sub-desc"></div></li>
 
45985
 * <li><b>{@link Ext.grid.AbstractSelectionModel selection model}</b> : Selection behavior
 
45986
 * <div class="sub-desc"></div></li>
 
45987
 * </ul></div>
 
45988
 * <p>Example usage:</p>
 
45989
 * <pre><code>
 
45990
var grid = new Ext.grid.GridPanel({
 
45991
    {@link #store}: new {@link Ext.data.Store}({
 
45992
        {@link Ext.data.Store#autoDestroy autoDestroy}: true,
 
45993
        {@link Ext.data.Store#reader reader}: reader,
 
45994
        {@link Ext.data.Store#data data}: xg.dummyData
 
45995
    }),
 
45996
    {@link #colModel}: new {@link Ext.grid.ColumnModel}({
 
45997
        {@link Ext.grid.ColumnModel#defaults defaults}: {
 
45998
            width: 120,
 
45999
            sortable: true
 
46000
        },
 
46001
        {@link Ext.grid.ColumnModel#columns columns}: [
 
46002
            {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
 
46003
            {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
 
46004
            {header: 'Change', dataIndex: 'change'},
 
46005
            {header: '% Change', dataIndex: 'pctChange'},
 
46006
            // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype
 
46007
            {
 
46008
                header: 'Last Updated', width: 135, dataIndex: 'lastChange',
 
46009
                xtype: 'datecolumn', format: 'M d, Y'
 
46010
            }
 
46011
        ]
 
46012
    }),
 
46013
    {@link #viewConfig}: {
 
46014
        {@link Ext.grid.GridView#forceFit forceFit}: true,
45254
46015
 
 
46016
//      Return CSS class to apply to rows depending upon data values
 
46017
        {@link Ext.grid.GridView#getRowClass getRowClass}: function(record, index) {
 
46018
            var c = record.{@link Ext.data.Record#get get}('change');
 
46019
            if (c < 0) {
 
46020
                return 'price-fall';
 
46021
            } else if (c > 0) {
 
46022
                return 'price-rise';
 
46023
            }
 
46024
        }
 
46025
    },
 
46026
    {@link #sm}: new Ext.grid.RowSelectionModel({singleSelect:true}),
 
46027
    width: 600,
 
46028
    height: 300,
 
46029
    frame: true,
 
46030
    title: 'Framed with Row Selection and Horizontal Scrolling',
 
46031
    iconCls: 'icon-grid'
 
46032
});
 
46033
 * </code></pre>
 
46034
 * <p><b><u>Notes:</u></b></p>
 
46035
 * <div class="mdetail-params"><ul>
 
46036
 * <li>Although this class inherits many configuration options from base classes, some of them
 
46037
 * (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will
 
46038
 * have no effect.</li>
 
46039
 * <li>A grid <b>requires</b> a width in which to scroll its columns, and a height in which to
 
46040
 * scroll its rows. These dimensions can either be set explicitly through the
 
46041
 * <tt>{@link Ext.BoxComponent#height height}</tt> and <tt>{@link Ext.BoxComponent#width width}</tt>
 
46042
 * configuration options or implicitly set by using the grid as a child item of a
 
46043
 * {@link Ext.Container Container} which will have a {@link Ext.Container#layout layout manager}
 
46044
 * provide the sizing of its child items (for example the Container of the Grid may specify
 
46045
 * <tt>{@link Ext.Container#layout layout}:'fit'</tt>).</li>
 
46046
 * <li>To access the data in a Grid, it is necessary to use the data model encapsulated
 
46047
 * by the {@link #store Store}. See the {@link #cellclick} event for more details.</li>
 
46048
 * </ul></div>
 
46049
 * @constructor
 
46050
 * @param {Object} config The config object
 
46051
 * @xtype grid
 
46052
 */
45255
46053
Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
45256
 
    
 
46054
    /**
 
46055
     * @cfg {String} autoExpandColumn
 
46056
     * <p>The <tt>{@link Ext.grid.Column#id id}</tt> of a {@link Ext.grid.Column column} in
 
46057
     * this grid that should expand to fill unused space. This value specified here can not
 
46058
     * be <tt>0</tt>.</p>
 
46059
     * <br><p><b>Note</b>: If the Grid's {@link Ext.grid.GridView view} is configured with
 
46060
     * <tt>{@link Ext.grid.GridView#forceFit forceFit}=true</tt> the <tt>autoExpandColumn</tt>
 
46061
     * is ignored. See {@link Ext.grid.Column}.<tt>{@link Ext.grid.Column#width width}</tt>
 
46062
     * for additional details.</p>
 
46063
     * <p>See <tt>{@link #autoExpandMax}</tt> and <tt>{@link #autoExpandMin}</tt> also.</p>
 
46064
     */
45257
46065
    autoExpandColumn : false,
45258
46066
    
45259
46067
    
48093
48901
            rowBuffer     = [],
48094
48902
            meta          = {},
48095
48903
            tstyle        = 'width:' + this.getGridInnerWidth() + 'px;',
48096
 
            colBuffer, column, i;
 
48904
            colBuffer, colCount, column, i, row;
48097
48905
        
48098
48906
        startRow = startRow || 0;
48099
48907
        endRow   = Ext.isDefined(endRow) ? endRow : rowCount - 1;
48103
48911
            colCount  = row.length;
48104
48912
            colBuffer = [];
48105
48913
            
48106
 
            rowIndex = startRow + i;
48107
 
 
48108
48914
            
48109
 
            for (j = 0; j < colCount; j++) {
48110
 
                cell = row[j];
48111
 
 
 
48915
            for (var j = 0; j < colCount; j++) {
 
48916
                
 
48917
                meta.id    = i + '-' + j;
48112
48918
                meta.css   = j === 0 ? 'x-grid3-cell-first ' : (j == (colCount - 1) ? 'x-grid3-cell-last ' : '');
48113
48919
                meta.attr  = meta.cellAttr = '';
48114
 
                meta.value = cell;
 
48920
                meta.value = row[j];
48115
48921
 
48116
48922
                if (Ext.isEmpty(meta.value)) {
48117
48923
                    meta.value = '&#160;';
48218
49024
    },
48219
49025
    
48220
49026
    
 
49027
    getCellIndex : function(el) {
 
49028
        if (el) {
 
49029
            var match = el.className.match(this.colRe),
 
49030
                data;
 
49031
 
 
49032
            if (match && (data = match[1])) {
 
49033
                return parseInt(data.split('-')[1], 10);
 
49034
            }
 
49035
        }
 
49036
        return false;
 
49037
    },
 
49038
    
 
49039
    
 
49040
    
48221
49041
    renderUI : function() {
48222
49042
        var templates  = this.templates,
48223
49043
            innerWidth = this.getGridInnerWidth();
48509
49329
        var tuples     = this.getTuples(),
48510
49330
            rowCount   = tuples.length,
48511
49331
            dimensions = this.dimensions,
 
49332
            dimension,
48512
49333
            colCount   = dimensions.length,
48513
49334
            headers    = [],
48514
49335
            tuple, rows, currentHeader, previousHeader, span, start, isLast, changed, i, j;
49896
50717
            meta.css += ' x-action-col-cell';
49897
50718
            for (i = 0; i < l; i++) {
49898
50719
                item = items[i];
49899
 
                v += '<img alt="' + me.altText + '" src="' + (item.icon || Ext.BLANK_IMAGE_URL) +
 
50720
                v += '<img alt="' + (item.altText || me.altText) + '" src="' + (item.icon || Ext.BLANK_IMAGE_URL) +
49900
50721
                    '" class="x-action-col-icon x-action-col-' + String(i) + ' ' + (item.iconCls || '') +
49901
50722
                    ' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope||this.scope||this, arguments) : '') + '"' +
49902
50723
                    ((item.tooltip) ? ' ext:qtip="' + item.tooltip + '"' : '') + ' />';
50985
51806
 
50986
51807
    
50987
51808
    toggleGroup : function(group, expanded){
50988
 
        var gel = Ext.get(group);
 
51809
        var gel = Ext.get(group),
 
51810
            id = Ext.util.Format.htmlEncode(gel.id);
 
51811
 
50989
51812
        expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed');
50990
 
        if(this.state[gel.id] !== expanded){
 
51813
        if(this.state[id] !== expanded){
50991
51814
            if (this.cancelEditOnToggle !== false) {
50992
51815
                this.grid.stopEditing(true);
50993
51816
            }
50994
 
            this.state[gel.id] = expanded;
 
51817
            this.state[id] = expanded;
50995
51818
            gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');
50996
51819
        }
50997
51820
    },