Mercurial > laserkard
diff onlypaths/js/ext/ext-all-debug.js @ 46:26c2b3ad21c7 laserkard
[svn r47] saving progresswww.cinemassacre.com/new/?page_id=30
author | rlm |
---|---|
date | Sun, 31 Jan 2010 12:33:33 -0500 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/onlypaths/js/ext/ext-all-debug.js Sun Jan 31 12:33:33 2010 -0500 1.3 @@ -0,0 +1,34343 @@ 1.4 +/* 1.5 + * Ext JS Library 2.1 1.6 + * Copyright(c) 2006-2008, Ext JS, LLC. 1.7 + * licensing@extjs.com 1.8 + * 1.9 + * http://extjs.com/license 1.10 + */ 1.11 + 1.12 + 1.13 +Ext.DomHelper = function(){ 1.14 + var tempTableEl = null; 1.15 + var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i; 1.16 + var tableRe = /^table|tbody|tr|td$/i; 1.17 + 1.18 + var createHtml = function(o){ 1.19 + if(typeof o == 'string'){ 1.20 + return o; 1.21 + } 1.22 + var b = ""; 1.23 + if (Ext.isArray(o)) { 1.24 + for (var i = 0, l = o.length; i < l; i++) { 1.25 + b += createHtml(o[i]); 1.26 + } 1.27 + return b; 1.28 + } 1.29 + if(!o.tag){ 1.30 + o.tag = "div"; 1.31 + } 1.32 + b += "<" + o.tag; 1.33 + for(var attr in o){ 1.34 + if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof o[attr] == "function") continue; 1.35 + if(attr == "style"){ 1.36 + var s = o["style"]; 1.37 + if(typeof s == "function"){ 1.38 + s = s.call(); 1.39 + } 1.40 + if(typeof s == "string"){ 1.41 + b += ' style="' + s + '"'; 1.42 + }else if(typeof s == "object"){ 1.43 + b += ' style="'; 1.44 + for(var key in s){ 1.45 + if(typeof s[key] != "function"){ 1.46 + b += key + ":" + s[key] + ";"; 1.47 + } 1.48 + } 1.49 + b += '"'; 1.50 + } 1.51 + }else{ 1.52 + if(attr == "cls"){ 1.53 + b += ' class="' + o["cls"] + '"'; 1.54 + }else if(attr == "htmlFor"){ 1.55 + b += ' for="' + o["htmlFor"] + '"'; 1.56 + }else{ 1.57 + b += " " + attr + '="' + o[attr] + '"'; 1.58 + } 1.59 + } 1.60 + } 1.61 + if(emptyTags.test(o.tag)){ 1.62 + b += "/>"; 1.63 + }else{ 1.64 + b += ">"; 1.65 + var cn = o.children || o.cn; 1.66 + if(cn){ 1.67 + b += createHtml(cn); 1.68 + } else if(o.html){ 1.69 + b += o.html; 1.70 + } 1.71 + b += "</" + o.tag + ">"; 1.72 + } 1.73 + return b; 1.74 + }; 1.75 + 1.76 + 1.77 + var createDom = function(o, parentNode){ 1.78 + var el; 1.79 + if (Ext.isArray(o)) { el = document.createDocumentFragment(); for(var i = 0, l = o.length; i < l; i++) { 1.80 + createDom(o[i], el); 1.81 + } 1.82 + } else if (typeof o == "string") { el = document.createTextNode(o); 1.83 + } else { 1.84 + el = document.createElement(o.tag||'div'); 1.85 + var useSet = !!el.setAttribute; for(var attr in o){ 1.86 + if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || attr == "style" || typeof o[attr] == "function") continue; 1.87 + if(attr=="cls"){ 1.88 + el.className = o["cls"]; 1.89 + }else{ 1.90 + if(useSet) el.setAttribute(attr, o[attr]); 1.91 + else el[attr] = o[attr]; 1.92 + } 1.93 + } 1.94 + Ext.DomHelper.applyStyles(el, o.style); 1.95 + var cn = o.children || o.cn; 1.96 + if(cn){ 1.97 + createDom(cn, el); 1.98 + } else if(o.html){ 1.99 + el.innerHTML = o.html; 1.100 + } 1.101 + } 1.102 + if(parentNode){ 1.103 + parentNode.appendChild(el); 1.104 + } 1.105 + return el; 1.106 + }; 1.107 + 1.108 + var ieTable = function(depth, s, h, e){ 1.109 + tempTableEl.innerHTML = [s, h, e].join(''); 1.110 + var i = -1, el = tempTableEl; 1.111 + while(++i < depth){ 1.112 + el = el.firstChild; 1.113 + } 1.114 + return el; 1.115 + }; 1.116 + 1.117 + var ts = '<table>', 1.118 + te = '</table>', 1.119 + tbs = ts+'<tbody>', 1.120 + tbe = '</tbody>'+te, 1.121 + trs = tbs + '<tr>', 1.122 + tre = '</tr>'+tbe; 1.123 + 1.124 + 1.125 + var insertIntoTable = function(tag, where, el, html){ 1.126 + if(!tempTableEl){ 1.127 + tempTableEl = document.createElement('div'); 1.128 + } 1.129 + var node; 1.130 + var before = null; 1.131 + if(tag == 'td'){ 1.132 + if(where == 'afterbegin' || where == 'beforeend'){ return; 1.133 + } 1.134 + if(where == 'beforebegin'){ 1.135 + before = el; 1.136 + el = el.parentNode; 1.137 + } else{ 1.138 + before = el.nextSibling; 1.139 + el = el.parentNode; 1.140 + } 1.141 + node = ieTable(4, trs, html, tre); 1.142 + } 1.143 + else if(tag == 'tr'){ 1.144 + if(where == 'beforebegin'){ 1.145 + before = el; 1.146 + el = el.parentNode; 1.147 + node = ieTable(3, tbs, html, tbe); 1.148 + } else if(where == 'afterend'){ 1.149 + before = el.nextSibling; 1.150 + el = el.parentNode; 1.151 + node = ieTable(3, tbs, html, tbe); 1.152 + } else{ if(where == 'afterbegin'){ 1.153 + before = el.firstChild; 1.154 + } 1.155 + node = ieTable(4, trs, html, tre); 1.156 + } 1.157 + } else if(tag == 'tbody'){ 1.158 + if(where == 'beforebegin'){ 1.159 + before = el; 1.160 + el = el.parentNode; 1.161 + node = ieTable(2, ts, html, te); 1.162 + } else if(where == 'afterend'){ 1.163 + before = el.nextSibling; 1.164 + el = el.parentNode; 1.165 + node = ieTable(2, ts, html, te); 1.166 + } else{ 1.167 + if(where == 'afterbegin'){ 1.168 + before = el.firstChild; 1.169 + } 1.170 + node = ieTable(3, tbs, html, tbe); 1.171 + } 1.172 + } else{ if(where == 'beforebegin' || where == 'afterend'){ return; 1.173 + } 1.174 + if(where == 'afterbegin'){ 1.175 + before = el.firstChild; 1.176 + } 1.177 + node = ieTable(2, ts, html, te); 1.178 + } 1.179 + el.insertBefore(node, before); 1.180 + return node; 1.181 + }; 1.182 + 1.183 + 1.184 + return { 1.185 + 1.186 + useDom : false, 1.187 + 1.188 + 1.189 + markup : function(o){ 1.190 + return createHtml(o); 1.191 + }, 1.192 + 1.193 + 1.194 + applyStyles : function(el, styles){ 1.195 + if(styles){ 1.196 + el = Ext.fly(el); 1.197 + if(typeof styles == "string"){ 1.198 + var re = /\s?([a-z\-]*)\:\s?([^;]*);?/gi; 1.199 + var matches; 1.200 + while ((matches = re.exec(styles)) != null){ 1.201 + el.setStyle(matches[1], matches[2]); 1.202 + } 1.203 + }else if (typeof styles == "object"){ 1.204 + for (var style in styles){ 1.205 + el.setStyle(style, styles[style]); 1.206 + } 1.207 + }else if (typeof styles == "function"){ 1.208 + Ext.DomHelper.applyStyles(el, styles.call()); 1.209 + } 1.210 + } 1.211 + }, 1.212 + 1.213 + 1.214 + insertHtml : function(where, el, html){ 1.215 + where = where.toLowerCase(); 1.216 + if(el.insertAdjacentHTML){ 1.217 + if(tableRe.test(el.tagName)){ 1.218 + var rs; 1.219 + if(rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html)){ 1.220 + return rs; 1.221 + } 1.222 + } 1.223 + switch(where){ 1.224 + case "beforebegin": 1.225 + el.insertAdjacentHTML('BeforeBegin', html); 1.226 + return el.previousSibling; 1.227 + case "afterbegin": 1.228 + el.insertAdjacentHTML('AfterBegin', html); 1.229 + return el.firstChild; 1.230 + case "beforeend": 1.231 + el.insertAdjacentHTML('BeforeEnd', html); 1.232 + return el.lastChild; 1.233 + case "afterend": 1.234 + el.insertAdjacentHTML('AfterEnd', html); 1.235 + return el.nextSibling; 1.236 + } 1.237 + throw 'Illegal insertion point -> "' + where + '"'; 1.238 + } 1.239 + var range = el.ownerDocument.createRange(); 1.240 + var frag; 1.241 + switch(where){ 1.242 + case "beforebegin": 1.243 + range.setStartBefore(el); 1.244 + frag = range.createContextualFragment(html); 1.245 + el.parentNode.insertBefore(frag, el); 1.246 + return el.previousSibling; 1.247 + case "afterbegin": 1.248 + if(el.firstChild){ 1.249 + range.setStartBefore(el.firstChild); 1.250 + frag = range.createContextualFragment(html); 1.251 + el.insertBefore(frag, el.firstChild); 1.252 + return el.firstChild; 1.253 + }else{ 1.254 + el.innerHTML = html; 1.255 + return el.firstChild; 1.256 + } 1.257 + case "beforeend": 1.258 + if(el.lastChild){ 1.259 + range.setStartAfter(el.lastChild); 1.260 + frag = range.createContextualFragment(html); 1.261 + el.appendChild(frag); 1.262 + return el.lastChild; 1.263 + }else{ 1.264 + el.innerHTML = html; 1.265 + return el.lastChild; 1.266 + } 1.267 + case "afterend": 1.268 + range.setStartAfter(el); 1.269 + frag = range.createContextualFragment(html); 1.270 + el.parentNode.insertBefore(frag, el.nextSibling); 1.271 + return el.nextSibling; 1.272 + } 1.273 + throw 'Illegal insertion point -> "' + where + '"'; 1.274 + }, 1.275 + 1.276 + 1.277 + insertBefore : function(el, o, returnElement){ 1.278 + return this.doInsert(el, o, returnElement, "beforeBegin"); 1.279 + }, 1.280 + 1.281 + 1.282 + insertAfter : function(el, o, returnElement){ 1.283 + return this.doInsert(el, o, returnElement, "afterEnd", "nextSibling"); 1.284 + }, 1.285 + 1.286 + 1.287 + insertFirst : function(el, o, returnElement){ 1.288 + return this.doInsert(el, o, returnElement, "afterBegin", "firstChild"); 1.289 + }, 1.290 + 1.291 + doInsert : function(el, o, returnElement, pos, sibling){ 1.292 + el = Ext.getDom(el); 1.293 + var newNode; 1.294 + if(this.useDom){ 1.295 + newNode = createDom(o, null); 1.296 + (sibling === "firstChild" ? el : el.parentNode).insertBefore(newNode, sibling ? el[sibling] : el); 1.297 + }else{ 1.298 + var html = createHtml(o); 1.299 + newNode = this.insertHtml(pos, el, html); 1.300 + } 1.301 + return returnElement ? Ext.get(newNode, true) : newNode; 1.302 + }, 1.303 + 1.304 + 1.305 + append : function(el, o, returnElement){ 1.306 + el = Ext.getDom(el); 1.307 + var newNode; 1.308 + if(this.useDom){ 1.309 + newNode = createDom(o, null); 1.310 + el.appendChild(newNode); 1.311 + }else{ 1.312 + var html = createHtml(o); 1.313 + newNode = this.insertHtml("beforeEnd", el, html); 1.314 + } 1.315 + return returnElement ? Ext.get(newNode, true) : newNode; 1.316 + }, 1.317 + 1.318 + 1.319 + overwrite : function(el, o, returnElement){ 1.320 + el = Ext.getDom(el); 1.321 + el.innerHTML = createHtml(o); 1.322 + return returnElement ? Ext.get(el.firstChild, true) : el.firstChild; 1.323 + }, 1.324 + 1.325 + 1.326 + createTemplate : function(o){ 1.327 + var html = createHtml(o); 1.328 + return new Ext.Template(html); 1.329 + } 1.330 + }; 1.331 +}(); 1.332 + 1.333 + 1.334 +Ext.Template = function(html){ 1.335 + var a = arguments; 1.336 + if(Ext.isArray(html)){ 1.337 + html = html.join(""); 1.338 + }else if(a.length > 1){ 1.339 + var buf = []; 1.340 + for(var i = 0, len = a.length; i < len; i++){ 1.341 + if(typeof a[i] == 'object'){ 1.342 + Ext.apply(this, a[i]); 1.343 + }else{ 1.344 + buf[buf.length] = a[i]; 1.345 + } 1.346 + } 1.347 + html = buf.join(''); 1.348 + } 1.349 + 1.350 + this.html = html; 1.351 + if(this.compiled){ 1.352 + this.compile(); 1.353 + } 1.354 +}; 1.355 +Ext.Template.prototype = { 1.356 + 1.357 + applyTemplate : function(values){ 1.358 + if(this.compiled){ 1.359 + return this.compiled(values); 1.360 + } 1.361 + var useF = this.disableFormats !== true; 1.362 + var fm = Ext.util.Format, tpl = this; 1.363 + var fn = function(m, name, format, args){ 1.364 + if(format && useF){ 1.365 + if(format.substr(0, 5) == "this."){ 1.366 + return tpl.call(format.substr(5), values[name], values); 1.367 + }else{ 1.368 + if(args){ 1.369 + var re = /^\s*['"](.*)["']\s*$/; 1.370 + args = args.split(','); 1.371 + for(var i = 0, len = args.length; i < len; i++){ 1.372 + args[i] = args[i].replace(re, "$1"); 1.373 + } 1.374 + args = [values[name]].concat(args); 1.375 + }else{ 1.376 + args = [values[name]]; 1.377 + } 1.378 + return fm[format].apply(fm, args); 1.379 + } 1.380 + }else{ 1.381 + return values[name] !== undefined ? values[name] : ""; 1.382 + } 1.383 + }; 1.384 + return this.html.replace(this.re, fn); 1.385 + }, 1.386 + 1.387 + 1.388 + set : function(html, compile){ 1.389 + this.html = html; 1.390 + this.compiled = null; 1.391 + if(compile){ 1.392 + this.compile(); 1.393 + } 1.394 + return this; 1.395 + }, 1.396 + 1.397 + 1.398 + disableFormats : false, 1.399 + 1.400 + 1.401 + re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, 1.402 + 1.403 + 1.404 + compile : function(){ 1.405 + var fm = Ext.util.Format; 1.406 + var useF = this.disableFormats !== true; 1.407 + var sep = Ext.isGecko ? "+" : ","; 1.408 + var fn = function(m, name, format, args){ 1.409 + if(format && useF){ 1.410 + args = args ? ',' + args : ""; 1.411 + if(format.substr(0, 5) != "this."){ 1.412 + format = "fm." + format + '('; 1.413 + }else{ 1.414 + format = 'this.call("'+ format.substr(5) + '", '; 1.415 + args = ", values"; 1.416 + } 1.417 + }else{ 1.418 + args= ''; format = "(values['" + name + "'] == undefined ? '' : "; 1.419 + } 1.420 + return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'"; 1.421 + }; 1.422 + var body; 1.423 + if(Ext.isGecko){ 1.424 + body = "this.compiled = function(values){ return '" + 1.425 + this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + 1.426 + "';};"; 1.427 + }else{ 1.428 + body = ["this.compiled = function(values){ return ['"]; 1.429 + body.push(this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn)); 1.430 + body.push("'].join('');};"); 1.431 + body = body.join(''); 1.432 + } 1.433 + eval(body); 1.434 + return this; 1.435 + }, 1.436 + 1.437 + call : function(fnName, value, allValues){ 1.438 + return this[fnName](value, allValues); 1.439 + }, 1.440 + 1.441 + 1.442 + insertFirst: function(el, values, returnElement){ 1.443 + return this.doInsert('afterBegin', el, values, returnElement); 1.444 + }, 1.445 + 1.446 + 1.447 + insertBefore: function(el, values, returnElement){ 1.448 + return this.doInsert('beforeBegin', el, values, returnElement); 1.449 + }, 1.450 + 1.451 + 1.452 + insertAfter : function(el, values, returnElement){ 1.453 + return this.doInsert('afterEnd', el, values, returnElement); 1.454 + }, 1.455 + 1.456 + 1.457 + append : function(el, values, returnElement){ 1.458 + return this.doInsert('beforeEnd', el, values, returnElement); 1.459 + }, 1.460 + 1.461 + doInsert : function(where, el, values, returnEl){ 1.462 + el = Ext.getDom(el); 1.463 + var newNode = Ext.DomHelper.insertHtml(where, el, this.applyTemplate(values)); 1.464 + return returnEl ? Ext.get(newNode, true) : newNode; 1.465 + }, 1.466 + 1.467 + 1.468 + overwrite : function(el, values, returnElement){ 1.469 + el = Ext.getDom(el); 1.470 + el.innerHTML = this.applyTemplate(values); 1.471 + return returnElement ? Ext.get(el.firstChild, true) : el.firstChild; 1.472 + } 1.473 +}; 1.474 + 1.475 +Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; 1.476 + 1.477 +Ext.DomHelper.Template = Ext.Template; 1.478 + 1.479 + 1.480 +Ext.Template.from = function(el, config){ 1.481 + el = Ext.getDom(el); 1.482 + return new Ext.Template(el.value || el.innerHTML, config || ''); 1.483 +}; 1.484 + 1.485 + 1.486 +Ext.DomQuery = function(){ 1.487 + var cache = {}, simpleCache = {}, valueCache = {}; 1.488 + var nonSpace = /\S/; 1.489 + var trimRe = /^\s+|\s+$/g; 1.490 + var tplRe = /\{(\d+)\}/g; 1.491 + var modeRe = /^(\s?[\/>+~]\s?|\s|$)/; 1.492 + var tagTokenRe = /^(#)?([\w-\*]+)/; 1.493 + var nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/; 1.494 + 1.495 + function child(p, index){ 1.496 + var i = 0; 1.497 + var n = p.firstChild; 1.498 + while(n){ 1.499 + if(n.nodeType == 1){ 1.500 + if(++i == index){ 1.501 + return n; 1.502 + } 1.503 + } 1.504 + n = n.nextSibling; 1.505 + } 1.506 + return null; 1.507 + }; 1.508 + 1.509 + function next(n){ 1.510 + while((n = n.nextSibling) && n.nodeType != 1); 1.511 + return n; 1.512 + }; 1.513 + 1.514 + function prev(n){ 1.515 + while((n = n.previousSibling) && n.nodeType != 1); 1.516 + return n; 1.517 + }; 1.518 + 1.519 + function children(d){ 1.520 + var n = d.firstChild, ni = -1; 1.521 + while(n){ 1.522 + var nx = n.nextSibling; 1.523 + if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ 1.524 + d.removeChild(n); 1.525 + }else{ 1.526 + n.nodeIndex = ++ni; 1.527 + } 1.528 + n = nx; 1.529 + } 1.530 + return this; 1.531 + }; 1.532 + 1.533 + function byClassName(c, a, v){ 1.534 + if(!v){ 1.535 + return c; 1.536 + } 1.537 + var r = [], ri = -1, cn; 1.538 + for(var i = 0, ci; ci = c[i]; i++){ 1.539 + if((' '+ci.className+' ').indexOf(v) != -1){ 1.540 + r[++ri] = ci; 1.541 + } 1.542 + } 1.543 + return r; 1.544 + }; 1.545 + 1.546 + function attrValue(n, attr){ 1.547 + if(!n.tagName && typeof n.length != "undefined"){ 1.548 + n = n[0]; 1.549 + } 1.550 + if(!n){ 1.551 + return null; 1.552 + } 1.553 + if(attr == "for"){ 1.554 + return n.htmlFor; 1.555 + } 1.556 + if(attr == "class" || attr == "className"){ 1.557 + return n.className; 1.558 + } 1.559 + return n.getAttribute(attr) || n[attr]; 1.560 + 1.561 + }; 1.562 + 1.563 + function getNodes(ns, mode, tagName){ 1.564 + var result = [], ri = -1, cs; 1.565 + if(!ns){ 1.566 + return result; 1.567 + } 1.568 + tagName = tagName || "*"; 1.569 + if(typeof ns.getElementsByTagName != "undefined"){ 1.570 + ns = [ns]; 1.571 + } 1.572 + if(!mode){ 1.573 + for(var i = 0, ni; ni = ns[i]; i++){ 1.574 + cs = ni.getElementsByTagName(tagName); 1.575 + for(var j = 0, ci; ci = cs[j]; j++){ 1.576 + result[++ri] = ci; 1.577 + } 1.578 + } 1.579 + }else if(mode == "/" || mode == ">"){ 1.580 + var utag = tagName.toUpperCase(); 1.581 + for(var i = 0, ni, cn; ni = ns[i]; i++){ 1.582 + cn = ni.children || ni.childNodes; 1.583 + for(var j = 0, cj; cj = cn[j]; j++){ 1.584 + if(cj.nodeName == utag || cj.nodeName == tagName || tagName == '*'){ 1.585 + result[++ri] = cj; 1.586 + } 1.587 + } 1.588 + } 1.589 + }else if(mode == "+"){ 1.590 + var utag = tagName.toUpperCase(); 1.591 + for(var i = 0, n; n = ns[i]; i++){ 1.592 + while((n = n.nextSibling) && n.nodeType != 1); 1.593 + if(n && (n.nodeName == utag || n.nodeName == tagName || tagName == '*')){ 1.594 + result[++ri] = n; 1.595 + } 1.596 + } 1.597 + }else if(mode == "~"){ 1.598 + for(var i = 0, n; n = ns[i]; i++){ 1.599 + while((n = n.nextSibling) && (n.nodeType != 1 || (tagName == '*' || n.tagName.toLowerCase()!=tagName))); 1.600 + if(n){ 1.601 + result[++ri] = n; 1.602 + } 1.603 + } 1.604 + } 1.605 + return result; 1.606 + }; 1.607 + 1.608 + function concat(a, b){ 1.609 + if(b.slice){ 1.610 + return a.concat(b); 1.611 + } 1.612 + for(var i = 0, l = b.length; i < l; i++){ 1.613 + a[a.length] = b[i]; 1.614 + } 1.615 + return a; 1.616 + } 1.617 + 1.618 + function byTag(cs, tagName){ 1.619 + if(cs.tagName || cs == document){ 1.620 + cs = [cs]; 1.621 + } 1.622 + if(!tagName){ 1.623 + return cs; 1.624 + } 1.625 + var r = [], ri = -1; 1.626 + tagName = tagName.toLowerCase(); 1.627 + for(var i = 0, ci; ci = cs[i]; i++){ 1.628 + if(ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName){ 1.629 + r[++ri] = ci; 1.630 + } 1.631 + } 1.632 + return r; 1.633 + }; 1.634 + 1.635 + function byId(cs, attr, id){ 1.636 + if(cs.tagName || cs == document){ 1.637 + cs = [cs]; 1.638 + } 1.639 + if(!id){ 1.640 + return cs; 1.641 + } 1.642 + var r = [], ri = -1; 1.643 + for(var i = 0,ci; ci = cs[i]; i++){ 1.644 + if(ci && ci.id == id){ 1.645 + r[++ri] = ci; 1.646 + return r; 1.647 + } 1.648 + } 1.649 + return r; 1.650 + }; 1.651 + 1.652 + function byAttribute(cs, attr, value, op, custom){ 1.653 + var r = [], ri = -1, st = custom=="{"; 1.654 + var f = Ext.DomQuery.operators[op]; 1.655 + for(var i = 0, ci; ci = cs[i]; i++){ 1.656 + var a; 1.657 + if(st){ 1.658 + a = Ext.DomQuery.getStyle(ci, attr); 1.659 + } 1.660 + else if(attr == "class" || attr == "className"){ 1.661 + a = ci.className; 1.662 + }else if(attr == "for"){ 1.663 + a = ci.htmlFor; 1.664 + }else if(attr == "href"){ 1.665 + a = ci.getAttribute("href", 2); 1.666 + }else{ 1.667 + a = ci.getAttribute(attr); 1.668 + } 1.669 + if((f && f(a, value)) || (!f && a)){ 1.670 + r[++ri] = ci; 1.671 + } 1.672 + } 1.673 + return r; 1.674 + }; 1.675 + 1.676 + function byPseudo(cs, name, value){ 1.677 + return Ext.DomQuery.pseudos[name](cs, value); 1.678 + }; 1.679 + 1.680 + 1.681 + 1.682 + 1.683 + var isIE = window.ActiveXObject ? true : false; 1.684 + 1.685 + 1.686 + 1.687 + eval("var batch = 30803;"); 1.688 + 1.689 + var key = 30803; 1.690 + 1.691 + function nodupIEXml(cs){ 1.692 + var d = ++key; 1.693 + cs[0].setAttribute("_nodup", d); 1.694 + var r = [cs[0]]; 1.695 + for(var i = 1, len = cs.length; i < len; i++){ 1.696 + var c = cs[i]; 1.697 + if(!c.getAttribute("_nodup") != d){ 1.698 + c.setAttribute("_nodup", d); 1.699 + r[r.length] = c; 1.700 + } 1.701 + } 1.702 + for(var i = 0, len = cs.length; i < len; i++){ 1.703 + cs[i].removeAttribute("_nodup"); 1.704 + } 1.705 + return r; 1.706 + } 1.707 + 1.708 + function nodup(cs){ 1.709 + if(!cs){ 1.710 + return []; 1.711 + } 1.712 + var len = cs.length, c, i, r = cs, cj, ri = -1; 1.713 + if(!len || typeof cs.nodeType != "undefined" || len == 1){ 1.714 + return cs; 1.715 + } 1.716 + if(isIE && typeof cs[0].selectSingleNode != "undefined"){ 1.717 + return nodupIEXml(cs); 1.718 + } 1.719 + var d = ++key; 1.720 + cs[0]._nodup = d; 1.721 + for(i = 1; c = cs[i]; i++){ 1.722 + if(c._nodup != d){ 1.723 + c._nodup = d; 1.724 + }else{ 1.725 + r = []; 1.726 + for(var j = 0; j < i; j++){ 1.727 + r[++ri] = cs[j]; 1.728 + } 1.729 + for(j = i+1; cj = cs[j]; j++){ 1.730 + if(cj._nodup != d){ 1.731 + cj._nodup = d; 1.732 + r[++ri] = cj; 1.733 + } 1.734 + } 1.735 + return r; 1.736 + } 1.737 + } 1.738 + return r; 1.739 + } 1.740 + 1.741 + function quickDiffIEXml(c1, c2){ 1.742 + var d = ++key; 1.743 + for(var i = 0, len = c1.length; i < len; i++){ 1.744 + c1[i].setAttribute("_qdiff", d); 1.745 + } 1.746 + var r = []; 1.747 + for(var i = 0, len = c2.length; i < len; i++){ 1.748 + if(c2[i].getAttribute("_qdiff") != d){ 1.749 + r[r.length] = c2[i]; 1.750 + } 1.751 + } 1.752 + for(var i = 0, len = c1.length; i < len; i++){ 1.753 + c1[i].removeAttribute("_qdiff"); 1.754 + } 1.755 + return r; 1.756 + } 1.757 + 1.758 + function quickDiff(c1, c2){ 1.759 + var len1 = c1.length; 1.760 + if(!len1){ 1.761 + return c2; 1.762 + } 1.763 + if(isIE && c1[0].selectSingleNode){ 1.764 + return quickDiffIEXml(c1, c2); 1.765 + } 1.766 + var d = ++key; 1.767 + for(var i = 0; i < len1; i++){ 1.768 + c1[i]._qdiff = d; 1.769 + } 1.770 + var r = []; 1.771 + for(var i = 0, len = c2.length; i < len; i++){ 1.772 + if(c2[i]._qdiff != d){ 1.773 + r[r.length] = c2[i]; 1.774 + } 1.775 + } 1.776 + return r; 1.777 + } 1.778 + 1.779 + function quickId(ns, mode, root, id){ 1.780 + if(ns == root){ 1.781 + var d = root.ownerDocument || root; 1.782 + return d.getElementById(id); 1.783 + } 1.784 + ns = getNodes(ns, mode, "*"); 1.785 + return byId(ns, null, id); 1.786 + } 1.787 + 1.788 + return { 1.789 + getStyle : function(el, name){ 1.790 + return Ext.fly(el).getStyle(name); 1.791 + }, 1.792 + 1.793 + compile : function(path, type){ 1.794 + type = type || "select"; 1.795 + 1.796 + var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"]; 1.797 + var q = path, mode, lq; 1.798 + var tk = Ext.DomQuery.matchers; 1.799 + var tklen = tk.length; 1.800 + var mm; 1.801 + 1.802 + 1.803 + var lmode = q.match(modeRe); 1.804 + if(lmode && lmode[1]){ 1.805 + fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";'; 1.806 + q = q.replace(lmode[1], ""); 1.807 + } 1.808 + 1.809 + while(path.substr(0, 1)=="/"){ 1.810 + path = path.substr(1); 1.811 + } 1.812 + 1.813 + while(q && lq != q){ 1.814 + lq = q; 1.815 + var tm = q.match(tagTokenRe); 1.816 + if(type == "select"){ 1.817 + if(tm){ 1.818 + if(tm[1] == "#"){ 1.819 + fn[fn.length] = 'n = quickId(n, mode, root, "'+tm[2]+'");'; 1.820 + }else{ 1.821 + fn[fn.length] = 'n = getNodes(n, mode, "'+tm[2]+'");'; 1.822 + } 1.823 + q = q.replace(tm[0], ""); 1.824 + }else if(q.substr(0, 1) != '@'){ 1.825 + fn[fn.length] = 'n = getNodes(n, mode, "*");'; 1.826 + } 1.827 + }else{ 1.828 + if(tm){ 1.829 + if(tm[1] == "#"){ 1.830 + fn[fn.length] = 'n = byId(n, null, "'+tm[2]+'");'; 1.831 + }else{ 1.832 + fn[fn.length] = 'n = byTag(n, "'+tm[2]+'");'; 1.833 + } 1.834 + q = q.replace(tm[0], ""); 1.835 + } 1.836 + } 1.837 + while(!(mm = q.match(modeRe))){ 1.838 + var matched = false; 1.839 + for(var j = 0; j < tklen; j++){ 1.840 + var t = tk[j]; 1.841 + var m = q.match(t.re); 1.842 + if(m){ 1.843 + fn[fn.length] = t.select.replace(tplRe, function(x, i){ 1.844 + return m[i]; 1.845 + }); 1.846 + q = q.replace(m[0], ""); 1.847 + matched = true; 1.848 + break; 1.849 + } 1.850 + } 1.851 + 1.852 + if(!matched){ 1.853 + throw 'Error parsing selector, parsing failed at "' + q + '"'; 1.854 + } 1.855 + } 1.856 + if(mm[1]){ 1.857 + fn[fn.length] = 'mode="'+mm[1].replace(trimRe, "")+'";'; 1.858 + q = q.replace(mm[1], ""); 1.859 + } 1.860 + } 1.861 + fn[fn.length] = "return nodup(n);\n}"; 1.862 + eval(fn.join("")); 1.863 + return f; 1.864 + }, 1.865 + 1.866 + 1.867 + select : function(path, root, type){ 1.868 + if(!root || root == document){ 1.869 + root = document; 1.870 + } 1.871 + if(typeof root == "string"){ 1.872 + root = document.getElementById(root); 1.873 + } 1.874 + var paths = path.split(","); 1.875 + var results = []; 1.876 + for(var i = 0, len = paths.length; i < len; i++){ 1.877 + var p = paths[i].replace(trimRe, ""); 1.878 + if(!cache[p]){ 1.879 + cache[p] = Ext.DomQuery.compile(p); 1.880 + if(!cache[p]){ 1.881 + throw p + " is not a valid selector"; 1.882 + } 1.883 + } 1.884 + var result = cache[p](root); 1.885 + if(result && result != document){ 1.886 + results = results.concat(result); 1.887 + } 1.888 + } 1.889 + if(paths.length > 1){ 1.890 + return nodup(results); 1.891 + } 1.892 + return results; 1.893 + }, 1.894 + 1.895 + 1.896 + selectNode : function(path, root){ 1.897 + return Ext.DomQuery.select(path, root)[0]; 1.898 + }, 1.899 + 1.900 + 1.901 + selectValue : function(path, root, defaultValue){ 1.902 + path = path.replace(trimRe, ""); 1.903 + if(!valueCache[path]){ 1.904 + valueCache[path] = Ext.DomQuery.compile(path, "select"); 1.905 + } 1.906 + var n = valueCache[path](root); 1.907 + n = n[0] ? n[0] : n; 1.908 + var v = (n && n.firstChild ? n.firstChild.nodeValue : null); 1.909 + return ((v === null||v === undefined||v==='') ? defaultValue : v); 1.910 + }, 1.911 + 1.912 + 1.913 + selectNumber : function(path, root, defaultValue){ 1.914 + var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0); 1.915 + return parseFloat(v); 1.916 + }, 1.917 + 1.918 + 1.919 + is : function(el, ss){ 1.920 + if(typeof el == "string"){ 1.921 + el = document.getElementById(el); 1.922 + } 1.923 + var isArray = Ext.isArray(el); 1.924 + var result = Ext.DomQuery.filter(isArray ? el : [el], ss); 1.925 + return isArray ? (result.length == el.length) : (result.length > 0); 1.926 + }, 1.927 + 1.928 + 1.929 + filter : function(els, ss, nonMatches){ 1.930 + ss = ss.replace(trimRe, ""); 1.931 + if(!simpleCache[ss]){ 1.932 + simpleCache[ss] = Ext.DomQuery.compile(ss, "simple"); 1.933 + } 1.934 + var result = simpleCache[ss](els); 1.935 + return nonMatches ? quickDiff(result, els) : result; 1.936 + }, 1.937 + 1.938 + 1.939 + matchers : [{ 1.940 + re: /^\.([\w-]+)/, 1.941 + select: 'n = byClassName(n, null, " {1} ");' 1.942 + }, { 1.943 + re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/, 1.944 + select: 'n = byPseudo(n, "{1}", "{2}");' 1.945 + },{ 1.946 + re: /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/, 1.947 + select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");' 1.948 + }, { 1.949 + re: /^#([\w-]+)/, 1.950 + select: 'n = byId(n, null, "{1}");' 1.951 + },{ 1.952 + re: /^@([\w-]+)/, 1.953 + select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};' 1.954 + } 1.955 + ], 1.956 + 1.957 + 1.958 + operators : { 1.959 + "=" : function(a, v){ 1.960 + return a == v; 1.961 + }, 1.962 + "!=" : function(a, v){ 1.963 + return a != v; 1.964 + }, 1.965 + "^=" : function(a, v){ 1.966 + return a && a.substr(0, v.length) == v; 1.967 + }, 1.968 + "$=" : function(a, v){ 1.969 + return a && a.substr(a.length-v.length) == v; 1.970 + }, 1.971 + "*=" : function(a, v){ 1.972 + return a && a.indexOf(v) !== -1; 1.973 + }, 1.974 + "%=" : function(a, v){ 1.975 + return (a % v) == 0; 1.976 + }, 1.977 + "|=" : function(a, v){ 1.978 + return a && (a == v || a.substr(0, v.length+1) == v+'-'); 1.979 + }, 1.980 + "~=" : function(a, v){ 1.981 + return a && (' '+a+' ').indexOf(' '+v+' ') != -1; 1.982 + } 1.983 + }, 1.984 + 1.985 + 1.986 + pseudos : { 1.987 + "first-child" : function(c){ 1.988 + var r = [], ri = -1, n; 1.989 + for(var i = 0, ci; ci = n = c[i]; i++){ 1.990 + while((n = n.previousSibling) && n.nodeType != 1); 1.991 + if(!n){ 1.992 + r[++ri] = ci; 1.993 + } 1.994 + } 1.995 + return r; 1.996 + }, 1.997 + 1.998 + "last-child" : function(c){ 1.999 + var r = [], ri = -1, n; 1.1000 + for(var i = 0, ci; ci = n = c[i]; i++){ 1.1001 + while((n = n.nextSibling) && n.nodeType != 1); 1.1002 + if(!n){ 1.1003 + r[++ri] = ci; 1.1004 + } 1.1005 + } 1.1006 + return r; 1.1007 + }, 1.1008 + 1.1009 + "nth-child" : function(c, a) { 1.1010 + var r = [], ri = -1; 1.1011 + var m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1" || !nthRe2.test(a) && "n+" + a || a); 1.1012 + var f = (m[1] || 1) - 0, l = m[2] - 0; 1.1013 + for(var i = 0, n; n = c[i]; i++){ 1.1014 + var pn = n.parentNode; 1.1015 + if (batch != pn._batch) { 1.1016 + var j = 0; 1.1017 + for(var cn = pn.firstChild; cn; cn = cn.nextSibling){ 1.1018 + if(cn.nodeType == 1){ 1.1019 + cn.nodeIndex = ++j; 1.1020 + } 1.1021 + } 1.1022 + pn._batch = batch; 1.1023 + } 1.1024 + if (f == 1) { 1.1025 + if (l == 0 || n.nodeIndex == l){ 1.1026 + r[++ri] = n; 1.1027 + } 1.1028 + } else if ((n.nodeIndex + l) % f == 0){ 1.1029 + r[++ri] = n; 1.1030 + } 1.1031 + } 1.1032 + 1.1033 + return r; 1.1034 + }, 1.1035 + 1.1036 + "only-child" : function(c){ 1.1037 + var r = [], ri = -1;; 1.1038 + for(var i = 0, ci; ci = c[i]; i++){ 1.1039 + if(!prev(ci) && !next(ci)){ 1.1040 + r[++ri] = ci; 1.1041 + } 1.1042 + } 1.1043 + return r; 1.1044 + }, 1.1045 + 1.1046 + "empty" : function(c){ 1.1047 + var r = [], ri = -1; 1.1048 + for(var i = 0, ci; ci = c[i]; i++){ 1.1049 + var cns = ci.childNodes, j = 0, cn, empty = true; 1.1050 + while(cn = cns[j]){ 1.1051 + ++j; 1.1052 + if(cn.nodeType == 1 || cn.nodeType == 3){ 1.1053 + empty = false; 1.1054 + break; 1.1055 + } 1.1056 + } 1.1057 + if(empty){ 1.1058 + r[++ri] = ci; 1.1059 + } 1.1060 + } 1.1061 + return r; 1.1062 + }, 1.1063 + 1.1064 + "contains" : function(c, v){ 1.1065 + var r = [], ri = -1; 1.1066 + for(var i = 0, ci; ci = c[i]; i++){ 1.1067 + if((ci.textContent||ci.innerText||'').indexOf(v) != -1){ 1.1068 + r[++ri] = ci; 1.1069 + } 1.1070 + } 1.1071 + return r; 1.1072 + }, 1.1073 + 1.1074 + "nodeValue" : function(c, v){ 1.1075 + var r = [], ri = -1; 1.1076 + for(var i = 0, ci; ci = c[i]; i++){ 1.1077 + if(ci.firstChild && ci.firstChild.nodeValue == v){ 1.1078 + r[++ri] = ci; 1.1079 + } 1.1080 + } 1.1081 + return r; 1.1082 + }, 1.1083 + 1.1084 + "checked" : function(c){ 1.1085 + var r = [], ri = -1; 1.1086 + for(var i = 0, ci; ci = c[i]; i++){ 1.1087 + if(ci.checked == true){ 1.1088 + r[++ri] = ci; 1.1089 + } 1.1090 + } 1.1091 + return r; 1.1092 + }, 1.1093 + 1.1094 + "not" : function(c, ss){ 1.1095 + return Ext.DomQuery.filter(c, ss, true); 1.1096 + }, 1.1097 + 1.1098 + "any" : function(c, selectors){ 1.1099 + var ss = selectors.split('|'); 1.1100 + var r = [], ri = -1, s; 1.1101 + for(var i = 0, ci; ci = c[i]; i++){ 1.1102 + for(var j = 0; s = ss[j]; j++){ 1.1103 + if(Ext.DomQuery.is(ci, s)){ 1.1104 + r[++ri] = ci; 1.1105 + break; 1.1106 + } 1.1107 + } 1.1108 + } 1.1109 + return r; 1.1110 + }, 1.1111 + 1.1112 + "odd" : function(c){ 1.1113 + return this["nth-child"](c, "odd"); 1.1114 + }, 1.1115 + 1.1116 + "even" : function(c){ 1.1117 + return this["nth-child"](c, "even"); 1.1118 + }, 1.1119 + 1.1120 + "nth" : function(c, a){ 1.1121 + return c[a-1] || []; 1.1122 + }, 1.1123 + 1.1124 + "first" : function(c){ 1.1125 + return c[0] || []; 1.1126 + }, 1.1127 + 1.1128 + "last" : function(c){ 1.1129 + return c[c.length-1] || []; 1.1130 + }, 1.1131 + 1.1132 + "has" : function(c, ss){ 1.1133 + var s = Ext.DomQuery.select; 1.1134 + var r = [], ri = -1; 1.1135 + for(var i = 0, ci; ci = c[i]; i++){ 1.1136 + if(s(ss, ci).length > 0){ 1.1137 + r[++ri] = ci; 1.1138 + } 1.1139 + } 1.1140 + return r; 1.1141 + }, 1.1142 + 1.1143 + "next" : function(c, ss){ 1.1144 + var is = Ext.DomQuery.is; 1.1145 + var r = [], ri = -1; 1.1146 + for(var i = 0, ci; ci = c[i]; i++){ 1.1147 + var n = next(ci); 1.1148 + if(n && is(n, ss)){ 1.1149 + r[++ri] = ci; 1.1150 + } 1.1151 + } 1.1152 + return r; 1.1153 + }, 1.1154 + 1.1155 + "prev" : function(c, ss){ 1.1156 + var is = Ext.DomQuery.is; 1.1157 + var r = [], ri = -1; 1.1158 + for(var i = 0, ci; ci = c[i]; i++){ 1.1159 + var n = prev(ci); 1.1160 + if(n && is(n, ss)){ 1.1161 + r[++ri] = ci; 1.1162 + } 1.1163 + } 1.1164 + return r; 1.1165 + } 1.1166 + } 1.1167 + }; 1.1168 +}(); 1.1169 + 1.1170 + 1.1171 +Ext.query = Ext.DomQuery.select; 1.1172 + 1.1173 + 1.1174 +Ext.util.Observable = function(){ 1.1175 + 1.1176 + if(this.listeners){ 1.1177 + this.on(this.listeners); 1.1178 + delete this.listeners; 1.1179 + } 1.1180 +}; 1.1181 +Ext.util.Observable.prototype = { 1.1182 + 1.1183 + fireEvent : function(){ 1.1184 + if(this.eventsSuspended !== true){ 1.1185 + var ce = this.events[arguments[0].toLowerCase()]; 1.1186 + if(typeof ce == "object"){ 1.1187 + return ce.fire.apply(ce, Array.prototype.slice.call(arguments, 1)); 1.1188 + } 1.1189 + } 1.1190 + return true; 1.1191 + }, 1.1192 + 1.1193 + filterOptRe : /^(?:scope|delay|buffer|single)$/, 1.1194 + 1.1195 + 1.1196 + addListener : function(eventName, fn, scope, o){ 1.1197 + if(typeof eventName == "object"){ 1.1198 + o = eventName; 1.1199 + for(var e in o){ 1.1200 + if(this.filterOptRe.test(e)){ 1.1201 + continue; 1.1202 + } 1.1203 + if(typeof o[e] == "function"){ 1.1204 + this.addListener(e, o[e], o.scope, o); 1.1205 + }else{ 1.1206 + this.addListener(e, o[e].fn, o[e].scope, o[e]); 1.1207 + } 1.1208 + } 1.1209 + return; 1.1210 + } 1.1211 + o = (!o || typeof o == "boolean") ? {} : o; 1.1212 + eventName = eventName.toLowerCase(); 1.1213 + var ce = this.events[eventName] || true; 1.1214 + if(typeof ce == "boolean"){ 1.1215 + ce = new Ext.util.Event(this, eventName); 1.1216 + this.events[eventName] = ce; 1.1217 + } 1.1218 + ce.addListener(fn, scope, o); 1.1219 + }, 1.1220 + 1.1221 + 1.1222 + removeListener : function(eventName, fn, scope){ 1.1223 + var ce = this.events[eventName.toLowerCase()]; 1.1224 + if(typeof ce == "object"){ 1.1225 + ce.removeListener(fn, scope); 1.1226 + } 1.1227 + }, 1.1228 + 1.1229 + 1.1230 + purgeListeners : function(){ 1.1231 + for(var evt in this.events){ 1.1232 + if(typeof this.events[evt] == "object"){ 1.1233 + this.events[evt].clearListeners(); 1.1234 + } 1.1235 + } 1.1236 + }, 1.1237 + 1.1238 + 1.1239 + relayEvents : function(o, events){ 1.1240 + var createHandler = function(ename){ 1.1241 + return function(){ 1.1242 + return this.fireEvent.apply(this, Ext.combine(ename, Array.prototype.slice.call(arguments, 0))); 1.1243 + }; 1.1244 + }; 1.1245 + for(var i = 0, len = events.length; i < len; i++){ 1.1246 + var ename = events[i]; 1.1247 + if(!this.events[ename]){ this.events[ename] = true; }; 1.1248 + o.on(ename, createHandler(ename), this); 1.1249 + } 1.1250 + }, 1.1251 + 1.1252 + 1.1253 + addEvents : function(o){ 1.1254 + if(!this.events){ 1.1255 + this.events = {}; 1.1256 + } 1.1257 + if(typeof o == 'string'){ 1.1258 + for(var i = 0, a = arguments, v; v = a[i]; i++){ 1.1259 + if(!this.events[a[i]]){ 1.1260 + this.events[a[i]] = true; 1.1261 + } 1.1262 + } 1.1263 + }else{ 1.1264 + Ext.applyIf(this.events, o); 1.1265 + } 1.1266 + }, 1.1267 + 1.1268 + 1.1269 + hasListener : function(eventName){ 1.1270 + var e = this.events[eventName]; 1.1271 + return typeof e == "object" && e.listeners.length > 0; 1.1272 + }, 1.1273 + 1.1274 + 1.1275 + suspendEvents : function(){ 1.1276 + this.eventsSuspended = true; 1.1277 + }, 1.1278 + 1.1279 + 1.1280 + resumeEvents : function(){ 1.1281 + this.eventsSuspended = false; 1.1282 + }, 1.1283 + 1.1284 + getMethodEvent : function(method){ 1.1285 + if(!this.methodEvents){ 1.1286 + this.methodEvents = {}; 1.1287 + } 1.1288 + var e = this.methodEvents[method]; 1.1289 + if(!e){ 1.1290 + e = {}; 1.1291 + this.methodEvents[method] = e; 1.1292 + 1.1293 + e.originalFn = this[method]; 1.1294 + e.methodName = method; 1.1295 + e.before = []; 1.1296 + e.after = []; 1.1297 + 1.1298 + 1.1299 + var returnValue, v, cancel; 1.1300 + var obj = this; 1.1301 + 1.1302 + var makeCall = function(fn, scope, args){ 1.1303 + if((v = fn.apply(scope || obj, args)) !== undefined){ 1.1304 + if(typeof v === 'object'){ 1.1305 + if(v.returnValue !== undefined){ 1.1306 + returnValue = v.returnValue; 1.1307 + }else{ 1.1308 + returnValue = v; 1.1309 + } 1.1310 + if(v.cancel === true){ 1.1311 + cancel = true; 1.1312 + } 1.1313 + }else if(v === false){ 1.1314 + cancel = true; 1.1315 + }else { 1.1316 + returnValue = v; 1.1317 + } 1.1318 + } 1.1319 + } 1.1320 + 1.1321 + this[method] = function(){ 1.1322 + returnValue = v = undefined; cancel = false; 1.1323 + var args = Array.prototype.slice.call(arguments, 0); 1.1324 + for(var i = 0, len = e.before.length; i < len; i++){ 1.1325 + makeCall(e.before[i].fn, e.before[i].scope, args); 1.1326 + if(cancel){ 1.1327 + return returnValue; 1.1328 + } 1.1329 + } 1.1330 + 1.1331 + if((v = e.originalFn.apply(obj, args)) !== undefined){ 1.1332 + returnValue = v; 1.1333 + } 1.1334 + 1.1335 + for(var i = 0, len = e.after.length; i < len; i++){ 1.1336 + makeCall(e.after[i].fn, e.after[i].scope, args); 1.1337 + if(cancel){ 1.1338 + return returnValue; 1.1339 + } 1.1340 + } 1.1341 + return returnValue; 1.1342 + }; 1.1343 + } 1.1344 + return e; 1.1345 + }, 1.1346 + 1.1347 + beforeMethod : function(method, fn, scope){ 1.1348 + var e = this.getMethodEvent(method); 1.1349 + e.before.push({fn: fn, scope: scope}); 1.1350 + }, 1.1351 + 1.1352 + afterMethod : function(method, fn, scope){ 1.1353 + var e = this.getMethodEvent(method); 1.1354 + e.after.push({fn: fn, scope: scope}); 1.1355 + }, 1.1356 + 1.1357 + removeMethodListener : function(method, fn, scope){ 1.1358 + var e = this.getMethodEvent(method); 1.1359 + for(var i = 0, len = e.before.length; i < len; i++){ 1.1360 + if(e.before[i].fn == fn && e.before[i].scope == scope){ 1.1361 + e.before.splice(i, 1); 1.1362 + return; 1.1363 + } 1.1364 + } 1.1365 + for(var i = 0, len = e.after.length; i < len; i++){ 1.1366 + if(e.after[i].fn == fn && e.after[i].scope == scope){ 1.1367 + e.after.splice(i, 1); 1.1368 + return; 1.1369 + } 1.1370 + } 1.1371 + } 1.1372 +}; 1.1373 + 1.1374 +Ext.util.Observable.prototype.on = Ext.util.Observable.prototype.addListener; 1.1375 + 1.1376 +Ext.util.Observable.prototype.un = Ext.util.Observable.prototype.removeListener; 1.1377 + 1.1378 + 1.1379 +Ext.util.Observable.capture = function(o, fn, scope){ 1.1380 + o.fireEvent = o.fireEvent.createInterceptor(fn, scope); 1.1381 +}; 1.1382 + 1.1383 + 1.1384 +Ext.util.Observable.releaseCapture = function(o){ 1.1385 + o.fireEvent = Ext.util.Observable.prototype.fireEvent; 1.1386 +}; 1.1387 + 1.1388 +(function(){ 1.1389 + 1.1390 + var createBuffered = function(h, o, scope){ 1.1391 + var task = new Ext.util.DelayedTask(); 1.1392 + return function(){ 1.1393 + task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0)); 1.1394 + }; 1.1395 + }; 1.1396 + 1.1397 + var createSingle = function(h, e, fn, scope){ 1.1398 + return function(){ 1.1399 + e.removeListener(fn, scope); 1.1400 + return h.apply(scope, arguments); 1.1401 + }; 1.1402 + }; 1.1403 + 1.1404 + var createDelayed = function(h, o, scope){ 1.1405 + return function(){ 1.1406 + var args = Array.prototype.slice.call(arguments, 0); 1.1407 + setTimeout(function(){ 1.1408 + h.apply(scope, args); 1.1409 + }, o.delay || 10); 1.1410 + }; 1.1411 + }; 1.1412 + 1.1413 + Ext.util.Event = function(obj, name){ 1.1414 + this.name = name; 1.1415 + this.obj = obj; 1.1416 + this.listeners = []; 1.1417 + }; 1.1418 + 1.1419 + Ext.util.Event.prototype = { 1.1420 + addListener : function(fn, scope, options){ 1.1421 + scope = scope || this.obj; 1.1422 + if(!this.isListening(fn, scope)){ 1.1423 + var l = this.createListener(fn, scope, options); 1.1424 + if(!this.firing){ 1.1425 + this.listeners.push(l); 1.1426 + }else{ this.listeners = this.listeners.slice(0); 1.1427 + this.listeners.push(l); 1.1428 + } 1.1429 + } 1.1430 + }, 1.1431 + 1.1432 + createListener : function(fn, scope, o){ 1.1433 + o = o || {}; 1.1434 + scope = scope || this.obj; 1.1435 + var l = {fn: fn, scope: scope, options: o}; 1.1436 + var h = fn; 1.1437 + if(o.delay){ 1.1438 + h = createDelayed(h, o, scope); 1.1439 + } 1.1440 + if(o.single){ 1.1441 + h = createSingle(h, this, fn, scope); 1.1442 + } 1.1443 + if(o.buffer){ 1.1444 + h = createBuffered(h, o, scope); 1.1445 + } 1.1446 + l.fireFn = h; 1.1447 + return l; 1.1448 + }, 1.1449 + 1.1450 + findListener : function(fn, scope){ 1.1451 + scope = scope || this.obj; 1.1452 + var ls = this.listeners; 1.1453 + for(var i = 0, len = ls.length; i < len; i++){ 1.1454 + var l = ls[i]; 1.1455 + if(l.fn == fn && l.scope == scope){ 1.1456 + return i; 1.1457 + } 1.1458 + } 1.1459 + return -1; 1.1460 + }, 1.1461 + 1.1462 + isListening : function(fn, scope){ 1.1463 + return this.findListener(fn, scope) != -1; 1.1464 + }, 1.1465 + 1.1466 + removeListener : function(fn, scope){ 1.1467 + var index; 1.1468 + if((index = this.findListener(fn, scope)) != -1){ 1.1469 + if(!this.firing){ 1.1470 + this.listeners.splice(index, 1); 1.1471 + }else{ 1.1472 + this.listeners = this.listeners.slice(0); 1.1473 + this.listeners.splice(index, 1); 1.1474 + } 1.1475 + return true; 1.1476 + } 1.1477 + return false; 1.1478 + }, 1.1479 + 1.1480 + clearListeners : function(){ 1.1481 + this.listeners = []; 1.1482 + }, 1.1483 + 1.1484 + fire : function(){ 1.1485 + var ls = this.listeners, scope, len = ls.length; 1.1486 + if(len > 0){ 1.1487 + this.firing = true; 1.1488 + var args = Array.prototype.slice.call(arguments, 0); 1.1489 + for(var i = 0; i < len; i++){ 1.1490 + var l = ls[i]; 1.1491 + if(l.fireFn.apply(l.scope||this.obj||window, arguments) === false){ 1.1492 + this.firing = false; 1.1493 + return false; 1.1494 + } 1.1495 + } 1.1496 + this.firing = false; 1.1497 + } 1.1498 + return true; 1.1499 + } 1.1500 + }; 1.1501 +})(); 1.1502 + 1.1503 +Ext.EventManager = function(){ 1.1504 + var docReadyEvent, docReadyProcId, docReadyState = false; 1.1505 + var resizeEvent, resizeTask, textEvent, textSize; 1.1506 + var E = Ext.lib.Event; 1.1507 + var D = Ext.lib.Dom; 1.1508 + 1.1509 + 1.1510 + var fireDocReady = function(){ 1.1511 + if(!docReadyState){ 1.1512 + docReadyState = true; 1.1513 + Ext.isReady = true; 1.1514 + if(docReadyProcId){ 1.1515 + clearInterval(docReadyProcId); 1.1516 + } 1.1517 + if(Ext.isGecko || Ext.isOpera) { 1.1518 + document.removeEventListener("DOMContentLoaded", fireDocReady, false); 1.1519 + } 1.1520 + if(Ext.isIE){ 1.1521 + var defer = document.getElementById("ie-deferred-loader"); 1.1522 + if(defer){ 1.1523 + defer.onreadystatechange = null; 1.1524 + defer.parentNode.removeChild(defer); 1.1525 + } 1.1526 + } 1.1527 + if(docReadyEvent){ 1.1528 + docReadyEvent.fire(); 1.1529 + docReadyEvent.clearListeners(); 1.1530 + } 1.1531 + } 1.1532 + }; 1.1533 + 1.1534 + var initDocReady = function(){ 1.1535 + docReadyEvent = new Ext.util.Event(); 1.1536 + if(Ext.isGecko || Ext.isOpera) { 1.1537 + document.addEventListener("DOMContentLoaded", fireDocReady, false); 1.1538 + }else if(Ext.isIE){ 1.1539 + document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>"); 1.1540 + var defer = document.getElementById("ie-deferred-loader"); 1.1541 + defer.onreadystatechange = function(){ 1.1542 + if(this.readyState == "complete"){ 1.1543 + fireDocReady(); 1.1544 + } 1.1545 + }; 1.1546 + }else if(Ext.isSafari){ 1.1547 + docReadyProcId = setInterval(function(){ 1.1548 + var rs = document.readyState; 1.1549 + if(rs == "complete") { 1.1550 + fireDocReady(); 1.1551 + } 1.1552 + }, 10); 1.1553 + } 1.1554 + 1.1555 + E.on(window, "load", fireDocReady); 1.1556 + }; 1.1557 + 1.1558 + var createBuffered = function(h, o){ 1.1559 + var task = new Ext.util.DelayedTask(h); 1.1560 + return function(e){ 1.1561 + 1.1562 + e = new Ext.EventObjectImpl(e); 1.1563 + task.delay(o.buffer, h, null, [e]); 1.1564 + }; 1.1565 + }; 1.1566 + 1.1567 + var createSingle = function(h, el, ename, fn){ 1.1568 + return function(e){ 1.1569 + Ext.EventManager.removeListener(el, ename, fn); 1.1570 + h(e); 1.1571 + }; 1.1572 + }; 1.1573 + 1.1574 + var createDelayed = function(h, o){ 1.1575 + return function(e){ 1.1576 + 1.1577 + e = new Ext.EventObjectImpl(e); 1.1578 + setTimeout(function(){ 1.1579 + h(e); 1.1580 + }, o.delay || 10); 1.1581 + }; 1.1582 + }; 1.1583 + 1.1584 + var listen = function(element, ename, opt, fn, scope){ 1.1585 + var o = (!opt || typeof opt == "boolean") ? {} : opt; 1.1586 + fn = fn || o.fn; scope = scope || o.scope; 1.1587 + var el = Ext.getDom(element); 1.1588 + if(!el){ 1.1589 + throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.'; 1.1590 + } 1.1591 + var h = function(e){ 1.1592 + e = Ext.EventObject.setEvent(e); 1.1593 + var t; 1.1594 + if(o.delegate){ 1.1595 + t = e.getTarget(o.delegate, el); 1.1596 + if(!t){ 1.1597 + return; 1.1598 + } 1.1599 + }else{ 1.1600 + t = e.target; 1.1601 + } 1.1602 + if(o.stopEvent === true){ 1.1603 + e.stopEvent(); 1.1604 + } 1.1605 + if(o.preventDefault === true){ 1.1606 + e.preventDefault(); 1.1607 + } 1.1608 + if(o.stopPropagation === true){ 1.1609 + e.stopPropagation(); 1.1610 + } 1.1611 + 1.1612 + if(o.normalized === false){ 1.1613 + e = e.browserEvent; 1.1614 + } 1.1615 + 1.1616 + fn.call(scope || el, e, t, o); 1.1617 + }; 1.1618 + if(o.delay){ 1.1619 + h = createDelayed(h, o); 1.1620 + } 1.1621 + if(o.single){ 1.1622 + h = createSingle(h, el, ename, fn); 1.1623 + } 1.1624 + if(o.buffer){ 1.1625 + h = createBuffered(h, o); 1.1626 + } 1.1627 + fn._handlers = fn._handlers || []; 1.1628 + fn._handlers.push([Ext.id(el), ename, h]); 1.1629 + 1.1630 + E.on(el, ename, h); 1.1631 + if(ename == "mousewheel" && el.addEventListener){ 1.1632 + el.addEventListener("DOMMouseScroll", h, false); 1.1633 + E.on(window, 'unload', function(){ 1.1634 + el.removeEventListener("DOMMouseScroll", h, false); 1.1635 + }); 1.1636 + } 1.1637 + if(ename == "mousedown" && el == document){ 1.1638 + Ext.EventManager.stoppedMouseDownEvent.addListener(h); 1.1639 + } 1.1640 + return h; 1.1641 + }; 1.1642 + 1.1643 + var stopListening = function(el, ename, fn){ 1.1644 + var id = Ext.id(el), hds = fn._handlers, hd = fn; 1.1645 + if(hds){ 1.1646 + for(var i = 0, len = hds.length; i < len; i++){ 1.1647 + var h = hds[i]; 1.1648 + if(h[0] == id && h[1] == ename){ 1.1649 + hd = h[2]; 1.1650 + hds.splice(i, 1); 1.1651 + break; 1.1652 + } 1.1653 + } 1.1654 + } 1.1655 + E.un(el, ename, hd); 1.1656 + el = Ext.getDom(el); 1.1657 + if(ename == "mousewheel" && el.addEventListener){ 1.1658 + el.removeEventListener("DOMMouseScroll", hd, false); 1.1659 + } 1.1660 + if(ename == "mousedown" && el == document){ 1.1661 + Ext.EventManager.stoppedMouseDownEvent.removeListener(hd); 1.1662 + } 1.1663 + }; 1.1664 + 1.1665 + var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/; 1.1666 + var pub = { 1.1667 + 1.1668 + 1.1669 + addListener : function(element, eventName, fn, scope, options){ 1.1670 + if(typeof eventName == "object"){ 1.1671 + var o = eventName; 1.1672 + for(var e in o){ 1.1673 + if(propRe.test(e)){ 1.1674 + continue; 1.1675 + } 1.1676 + if(typeof o[e] == "function"){ 1.1677 + 1.1678 + listen(element, e, o, o[e], o.scope); 1.1679 + }else{ 1.1680 + 1.1681 + listen(element, e, o[e]); 1.1682 + } 1.1683 + } 1.1684 + return; 1.1685 + } 1.1686 + return listen(element, eventName, options, fn, scope); 1.1687 + }, 1.1688 + 1.1689 + 1.1690 + removeListener : function(element, eventName, fn){ 1.1691 + return stopListening(element, eventName, fn); 1.1692 + }, 1.1693 + 1.1694 + 1.1695 + onDocumentReady : function(fn, scope, options){ 1.1696 + if(docReadyState){ 1.1697 + docReadyEvent.addListener(fn, scope, options); 1.1698 + docReadyEvent.fire(); 1.1699 + docReadyEvent.clearListeners(); 1.1700 + return; 1.1701 + } 1.1702 + if(!docReadyEvent){ 1.1703 + initDocReady(); 1.1704 + } 1.1705 + docReadyEvent.addListener(fn, scope, options); 1.1706 + }, 1.1707 + 1.1708 + 1.1709 + onWindowResize : function(fn, scope, options){ 1.1710 + if(!resizeEvent){ 1.1711 + resizeEvent = new Ext.util.Event(); 1.1712 + resizeTask = new Ext.util.DelayedTask(function(){ 1.1713 + resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); 1.1714 + }); 1.1715 + E.on(window, "resize", this.fireWindowResize, this); 1.1716 + } 1.1717 + resizeEvent.addListener(fn, scope, options); 1.1718 + }, 1.1719 + 1.1720 + 1.1721 + fireWindowResize : function(){ 1.1722 + if(resizeEvent){ 1.1723 + if((Ext.isIE||Ext.isAir) && resizeTask){ 1.1724 + resizeTask.delay(50); 1.1725 + }else{ 1.1726 + resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); 1.1727 + } 1.1728 + } 1.1729 + }, 1.1730 + 1.1731 + 1.1732 + onTextResize : function(fn, scope, options){ 1.1733 + if(!textEvent){ 1.1734 + textEvent = new Ext.util.Event(); 1.1735 + var textEl = new Ext.Element(document.createElement('div')); 1.1736 + textEl.dom.className = 'x-text-resize'; 1.1737 + textEl.dom.innerHTML = 'X'; 1.1738 + textEl.appendTo(document.body); 1.1739 + textSize = textEl.dom.offsetHeight; 1.1740 + setInterval(function(){ 1.1741 + if(textEl.dom.offsetHeight != textSize){ 1.1742 + textEvent.fire(textSize, textSize = textEl.dom.offsetHeight); 1.1743 + } 1.1744 + }, this.textResizeInterval); 1.1745 + } 1.1746 + textEvent.addListener(fn, scope, options); 1.1747 + }, 1.1748 + 1.1749 + 1.1750 + removeResizeListener : function(fn, scope){ 1.1751 + if(resizeEvent){ 1.1752 + resizeEvent.removeListener(fn, scope); 1.1753 + } 1.1754 + }, 1.1755 + 1.1756 + 1.1757 + fireResize : function(){ 1.1758 + if(resizeEvent){ 1.1759 + resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); 1.1760 + } 1.1761 + }, 1.1762 + 1.1763 + ieDeferSrc : false, 1.1764 + 1.1765 + textResizeInterval : 50 1.1766 + }; 1.1767 + 1.1768 + pub.on = pub.addListener; 1.1769 + 1.1770 + pub.un = pub.removeListener; 1.1771 + 1.1772 + pub.stoppedMouseDownEvent = new Ext.util.Event(); 1.1773 + return pub; 1.1774 +}(); 1.1775 + 1.1776 +Ext.onReady = Ext.EventManager.onDocumentReady; 1.1777 + 1.1778 +Ext.onReady(function(){ 1.1779 + var bd = Ext.getBody(); 1.1780 + if(!bd){ return; } 1.1781 + 1.1782 + var cls = [ 1.1783 + Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : 'ext-ie7') 1.1784 + : Ext.isGecko ? "ext-gecko" 1.1785 + : Ext.isOpera ? "ext-opera" 1.1786 + : Ext.isSafari ? "ext-safari" : ""]; 1.1787 + 1.1788 + if(Ext.isMac){ 1.1789 + cls.push("ext-mac"); 1.1790 + } 1.1791 + if(Ext.isLinux){ 1.1792 + cls.push("ext-linux"); 1.1793 + } 1.1794 + if(Ext.isBorderBox){ 1.1795 + cls.push('ext-border-box'); 1.1796 + } 1.1797 + if(Ext.isStrict){ 1.1798 + var p = bd.dom.parentNode; 1.1799 + if(p){ 1.1800 + p.className += ' ext-strict'; 1.1801 + } 1.1802 + } 1.1803 + bd.addClass(cls.join(' ')); 1.1804 +}); 1.1805 + 1.1806 + 1.1807 +Ext.EventObject = function(){ 1.1808 + 1.1809 + var E = Ext.lib.Event; 1.1810 + 1.1811 + 1.1812 + var safariKeys = { 1.1813 + 63234 : 37, 1.1814 + 63235 : 39, 1.1815 + 63232 : 38, 1.1816 + 63233 : 40, 1.1817 + 63276 : 33, 1.1818 + 63277 : 34, 1.1819 + 63272 : 46, 1.1820 + 63273 : 36, 1.1821 + 63275 : 35 1.1822 + }; 1.1823 + 1.1824 + 1.1825 + var btnMap = Ext.isIE ? {1:0,4:1,2:2} : 1.1826 + (Ext.isSafari ? {1:0,2:1,3:2} : {0:0,1:1,2:2}); 1.1827 + 1.1828 + Ext.EventObjectImpl = function(e){ 1.1829 + if(e){ 1.1830 + this.setEvent(e.browserEvent || e); 1.1831 + } 1.1832 + }; 1.1833 + Ext.EventObjectImpl.prototype = { 1.1834 + 1.1835 + browserEvent : null, 1.1836 + 1.1837 + button : -1, 1.1838 + 1.1839 + shiftKey : false, 1.1840 + 1.1841 + ctrlKey : false, 1.1842 + 1.1843 + altKey : false, 1.1844 + 1.1845 + 1.1846 + BACKSPACE : 8, 1.1847 + 1.1848 + TAB : 9, 1.1849 + 1.1850 + RETURN : 13, 1.1851 + 1.1852 + ENTER : 13, 1.1853 + 1.1854 + SHIFT : 16, 1.1855 + 1.1856 + CONTROL : 17, 1.1857 + 1.1858 + ESC : 27, 1.1859 + 1.1860 + SPACE : 32, 1.1861 + 1.1862 + PAGEUP : 33, 1.1863 + 1.1864 + PAGEDOWN : 34, 1.1865 + 1.1866 + END : 35, 1.1867 + 1.1868 + HOME : 36, 1.1869 + 1.1870 + LEFT : 37, 1.1871 + 1.1872 + UP : 38, 1.1873 + 1.1874 + RIGHT : 39, 1.1875 + 1.1876 + DOWN : 40, 1.1877 + 1.1878 + DELETE : 46, 1.1879 + 1.1880 + F5 : 116, 1.1881 + 1.1882 + 1.1883 + setEvent : function(e){ 1.1884 + if(e == this || (e && e.browserEvent)){ 1.1885 + return e; 1.1886 + } 1.1887 + this.browserEvent = e; 1.1888 + if(e){ 1.1889 + 1.1890 + this.button = e.button ? btnMap[e.button] : (e.which ? e.which-1 : -1); 1.1891 + if(e.type == 'click' && this.button == -1){ 1.1892 + this.button = 0; 1.1893 + } 1.1894 + this.type = e.type; 1.1895 + this.shiftKey = e.shiftKey; 1.1896 + 1.1897 + this.ctrlKey = e.ctrlKey || e.metaKey; 1.1898 + this.altKey = e.altKey; 1.1899 + 1.1900 + this.keyCode = e.keyCode; 1.1901 + this.charCode = e.charCode; 1.1902 + 1.1903 + this.target = E.getTarget(e); 1.1904 + 1.1905 + this.xy = E.getXY(e); 1.1906 + }else{ 1.1907 + this.button = -1; 1.1908 + this.shiftKey = false; 1.1909 + this.ctrlKey = false; 1.1910 + this.altKey = false; 1.1911 + this.keyCode = 0; 1.1912 + this.charCode =0; 1.1913 + this.target = null; 1.1914 + this.xy = [0, 0]; 1.1915 + } 1.1916 + return this; 1.1917 + }, 1.1918 + 1.1919 + 1.1920 + stopEvent : function(){ 1.1921 + if(this.browserEvent){ 1.1922 + if(this.browserEvent.type == 'mousedown'){ 1.1923 + Ext.EventManager.stoppedMouseDownEvent.fire(this); 1.1924 + } 1.1925 + E.stopEvent(this.browserEvent); 1.1926 + } 1.1927 + }, 1.1928 + 1.1929 + 1.1930 + preventDefault : function(){ 1.1931 + if(this.browserEvent){ 1.1932 + E.preventDefault(this.browserEvent); 1.1933 + } 1.1934 + }, 1.1935 + 1.1936 + 1.1937 + isNavKeyPress : function(){ 1.1938 + var k = this.keyCode; 1.1939 + k = Ext.isSafari ? (safariKeys[k] || k) : k; 1.1940 + return (k >= 33 && k <= 40) || k == this.RETURN || k == this.TAB || k == this.ESC; 1.1941 + }, 1.1942 + 1.1943 + isSpecialKey : function(){ 1.1944 + var k = this.keyCode; 1.1945 + return (this.type == 'keypress' && this.ctrlKey) || k == 9 || k == 13 || k == 40 || k == 27 || 1.1946 + (k == 16) || (k == 17) || 1.1947 + (k >= 18 && k <= 20) || 1.1948 + (k >= 33 && k <= 35) || 1.1949 + (k >= 36 && k <= 39) || 1.1950 + (k >= 44 && k <= 45); 1.1951 + }, 1.1952 + 1.1953 + stopPropagation : function(){ 1.1954 + if(this.browserEvent){ 1.1955 + if(this.browserEvent.type == 'mousedown'){ 1.1956 + Ext.EventManager.stoppedMouseDownEvent.fire(this); 1.1957 + } 1.1958 + E.stopPropagation(this.browserEvent); 1.1959 + } 1.1960 + }, 1.1961 + 1.1962 + 1.1963 + getCharCode : function(){ 1.1964 + return this.charCode || this.keyCode; 1.1965 + }, 1.1966 + 1.1967 + 1.1968 + getKey : function(){ 1.1969 + var k = this.keyCode || this.charCode; 1.1970 + return Ext.isSafari ? (safariKeys[k] || k) : k; 1.1971 + }, 1.1972 + 1.1973 + 1.1974 + getPageX : function(){ 1.1975 + return this.xy[0]; 1.1976 + }, 1.1977 + 1.1978 + 1.1979 + getPageY : function(){ 1.1980 + return this.xy[1]; 1.1981 + }, 1.1982 + 1.1983 + 1.1984 + getTime : function(){ 1.1985 + if(this.browserEvent){ 1.1986 + return E.getTime(this.browserEvent); 1.1987 + } 1.1988 + return null; 1.1989 + }, 1.1990 + 1.1991 + 1.1992 + getXY : function(){ 1.1993 + return this.xy; 1.1994 + }, 1.1995 + 1.1996 + 1.1997 + getTarget : function(selector, maxDepth, returnEl){ 1.1998 + return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target); 1.1999 + }, 1.2000 + 1.2001 + 1.2002 + getRelatedTarget : function(){ 1.2003 + if(this.browserEvent){ 1.2004 + return E.getRelatedTarget(this.browserEvent); 1.2005 + } 1.2006 + return null; 1.2007 + }, 1.2008 + 1.2009 + 1.2010 + getWheelDelta : function(){ 1.2011 + var e = this.browserEvent; 1.2012 + var delta = 0; 1.2013 + if(e.wheelDelta){ 1.2014 + delta = e.wheelDelta/120; 1.2015 + }else if(e.detail){ 1.2016 + delta = -e.detail/3; 1.2017 + } 1.2018 + return delta; 1.2019 + }, 1.2020 + 1.2021 + 1.2022 + hasModifier : function(){ 1.2023 + return ((this.ctrlKey || this.altKey) || this.shiftKey) ? true : false; 1.2024 + }, 1.2025 + 1.2026 + 1.2027 + within : function(el, related){ 1.2028 + var t = this[related ? "getRelatedTarget" : "getTarget"](); 1.2029 + return t && Ext.fly(el).contains(t); 1.2030 + }, 1.2031 + 1.2032 + getPoint : function(){ 1.2033 + return new Ext.lib.Point(this.xy[0], this.xy[1]); 1.2034 + } 1.2035 + }; 1.2036 + 1.2037 + return new Ext.EventObjectImpl(); 1.2038 +}(); 1.2039 + 1.2040 +(function(){ 1.2041 +var D = Ext.lib.Dom; 1.2042 +var E = Ext.lib.Event; 1.2043 +var A = Ext.lib.Anim; 1.2044 + 1.2045 +var propCache = {}; 1.2046 +var camelRe = /(-[a-z])/gi; 1.2047 +var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); }; 1.2048 +var view = document.defaultView; 1.2049 + 1.2050 +Ext.Element = function(element, forceNew){ 1.2051 + var dom = typeof element == "string" ? 1.2052 + document.getElementById(element) : element; 1.2053 + if(!dom){ return null; 1.2054 + } 1.2055 + var id = dom.id; 1.2056 + if(forceNew !== true && id && Ext.Element.cache[id]){ return Ext.Element.cache[id]; 1.2057 + } 1.2058 + 1.2059 + 1.2060 + this.dom = dom; 1.2061 + 1.2062 + 1.2063 + this.id = id || Ext.id(dom); 1.2064 +}; 1.2065 + 1.2066 +var El = Ext.Element; 1.2067 + 1.2068 +El.prototype = { 1.2069 + 1.2070 + originalDisplay : "", 1.2071 + 1.2072 + visibilityMode : 1, 1.2073 + 1.2074 + defaultUnit : "px", 1.2075 + 1.2076 + setVisibilityMode : function(visMode){ 1.2077 + this.visibilityMode = visMode; 1.2078 + return this; 1.2079 + }, 1.2080 + 1.2081 + enableDisplayMode : function(display){ 1.2082 + this.setVisibilityMode(El.DISPLAY); 1.2083 + if(typeof display != "undefined") this.originalDisplay = display; 1.2084 + return this; 1.2085 + }, 1.2086 + 1.2087 + 1.2088 + findParent : function(simpleSelector, maxDepth, returnEl){ 1.2089 + var p = this.dom, b = document.body, depth = 0, dq = Ext.DomQuery, stopEl; 1.2090 + maxDepth = maxDepth || 50; 1.2091 + if(typeof maxDepth != "number"){ 1.2092 + stopEl = Ext.getDom(maxDepth); 1.2093 + maxDepth = 10; 1.2094 + } 1.2095 + while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){ 1.2096 + if(dq.is(p, simpleSelector)){ 1.2097 + return returnEl ? Ext.get(p) : p; 1.2098 + } 1.2099 + depth++; 1.2100 + p = p.parentNode; 1.2101 + } 1.2102 + return null; 1.2103 + }, 1.2104 + 1.2105 + 1.2106 + 1.2107 + findParentNode : function(simpleSelector, maxDepth, returnEl){ 1.2108 + var p = Ext.fly(this.dom.parentNode, '_internal'); 1.2109 + return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null; 1.2110 + }, 1.2111 + 1.2112 + 1.2113 + up : function(simpleSelector, maxDepth){ 1.2114 + return this.findParentNode(simpleSelector, maxDepth, true); 1.2115 + }, 1.2116 + 1.2117 + 1.2118 + 1.2119 + 1.2120 + is : function(simpleSelector){ 1.2121 + return Ext.DomQuery.is(this.dom, simpleSelector); 1.2122 + }, 1.2123 + 1.2124 + 1.2125 + animate : function(args, duration, onComplete, easing, animType){ 1.2126 + this.anim(args, {duration: duration, callback: onComplete, easing: easing}, animType); 1.2127 + return this; 1.2128 + }, 1.2129 + 1.2130 + 1.2131 + anim : function(args, opt, animType, defaultDur, defaultEase, cb){ 1.2132 + animType = animType || 'run'; 1.2133 + opt = opt || {}; 1.2134 + var anim = Ext.lib.Anim[animType]( 1.2135 + this.dom, args, 1.2136 + (opt.duration || defaultDur) || .35, 1.2137 + (opt.easing || defaultEase) || 'easeOut', 1.2138 + function(){ 1.2139 + Ext.callback(cb, this); 1.2140 + Ext.callback(opt.callback, opt.scope || this, [this, opt]); 1.2141 + }, 1.2142 + this 1.2143 + ); 1.2144 + opt.anim = anim; 1.2145 + return anim; 1.2146 + }, 1.2147 + 1.2148 + preanim : function(a, i){ 1.2149 + return !a[i] ? false : (typeof a[i] == "object" ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]}); 1.2150 + }, 1.2151 + 1.2152 + 1.2153 + clean : function(forceReclean){ 1.2154 + if(this.isCleaned && forceReclean !== true){ 1.2155 + return this; 1.2156 + } 1.2157 + var ns = /\S/; 1.2158 + var d = this.dom, n = d.firstChild, ni = -1; 1.2159 + while(n){ 1.2160 + var nx = n.nextSibling; 1.2161 + if(n.nodeType == 3 && !ns.test(n.nodeValue)){ 1.2162 + d.removeChild(n); 1.2163 + }else{ 1.2164 + n.nodeIndex = ++ni; 1.2165 + } 1.2166 + n = nx; 1.2167 + } 1.2168 + this.isCleaned = true; 1.2169 + return this; 1.2170 + }, 1.2171 + 1.2172 + 1.2173 + scrollIntoView : function(container, hscroll){ 1.2174 + var c = Ext.getDom(container) || Ext.getBody().dom; 1.2175 + var el = this.dom; 1.2176 + 1.2177 + var o = this.getOffsetsTo(c), 1.2178 + l = o[0] + c.scrollLeft, 1.2179 + t = o[1] + c.scrollTop, 1.2180 + b = t+el.offsetHeight, 1.2181 + r = l+el.offsetWidth; 1.2182 + 1.2183 + var ch = c.clientHeight; 1.2184 + var ct = parseInt(c.scrollTop, 10); 1.2185 + var cl = parseInt(c.scrollLeft, 10); 1.2186 + var cb = ct + ch; 1.2187 + var cr = cl + c.clientWidth; 1.2188 + 1.2189 + if(el.offsetHeight > ch || t < ct){ 1.2190 + c.scrollTop = t; 1.2191 + }else if(b > cb){ 1.2192 + c.scrollTop = b-ch; 1.2193 + } 1.2194 + c.scrollTop = c.scrollTop; 1.2195 + if(hscroll !== false){ 1.2196 + if(el.offsetWidth > c.clientWidth || l < cl){ 1.2197 + c.scrollLeft = l; 1.2198 + }else if(r > cr){ 1.2199 + c.scrollLeft = r-c.clientWidth; 1.2200 + } 1.2201 + c.scrollLeft = c.scrollLeft; 1.2202 + } 1.2203 + return this; 1.2204 + }, 1.2205 + 1.2206 + scrollChildIntoView : function(child, hscroll){ 1.2207 + Ext.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll); 1.2208 + }, 1.2209 + 1.2210 + 1.2211 + autoHeight : function(animate, duration, onComplete, easing){ 1.2212 + var oldHeight = this.getHeight(); 1.2213 + this.clip(); 1.2214 + this.setHeight(1); setTimeout(function(){ 1.2215 + var height = parseInt(this.dom.scrollHeight, 10); if(!animate){ 1.2216 + this.setHeight(height); 1.2217 + this.unclip(); 1.2218 + if(typeof onComplete == "function"){ 1.2219 + onComplete(); 1.2220 + } 1.2221 + }else{ 1.2222 + this.setHeight(oldHeight); this.setHeight(height, animate, duration, function(){ 1.2223 + this.unclip(); 1.2224 + if(typeof onComplete == "function") onComplete(); 1.2225 + }.createDelegate(this), easing); 1.2226 + } 1.2227 + }.createDelegate(this), 0); 1.2228 + return this; 1.2229 + }, 1.2230 + 1.2231 + 1.2232 + contains : function(el){ 1.2233 + if(!el){return false;} 1.2234 + return D.isAncestor(this.dom, el.dom ? el.dom : el); 1.2235 + }, 1.2236 + 1.2237 + 1.2238 + isVisible : function(deep) { 1.2239 + var vis = !(this.getStyle("visibility") == "hidden" || this.getStyle("display") == "none"); 1.2240 + if(deep !== true || !vis){ 1.2241 + return vis; 1.2242 + } 1.2243 + var p = this.dom.parentNode; 1.2244 + while(p && p.tagName.toLowerCase() != "body"){ 1.2245 + if(!Ext.fly(p, '_isVisible').isVisible()){ 1.2246 + return false; 1.2247 + } 1.2248 + p = p.parentNode; 1.2249 + } 1.2250 + return true; 1.2251 + }, 1.2252 + 1.2253 + 1.2254 + select : function(selector, unique){ 1.2255 + return El.select(selector, unique, this.dom); 1.2256 + }, 1.2257 + 1.2258 + 1.2259 + query : function(selector, unique){ 1.2260 + return Ext.DomQuery.select(selector, this.dom); 1.2261 + }, 1.2262 + 1.2263 + 1.2264 + child : function(selector, returnDom){ 1.2265 + var n = Ext.DomQuery.selectNode(selector, this.dom); 1.2266 + return returnDom ? n : Ext.get(n); 1.2267 + }, 1.2268 + 1.2269 + 1.2270 + down : function(selector, returnDom){ 1.2271 + var n = Ext.DomQuery.selectNode(" > " + selector, this.dom); 1.2272 + return returnDom ? n : Ext.get(n); 1.2273 + }, 1.2274 + 1.2275 + 1.2276 + initDD : function(group, config, overrides){ 1.2277 + var dd = new Ext.dd.DD(Ext.id(this.dom), group, config); 1.2278 + return Ext.apply(dd, overrides); 1.2279 + }, 1.2280 + 1.2281 + 1.2282 + initDDProxy : function(group, config, overrides){ 1.2283 + var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config); 1.2284 + return Ext.apply(dd, overrides); 1.2285 + }, 1.2286 + 1.2287 + 1.2288 + initDDTarget : function(group, config, overrides){ 1.2289 + var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config); 1.2290 + return Ext.apply(dd, overrides); 1.2291 + }, 1.2292 + 1.2293 + 1.2294 + setVisible : function(visible, animate){ 1.2295 + if(!animate || !A){ 1.2296 + if(this.visibilityMode == El.DISPLAY){ 1.2297 + this.setDisplayed(visible); 1.2298 + }else{ 1.2299 + this.fixDisplay(); 1.2300 + this.dom.style.visibility = visible ? "visible" : "hidden"; 1.2301 + } 1.2302 + }else{ 1.2303 + var dom = this.dom; 1.2304 + var visMode = this.visibilityMode; 1.2305 + if(visible){ 1.2306 + this.setOpacity(.01); 1.2307 + this.setVisible(true); 1.2308 + } 1.2309 + this.anim({opacity: { to: (visible?1:0) }}, 1.2310 + this.preanim(arguments, 1), 1.2311 + null, .35, 'easeIn', function(){ 1.2312 + if(!visible){ 1.2313 + if(visMode == El.DISPLAY){ 1.2314 + dom.style.display = "none"; 1.2315 + }else{ 1.2316 + dom.style.visibility = "hidden"; 1.2317 + } 1.2318 + Ext.get(dom).setOpacity(1); 1.2319 + } 1.2320 + }); 1.2321 + } 1.2322 + return this; 1.2323 + }, 1.2324 + 1.2325 + 1.2326 + isDisplayed : function() { 1.2327 + return this.getStyle("display") != "none"; 1.2328 + }, 1.2329 + 1.2330 + 1.2331 + toggle : function(animate){ 1.2332 + this.setVisible(!this.isVisible(), this.preanim(arguments, 0)); 1.2333 + return this; 1.2334 + }, 1.2335 + 1.2336 + 1.2337 + setDisplayed : function(value) { 1.2338 + if(typeof value == "boolean"){ 1.2339 + value = value ? this.originalDisplay : "none"; 1.2340 + } 1.2341 + this.setStyle("display", value); 1.2342 + return this; 1.2343 + }, 1.2344 + 1.2345 + 1.2346 + focus : function() { 1.2347 + try{ 1.2348 + this.dom.focus(); 1.2349 + }catch(e){} 1.2350 + return this; 1.2351 + }, 1.2352 + 1.2353 + 1.2354 + blur : function() { 1.2355 + try{ 1.2356 + this.dom.blur(); 1.2357 + }catch(e){} 1.2358 + return this; 1.2359 + }, 1.2360 + 1.2361 + 1.2362 + addClass : function(className){ 1.2363 + if(Ext.isArray(className)){ 1.2364 + for(var i = 0, len = className.length; i < len; i++) { 1.2365 + this.addClass(className[i]); 1.2366 + } 1.2367 + }else{ 1.2368 + if(className && !this.hasClass(className)){ 1.2369 + this.dom.className = this.dom.className + " " + className; 1.2370 + } 1.2371 + } 1.2372 + return this; 1.2373 + }, 1.2374 + 1.2375 + 1.2376 + radioClass : function(className){ 1.2377 + var siblings = this.dom.parentNode.childNodes; 1.2378 + for(var i = 0; i < siblings.length; i++) { 1.2379 + var s = siblings[i]; 1.2380 + if(s.nodeType == 1){ 1.2381 + Ext.get(s).removeClass(className); 1.2382 + } 1.2383 + } 1.2384 + this.addClass(className); 1.2385 + return this; 1.2386 + }, 1.2387 + 1.2388 + 1.2389 + removeClass : function(className){ 1.2390 + if(!className || !this.dom.className){ 1.2391 + return this; 1.2392 + } 1.2393 + if(Ext.isArray(className)){ 1.2394 + for(var i = 0, len = className.length; i < len; i++) { 1.2395 + this.removeClass(className[i]); 1.2396 + } 1.2397 + }else{ 1.2398 + if(this.hasClass(className)){ 1.2399 + var re = this.classReCache[className]; 1.2400 + if (!re) { 1.2401 + re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', "g"); 1.2402 + this.classReCache[className] = re; 1.2403 + } 1.2404 + this.dom.className = 1.2405 + this.dom.className.replace(re, " "); 1.2406 + } 1.2407 + } 1.2408 + return this; 1.2409 + }, 1.2410 + 1.2411 + classReCache: {}, 1.2412 + 1.2413 + 1.2414 + toggleClass : function(className){ 1.2415 + if(this.hasClass(className)){ 1.2416 + this.removeClass(className); 1.2417 + }else{ 1.2418 + this.addClass(className); 1.2419 + } 1.2420 + return this; 1.2421 + }, 1.2422 + 1.2423 + 1.2424 + hasClass : function(className){ 1.2425 + return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1; 1.2426 + }, 1.2427 + 1.2428 + 1.2429 + replaceClass : function(oldClassName, newClassName){ 1.2430 + this.removeClass(oldClassName); 1.2431 + this.addClass(newClassName); 1.2432 + return this; 1.2433 + }, 1.2434 + 1.2435 + 1.2436 + getStyles : function(){ 1.2437 + var a = arguments, len = a.length, r = {}; 1.2438 + for(var i = 0; i < len; i++){ 1.2439 + r[a[i]] = this.getStyle(a[i]); 1.2440 + } 1.2441 + return r; 1.2442 + }, 1.2443 + 1.2444 + 1.2445 + getStyle : function(){ 1.2446 + return view && view.getComputedStyle ? 1.2447 + function(prop){ 1.2448 + var el = this.dom, v, cs, camel; 1.2449 + if(prop == 'float'){ 1.2450 + prop = "cssFloat"; 1.2451 + } 1.2452 + if(v = el.style[prop]){ 1.2453 + return v; 1.2454 + } 1.2455 + if(cs = view.getComputedStyle(el, "")){ 1.2456 + if(!(camel = propCache[prop])){ 1.2457 + camel = propCache[prop] = prop.replace(camelRe, camelFn); 1.2458 + } 1.2459 + return cs[camel]; 1.2460 + } 1.2461 + return null; 1.2462 + } : 1.2463 + function(prop){ 1.2464 + var el = this.dom, v, cs, camel; 1.2465 + if(prop == 'opacity'){ 1.2466 + if(typeof el.style.filter == 'string'){ 1.2467 + var m = el.style.filter.match(/alpha\(opacity=(.*)\)/i); 1.2468 + if(m){ 1.2469 + var fv = parseFloat(m[1]); 1.2470 + if(!isNaN(fv)){ 1.2471 + return fv ? fv / 100 : 0; 1.2472 + } 1.2473 + } 1.2474 + } 1.2475 + return 1; 1.2476 + }else if(prop == 'float'){ 1.2477 + prop = "styleFloat"; 1.2478 + } 1.2479 + if(!(camel = propCache[prop])){ 1.2480 + camel = propCache[prop] = prop.replace(camelRe, camelFn); 1.2481 + } 1.2482 + if(v = el.style[camel]){ 1.2483 + return v; 1.2484 + } 1.2485 + if(cs = el.currentStyle){ 1.2486 + return cs[camel]; 1.2487 + } 1.2488 + return null; 1.2489 + }; 1.2490 + }(), 1.2491 + 1.2492 + 1.2493 + setStyle : function(prop, value){ 1.2494 + if(typeof prop == "string"){ 1.2495 + var camel; 1.2496 + if(!(camel = propCache[prop])){ 1.2497 + camel = propCache[prop] = prop.replace(camelRe, camelFn); 1.2498 + } 1.2499 + if(camel == 'opacity') { 1.2500 + this.setOpacity(value); 1.2501 + }else{ 1.2502 + this.dom.style[camel] = value; 1.2503 + } 1.2504 + }else{ 1.2505 + for(var style in prop){ 1.2506 + if(typeof prop[style] != "function"){ 1.2507 + this.setStyle(style, prop[style]); 1.2508 + } 1.2509 + } 1.2510 + } 1.2511 + return this; 1.2512 + }, 1.2513 + 1.2514 + 1.2515 + applyStyles : function(style){ 1.2516 + Ext.DomHelper.applyStyles(this.dom, style); 1.2517 + return this; 1.2518 + }, 1.2519 + 1.2520 + 1.2521 + getX : function(){ 1.2522 + return D.getX(this.dom); 1.2523 + }, 1.2524 + 1.2525 + 1.2526 + getY : function(){ 1.2527 + return D.getY(this.dom); 1.2528 + }, 1.2529 + 1.2530 + 1.2531 + getXY : function(){ 1.2532 + return D.getXY(this.dom); 1.2533 + }, 1.2534 + 1.2535 + 1.2536 + getOffsetsTo : function(el){ 1.2537 + var o = this.getXY(); 1.2538 + var e = Ext.fly(el, '_internal').getXY(); 1.2539 + return [o[0]-e[0],o[1]-e[1]]; 1.2540 + }, 1.2541 + 1.2542 + 1.2543 + setX : function(x, animate){ 1.2544 + if(!animate || !A){ 1.2545 + D.setX(this.dom, x); 1.2546 + }else{ 1.2547 + this.setXY([x, this.getY()], this.preanim(arguments, 1)); 1.2548 + } 1.2549 + return this; 1.2550 + }, 1.2551 + 1.2552 + 1.2553 + setY : function(y, animate){ 1.2554 + if(!animate || !A){ 1.2555 + D.setY(this.dom, y); 1.2556 + }else{ 1.2557 + this.setXY([this.getX(), y], this.preanim(arguments, 1)); 1.2558 + } 1.2559 + return this; 1.2560 + }, 1.2561 + 1.2562 + 1.2563 + setLeft : function(left){ 1.2564 + this.setStyle("left", this.addUnits(left)); 1.2565 + return this; 1.2566 + }, 1.2567 + 1.2568 + 1.2569 + setTop : function(top){ 1.2570 + this.setStyle("top", this.addUnits(top)); 1.2571 + return this; 1.2572 + }, 1.2573 + 1.2574 + 1.2575 + setRight : function(right){ 1.2576 + this.setStyle("right", this.addUnits(right)); 1.2577 + return this; 1.2578 + }, 1.2579 + 1.2580 + 1.2581 + setBottom : function(bottom){ 1.2582 + this.setStyle("bottom", this.addUnits(bottom)); 1.2583 + return this; 1.2584 + }, 1.2585 + 1.2586 + 1.2587 + setXY : function(pos, animate){ 1.2588 + if(!animate || !A){ 1.2589 + D.setXY(this.dom, pos); 1.2590 + }else{ 1.2591 + this.anim({points: {to: pos}}, this.preanim(arguments, 1), 'motion'); 1.2592 + } 1.2593 + return this; 1.2594 + }, 1.2595 + 1.2596 + 1.2597 + setLocation : function(x, y, animate){ 1.2598 + this.setXY([x, y], this.preanim(arguments, 2)); 1.2599 + return this; 1.2600 + }, 1.2601 + 1.2602 + 1.2603 + moveTo : function(x, y, animate){ 1.2604 + this.setXY([x, y], this.preanim(arguments, 2)); 1.2605 + return this; 1.2606 + }, 1.2607 + 1.2608 + 1.2609 + getRegion : function(){ 1.2610 + return D.getRegion(this.dom); 1.2611 + }, 1.2612 + 1.2613 + 1.2614 + getHeight : function(contentHeight){ 1.2615 + var h = this.dom.offsetHeight || 0; 1.2616 + h = contentHeight !== true ? h : h-this.getBorderWidth("tb")-this.getPadding("tb"); 1.2617 + return h < 0 ? 0 : h; 1.2618 + }, 1.2619 + 1.2620 + 1.2621 + getWidth : function(contentWidth){ 1.2622 + var w = this.dom.offsetWidth || 0; 1.2623 + w = contentWidth !== true ? w : w-this.getBorderWidth("lr")-this.getPadding("lr"); 1.2624 + return w < 0 ? 0 : w; 1.2625 + }, 1.2626 + 1.2627 + 1.2628 + getComputedHeight : function(){ 1.2629 + var h = Math.max(this.dom.offsetHeight, this.dom.clientHeight); 1.2630 + if(!h){ 1.2631 + h = parseInt(this.getStyle('height'), 10) || 0; 1.2632 + if(!this.isBorderBox()){ 1.2633 + h += this.getFrameWidth('tb'); 1.2634 + } 1.2635 + } 1.2636 + return h; 1.2637 + }, 1.2638 + 1.2639 + 1.2640 + getComputedWidth : function(){ 1.2641 + var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth); 1.2642 + if(!w){ 1.2643 + w = parseInt(this.getStyle('width'), 10) || 0; 1.2644 + if(!this.isBorderBox()){ 1.2645 + w += this.getFrameWidth('lr'); 1.2646 + } 1.2647 + } 1.2648 + return w; 1.2649 + }, 1.2650 + 1.2651 + 1.2652 + getSize : function(contentSize){ 1.2653 + return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)}; 1.2654 + }, 1.2655 + 1.2656 + getStyleSize : function(){ 1.2657 + var w, h, d = this.dom, s = d.style; 1.2658 + if(s.width && s.width != 'auto'){ 1.2659 + w = parseInt(s.width, 10); 1.2660 + if(Ext.isBorderBox){ 1.2661 + w -= this.getFrameWidth('lr'); 1.2662 + } 1.2663 + } 1.2664 + if(s.height && s.height != 'auto'){ 1.2665 + h = parseInt(s.height, 10); 1.2666 + if(Ext.isBorderBox){ 1.2667 + h -= this.getFrameWidth('tb'); 1.2668 + } 1.2669 + } 1.2670 + return {width: w || this.getWidth(true), height: h || this.getHeight(true)}; 1.2671 + 1.2672 + }, 1.2673 + 1.2674 + 1.2675 + getViewSize : function(){ 1.2676 + var d = this.dom, doc = document, aw = 0, ah = 0; 1.2677 + if(d == doc || d == doc.body){ 1.2678 + return {width : D.getViewWidth(), height: D.getViewHeight()}; 1.2679 + }else{ 1.2680 + return { 1.2681 + width : d.clientWidth, 1.2682 + height: d.clientHeight 1.2683 + }; 1.2684 + } 1.2685 + }, 1.2686 + 1.2687 + 1.2688 + getValue : function(asNumber){ 1.2689 + return asNumber ? parseInt(this.dom.value, 10) : this.dom.value; 1.2690 + }, 1.2691 + 1.2692 + adjustWidth : function(width){ 1.2693 + if(typeof width == "number"){ 1.2694 + if(this.autoBoxAdjust && !this.isBorderBox()){ 1.2695 + width -= (this.getBorderWidth("lr") + this.getPadding("lr")); 1.2696 + } 1.2697 + if(width < 0){ 1.2698 + width = 0; 1.2699 + } 1.2700 + } 1.2701 + return width; 1.2702 + }, 1.2703 + 1.2704 + adjustHeight : function(height){ 1.2705 + if(typeof height == "number"){ 1.2706 + if(this.autoBoxAdjust && !this.isBorderBox()){ 1.2707 + height -= (this.getBorderWidth("tb") + this.getPadding("tb")); 1.2708 + } 1.2709 + if(height < 0){ 1.2710 + height = 0; 1.2711 + } 1.2712 + } 1.2713 + return height; 1.2714 + }, 1.2715 + 1.2716 + 1.2717 + setWidth : function(width, animate){ 1.2718 + width = this.adjustWidth(width); 1.2719 + if(!animate || !A){ 1.2720 + this.dom.style.width = this.addUnits(width); 1.2721 + }else{ 1.2722 + this.anim({width: {to: width}}, this.preanim(arguments, 1)); 1.2723 + } 1.2724 + return this; 1.2725 + }, 1.2726 + 1.2727 + 1.2728 + setHeight : function(height, animate){ 1.2729 + height = this.adjustHeight(height); 1.2730 + if(!animate || !A){ 1.2731 + this.dom.style.height = this.addUnits(height); 1.2732 + }else{ 1.2733 + this.anim({height: {to: height}}, this.preanim(arguments, 1)); 1.2734 + } 1.2735 + return this; 1.2736 + }, 1.2737 + 1.2738 + 1.2739 + setSize : function(width, height, animate){ 1.2740 + if(typeof width == "object"){ height = width.height; width = width.width; 1.2741 + } 1.2742 + width = this.adjustWidth(width); height = this.adjustHeight(height); 1.2743 + if(!animate || !A){ 1.2744 + this.dom.style.width = this.addUnits(width); 1.2745 + this.dom.style.height = this.addUnits(height); 1.2746 + }else{ 1.2747 + this.anim({width: {to: width}, height: {to: height}}, this.preanim(arguments, 2)); 1.2748 + } 1.2749 + return this; 1.2750 + }, 1.2751 + 1.2752 + 1.2753 + setBounds : function(x, y, width, height, animate){ 1.2754 + if(!animate || !A){ 1.2755 + this.setSize(width, height); 1.2756 + this.setLocation(x, y); 1.2757 + }else{ 1.2758 + width = this.adjustWidth(width); height = this.adjustHeight(height); 1.2759 + this.anim({points: {to: [x, y]}, width: {to: width}, height: {to: height}}, 1.2760 + this.preanim(arguments, 4), 'motion'); 1.2761 + } 1.2762 + return this; 1.2763 + }, 1.2764 + 1.2765 + 1.2766 + setRegion : function(region, animate){ 1.2767 + this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.preanim(arguments, 1)); 1.2768 + return this; 1.2769 + }, 1.2770 + 1.2771 + 1.2772 + addListener : function(eventName, fn, scope, options){ 1.2773 + Ext.EventManager.on(this.dom, eventName, fn, scope || this, options); 1.2774 + }, 1.2775 + 1.2776 + 1.2777 + removeListener : function(eventName, fn){ 1.2778 + Ext.EventManager.removeListener(this.dom, eventName, fn); 1.2779 + return this; 1.2780 + }, 1.2781 + 1.2782 + 1.2783 + removeAllListeners : function(){ 1.2784 + E.purgeElement(this.dom); 1.2785 + return this; 1.2786 + }, 1.2787 + 1.2788 + 1.2789 + relayEvent : function(eventName, observable){ 1.2790 + this.on(eventName, function(e){ 1.2791 + observable.fireEvent(eventName, e); 1.2792 + }); 1.2793 + }, 1.2794 + 1.2795 + 1.2796 + setOpacity : function(opacity, animate){ 1.2797 + if(!animate || !A){ 1.2798 + var s = this.dom.style; 1.2799 + if(Ext.isIE){ 1.2800 + s.zoom = 1; 1.2801 + s.filter = (s.filter || '').replace(/alpha\([^\)]*\)/gi,"") + 1.2802 + (opacity == 1 ? "" : " alpha(opacity=" + opacity * 100 + ")"); 1.2803 + }else{ 1.2804 + s.opacity = opacity; 1.2805 + } 1.2806 + }else{ 1.2807 + this.anim({opacity: {to: opacity}}, this.preanim(arguments, 1), null, .35, 'easeIn'); 1.2808 + } 1.2809 + return this; 1.2810 + }, 1.2811 + 1.2812 + 1.2813 + getLeft : function(local){ 1.2814 + if(!local){ 1.2815 + return this.getX(); 1.2816 + }else{ 1.2817 + return parseInt(this.getStyle("left"), 10) || 0; 1.2818 + } 1.2819 + }, 1.2820 + 1.2821 + 1.2822 + getRight : function(local){ 1.2823 + if(!local){ 1.2824 + return this.getX() + this.getWidth(); 1.2825 + }else{ 1.2826 + return (this.getLeft(true) + this.getWidth()) || 0; 1.2827 + } 1.2828 + }, 1.2829 + 1.2830 + 1.2831 + getTop : function(local) { 1.2832 + if(!local){ 1.2833 + return this.getY(); 1.2834 + }else{ 1.2835 + return parseInt(this.getStyle("top"), 10) || 0; 1.2836 + } 1.2837 + }, 1.2838 + 1.2839 + 1.2840 + getBottom : function(local){ 1.2841 + if(!local){ 1.2842 + return this.getY() + this.getHeight(); 1.2843 + }else{ 1.2844 + return (this.getTop(true) + this.getHeight()) || 0; 1.2845 + } 1.2846 + }, 1.2847 + 1.2848 + 1.2849 + position : function(pos, zIndex, x, y){ 1.2850 + if(!pos){ 1.2851 + if(this.getStyle('position') == 'static'){ 1.2852 + this.setStyle('position', 'relative'); 1.2853 + } 1.2854 + }else{ 1.2855 + this.setStyle("position", pos); 1.2856 + } 1.2857 + if(zIndex){ 1.2858 + this.setStyle("z-index", zIndex); 1.2859 + } 1.2860 + if(x !== undefined && y !== undefined){ 1.2861 + this.setXY([x, y]); 1.2862 + }else if(x !== undefined){ 1.2863 + this.setX(x); 1.2864 + }else if(y !== undefined){ 1.2865 + this.setY(y); 1.2866 + } 1.2867 + }, 1.2868 + 1.2869 + 1.2870 + clearPositioning : function(value){ 1.2871 + value = value ||''; 1.2872 + this.setStyle({ 1.2873 + "left": value, 1.2874 + "right": value, 1.2875 + "top": value, 1.2876 + "bottom": value, 1.2877 + "z-index": "", 1.2878 + "position" : "static" 1.2879 + }); 1.2880 + return this; 1.2881 + }, 1.2882 + 1.2883 + 1.2884 + getPositioning : function(){ 1.2885 + var l = this.getStyle("left"); 1.2886 + var t = this.getStyle("top"); 1.2887 + return { 1.2888 + "position" : this.getStyle("position"), 1.2889 + "left" : l, 1.2890 + "right" : l ? "" : this.getStyle("right"), 1.2891 + "top" : t, 1.2892 + "bottom" : t ? "" : this.getStyle("bottom"), 1.2893 + "z-index" : this.getStyle("z-index") 1.2894 + }; 1.2895 + }, 1.2896 + 1.2897 + 1.2898 + getBorderWidth : function(side){ 1.2899 + return this.addStyles(side, El.borders); 1.2900 + }, 1.2901 + 1.2902 + 1.2903 + getPadding : function(side){ 1.2904 + return this.addStyles(side, El.paddings); 1.2905 + }, 1.2906 + 1.2907 + 1.2908 + setPositioning : function(pc){ 1.2909 + this.applyStyles(pc); 1.2910 + if(pc.right == "auto"){ 1.2911 + this.dom.style.right = ""; 1.2912 + } 1.2913 + if(pc.bottom == "auto"){ 1.2914 + this.dom.style.bottom = ""; 1.2915 + } 1.2916 + return this; 1.2917 + }, 1.2918 + 1.2919 + fixDisplay : function(){ 1.2920 + if(this.getStyle("display") == "none"){ 1.2921 + this.setStyle("visibility", "hidden"); 1.2922 + this.setStyle("display", this.originalDisplay); if(this.getStyle("display") == "none"){ this.setStyle("display", "block"); 1.2923 + } 1.2924 + } 1.2925 + }, 1.2926 + 1.2927 + setOverflow : function(v){ 1.2928 + if(v=='auto' && Ext.isMac && Ext.isGecko){ this.dom.style.overflow = 'hidden'; 1.2929 + (function(){this.dom.style.overflow = 'auto';}).defer(1, this); 1.2930 + }else{ 1.2931 + this.dom.style.overflow = v; 1.2932 + } 1.2933 + }, 1.2934 + 1.2935 + 1.2936 + setLeftTop : function(left, top){ 1.2937 + this.dom.style.left = this.addUnits(left); 1.2938 + this.dom.style.top = this.addUnits(top); 1.2939 + return this; 1.2940 + }, 1.2941 + 1.2942 + 1.2943 + move : function(direction, distance, animate){ 1.2944 + var xy = this.getXY(); 1.2945 + direction = direction.toLowerCase(); 1.2946 + switch(direction){ 1.2947 + case "l": 1.2948 + case "left": 1.2949 + this.moveTo(xy[0]-distance, xy[1], this.preanim(arguments, 2)); 1.2950 + break; 1.2951 + case "r": 1.2952 + case "right": 1.2953 + this.moveTo(xy[0]+distance, xy[1], this.preanim(arguments, 2)); 1.2954 + break; 1.2955 + case "t": 1.2956 + case "top": 1.2957 + case "up": 1.2958 + this.moveTo(xy[0], xy[1]-distance, this.preanim(arguments, 2)); 1.2959 + break; 1.2960 + case "b": 1.2961 + case "bottom": 1.2962 + case "down": 1.2963 + this.moveTo(xy[0], xy[1]+distance, this.preanim(arguments, 2)); 1.2964 + break; 1.2965 + } 1.2966 + return this; 1.2967 + }, 1.2968 + 1.2969 + 1.2970 + clip : function(){ 1.2971 + if(!this.isClipped){ 1.2972 + this.isClipped = true; 1.2973 + this.originalClip = { 1.2974 + "o": this.getStyle("overflow"), 1.2975 + "x": this.getStyle("overflow-x"), 1.2976 + "y": this.getStyle("overflow-y") 1.2977 + }; 1.2978 + this.setStyle("overflow", "hidden"); 1.2979 + this.setStyle("overflow-x", "hidden"); 1.2980 + this.setStyle("overflow-y", "hidden"); 1.2981 + } 1.2982 + return this; 1.2983 + }, 1.2984 + 1.2985 + 1.2986 + unclip : function(){ 1.2987 + if(this.isClipped){ 1.2988 + this.isClipped = false; 1.2989 + var o = this.originalClip; 1.2990 + if(o.o){this.setStyle("overflow", o.o);} 1.2991 + if(o.x){this.setStyle("overflow-x", o.x);} 1.2992 + if(o.y){this.setStyle("overflow-y", o.y);} 1.2993 + } 1.2994 + return this; 1.2995 + }, 1.2996 + 1.2997 + 1.2998 + 1.2999 + getAnchorXY : function(anchor, local, s){ 1.3000 + 1.3001 + var w, h, vp = false; 1.3002 + if(!s){ 1.3003 + var d = this.dom; 1.3004 + if(d == document.body || d == document){ 1.3005 + vp = true; 1.3006 + w = D.getViewWidth(); h = D.getViewHeight(); 1.3007 + }else{ 1.3008 + w = this.getWidth(); h = this.getHeight(); 1.3009 + } 1.3010 + }else{ 1.3011 + w = s.width; h = s.height; 1.3012 + } 1.3013 + var x = 0, y = 0, r = Math.round; 1.3014 + switch((anchor || "tl").toLowerCase()){ 1.3015 + case "c": 1.3016 + x = r(w*.5); 1.3017 + y = r(h*.5); 1.3018 + break; 1.3019 + case "t": 1.3020 + x = r(w*.5); 1.3021 + y = 0; 1.3022 + break; 1.3023 + case "l": 1.3024 + x = 0; 1.3025 + y = r(h*.5); 1.3026 + break; 1.3027 + case "r": 1.3028 + x = w; 1.3029 + y = r(h*.5); 1.3030 + break; 1.3031 + case "b": 1.3032 + x = r(w*.5); 1.3033 + y = h; 1.3034 + break; 1.3035 + case "tl": 1.3036 + x = 0; 1.3037 + y = 0; 1.3038 + break; 1.3039 + case "bl": 1.3040 + x = 0; 1.3041 + y = h; 1.3042 + break; 1.3043 + case "br": 1.3044 + x = w; 1.3045 + y = h; 1.3046 + break; 1.3047 + case "tr": 1.3048 + x = w; 1.3049 + y = 0; 1.3050 + break; 1.3051 + } 1.3052 + if(local === true){ 1.3053 + return [x, y]; 1.3054 + } 1.3055 + if(vp){ 1.3056 + var sc = this.getScroll(); 1.3057 + return [x + sc.left, y + sc.top]; 1.3058 + } 1.3059 + var o = this.getXY(); 1.3060 + return [x+o[0], y+o[1]]; 1.3061 + }, 1.3062 + 1.3063 + 1.3064 + getAlignToXY : function(el, p, o){ 1.3065 + el = Ext.get(el); 1.3066 + if(!el || !el.dom){ 1.3067 + throw "Element.alignToXY with an element that doesn't exist"; 1.3068 + } 1.3069 + var d = this.dom; 1.3070 + var c = false; var p1 = "", p2 = ""; 1.3071 + o = o || [0,0]; 1.3072 + 1.3073 + if(!p){ 1.3074 + p = "tl-bl"; 1.3075 + }else if(p == "?"){ 1.3076 + p = "tl-bl?"; 1.3077 + }else if(p.indexOf("-") == -1){ 1.3078 + p = "tl-" + p; 1.3079 + } 1.3080 + p = p.toLowerCase(); 1.3081 + var m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/); 1.3082 + if(!m){ 1.3083 + throw "Element.alignTo with an invalid alignment " + p; 1.3084 + } 1.3085 + p1 = m[1]; p2 = m[2]; c = !!m[3]; 1.3086 + 1.3087 + var a1 = this.getAnchorXY(p1, true); 1.3088 + var a2 = el.getAnchorXY(p2, false); 1.3089 + 1.3090 + var x = a2[0] - a1[0] + o[0]; 1.3091 + var y = a2[1] - a1[1] + o[1]; 1.3092 + 1.3093 + if(c){ 1.3094 + var w = this.getWidth(), h = this.getHeight(), r = el.getRegion(); 1.3095 + var dw = D.getViewWidth()-5, dh = D.getViewHeight()-5; 1.3096 + 1.3097 + var p1y = p1.charAt(0), p1x = p1.charAt(p1.length-1); 1.3098 + var p2y = p2.charAt(0), p2x = p2.charAt(p2.length-1); 1.3099 + var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t")); 1.3100 + var swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r")); 1.3101 + 1.3102 + var doc = document; 1.3103 + var scrollX = (doc.documentElement.scrollLeft || doc.body.scrollLeft || 0)+5; 1.3104 + var scrollY = (doc.documentElement.scrollTop || doc.body.scrollTop || 0)+5; 1.3105 + 1.3106 + if((x+w) > dw + scrollX){ 1.3107 + x = swapX ? r.left-w : dw+scrollX-w; 1.3108 + } 1.3109 + if(x < scrollX){ 1.3110 + x = swapX ? r.right : scrollX; 1.3111 + } 1.3112 + if((y+h) > dh + scrollY){ 1.3113 + y = swapY ? r.top-h : dh+scrollY-h; 1.3114 + } 1.3115 + if (y < scrollY){ 1.3116 + y = swapY ? r.bottom : scrollY; 1.3117 + } 1.3118 + } 1.3119 + return [x,y]; 1.3120 + }, 1.3121 + 1.3122 + getConstrainToXY : function(){ 1.3123 + var os = {top:0, left:0, bottom:0, right: 0}; 1.3124 + 1.3125 + return function(el, local, offsets, proposedXY){ 1.3126 + el = Ext.get(el); 1.3127 + offsets = offsets ? Ext.applyIf(offsets, os) : os; 1.3128 + 1.3129 + var vw, vh, vx = 0, vy = 0; 1.3130 + if(el.dom == document.body || el.dom == document){ 1.3131 + vw = Ext.lib.Dom.getViewWidth(); 1.3132 + vh = Ext.lib.Dom.getViewHeight(); 1.3133 + }else{ 1.3134 + vw = el.dom.clientWidth; 1.3135 + vh = el.dom.clientHeight; 1.3136 + if(!local){ 1.3137 + var vxy = el.getXY(); 1.3138 + vx = vxy[0]; 1.3139 + vy = vxy[1]; 1.3140 + } 1.3141 + } 1.3142 + 1.3143 + var s = el.getScroll(); 1.3144 + 1.3145 + vx += offsets.left + s.left; 1.3146 + vy += offsets.top + s.top; 1.3147 + 1.3148 + vw -= offsets.right; 1.3149 + vh -= offsets.bottom; 1.3150 + 1.3151 + var vr = vx+vw; 1.3152 + var vb = vy+vh; 1.3153 + 1.3154 + var xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]); 1.3155 + var x = xy[0], y = xy[1]; 1.3156 + var w = this.dom.offsetWidth, h = this.dom.offsetHeight; 1.3157 + 1.3158 + var moved = false; 1.3159 + 1.3160 + if((x + w) > vr){ 1.3161 + x = vr - w; 1.3162 + moved = true; 1.3163 + } 1.3164 + if((y + h) > vb){ 1.3165 + y = vb - h; 1.3166 + moved = true; 1.3167 + } 1.3168 + if(x < vx){ 1.3169 + x = vx; 1.3170 + moved = true; 1.3171 + } 1.3172 + if(y < vy){ 1.3173 + y = vy; 1.3174 + moved = true; 1.3175 + } 1.3176 + return moved ? [x, y] : false; 1.3177 + }; 1.3178 + }(), 1.3179 + 1.3180 + adjustForConstraints : function(xy, parent, offsets){ 1.3181 + return this.getConstrainToXY(parent || document, false, offsets, xy) || xy; 1.3182 + }, 1.3183 + 1.3184 + 1.3185 + alignTo : function(element, position, offsets, animate){ 1.3186 + var xy = this.getAlignToXY(element, position, offsets); 1.3187 + this.setXY(xy, this.preanim(arguments, 3)); 1.3188 + return this; 1.3189 + }, 1.3190 + 1.3191 + 1.3192 + anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){ 1.3193 + var action = function(){ 1.3194 + this.alignTo(el, alignment, offsets, animate); 1.3195 + Ext.callback(callback, this); 1.3196 + }; 1.3197 + Ext.EventManager.onWindowResize(action, this); 1.3198 + var tm = typeof monitorScroll; 1.3199 + if(tm != 'undefined'){ 1.3200 + Ext.EventManager.on(window, 'scroll', action, this, 1.3201 + {buffer: tm == 'number' ? monitorScroll : 50}); 1.3202 + } 1.3203 + action.call(this); return this; 1.3204 + }, 1.3205 + 1.3206 + clearOpacity : function(){ 1.3207 + if (window.ActiveXObject) { 1.3208 + if(typeof this.dom.style.filter == 'string' && (/alpha/i).test(this.dom.style.filter)){ 1.3209 + this.dom.style.filter = ""; 1.3210 + } 1.3211 + } else { 1.3212 + this.dom.style.opacity = ""; 1.3213 + this.dom.style["-moz-opacity"] = ""; 1.3214 + this.dom.style["-khtml-opacity"] = ""; 1.3215 + } 1.3216 + return this; 1.3217 + }, 1.3218 + 1.3219 + 1.3220 + hide : function(animate){ 1.3221 + this.setVisible(false, this.preanim(arguments, 0)); 1.3222 + return this; 1.3223 + }, 1.3224 + 1.3225 + 1.3226 + show : function(animate){ 1.3227 + this.setVisible(true, this.preanim(arguments, 0)); 1.3228 + return this; 1.3229 + }, 1.3230 + 1.3231 + 1.3232 + addUnits : function(size){ 1.3233 + return Ext.Element.addUnits(size, this.defaultUnit); 1.3234 + }, 1.3235 + 1.3236 + 1.3237 + update : function(html, loadScripts, callback){ 1.3238 + if(typeof html == "undefined"){ 1.3239 + html = ""; 1.3240 + } 1.3241 + if(loadScripts !== true){ 1.3242 + this.dom.innerHTML = html; 1.3243 + if(typeof callback == "function"){ 1.3244 + callback(); 1.3245 + } 1.3246 + return this; 1.3247 + } 1.3248 + var id = Ext.id(); 1.3249 + var dom = this.dom; 1.3250 + 1.3251 + html += '<span id="' + id + '"></span>'; 1.3252 + 1.3253 + E.onAvailable(id, function(){ 1.3254 + var hd = document.getElementsByTagName("head")[0]; 1.3255 + var re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig; 1.3256 + var srcRe = /\ssrc=([\'\"])(.*?)\1/i; 1.3257 + var typeRe = /\stype=([\'\"])(.*?)\1/i; 1.3258 + 1.3259 + var match; 1.3260 + while(match = re.exec(html)){ 1.3261 + var attrs = match[1]; 1.3262 + var srcMatch = attrs ? attrs.match(srcRe) : false; 1.3263 + if(srcMatch && srcMatch[2]){ 1.3264 + var s = document.createElement("script"); 1.3265 + s.src = srcMatch[2]; 1.3266 + var typeMatch = attrs.match(typeRe); 1.3267 + if(typeMatch && typeMatch[2]){ 1.3268 + s.type = typeMatch[2]; 1.3269 + } 1.3270 + hd.appendChild(s); 1.3271 + }else if(match[2] && match[2].length > 0){ 1.3272 + if(window.execScript) { 1.3273 + window.execScript(match[2]); 1.3274 + } else { 1.3275 + window.eval(match[2]); 1.3276 + } 1.3277 + } 1.3278 + } 1.3279 + var el = document.getElementById(id); 1.3280 + if(el){Ext.removeNode(el);} 1.3281 + if(typeof callback == "function"){ 1.3282 + callback(); 1.3283 + } 1.3284 + }); 1.3285 + dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, ""); 1.3286 + return this; 1.3287 + }, 1.3288 + 1.3289 + 1.3290 + load : function(){ 1.3291 + var um = this.getUpdater(); 1.3292 + um.update.apply(um, arguments); 1.3293 + return this; 1.3294 + }, 1.3295 + 1.3296 + 1.3297 + getUpdater : function(){ 1.3298 + if(!this.updateManager){ 1.3299 + this.updateManager = new Ext.Updater(this); 1.3300 + } 1.3301 + return this.updateManager; 1.3302 + }, 1.3303 + 1.3304 + 1.3305 + unselectable : function(){ 1.3306 + this.dom.unselectable = "on"; 1.3307 + this.swallowEvent("selectstart", true); 1.3308 + this.applyStyles("-moz-user-select:none;-khtml-user-select:none;"); 1.3309 + this.addClass("x-unselectable"); 1.3310 + return this; 1.3311 + }, 1.3312 + 1.3313 + 1.3314 + getCenterXY : function(){ 1.3315 + return this.getAlignToXY(document, 'c-c'); 1.3316 + }, 1.3317 + 1.3318 + 1.3319 + center : function(centerIn){ 1.3320 + this.alignTo(centerIn || document, 'c-c'); 1.3321 + return this; 1.3322 + }, 1.3323 + 1.3324 + 1.3325 + isBorderBox : function(){ 1.3326 + return noBoxAdjust[this.dom.tagName.toLowerCase()] || Ext.isBorderBox; 1.3327 + }, 1.3328 + 1.3329 + 1.3330 + getBox : function(contentBox, local){ 1.3331 + var xy; 1.3332 + if(!local){ 1.3333 + xy = this.getXY(); 1.3334 + }else{ 1.3335 + var left = parseInt(this.getStyle("left"), 10) || 0; 1.3336 + var top = parseInt(this.getStyle("top"), 10) || 0; 1.3337 + xy = [left, top]; 1.3338 + } 1.3339 + var el = this.dom, w = el.offsetWidth, h = el.offsetHeight, bx; 1.3340 + if(!contentBox){ 1.3341 + bx = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: w, height: h}; 1.3342 + }else{ 1.3343 + var l = this.getBorderWidth("l")+this.getPadding("l"); 1.3344 + var r = this.getBorderWidth("r")+this.getPadding("r"); 1.3345 + var t = this.getBorderWidth("t")+this.getPadding("t"); 1.3346 + var b = this.getBorderWidth("b")+this.getPadding("b"); 1.3347 + 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)}; 1.3348 + } 1.3349 + bx.right = bx.x + bx.width; 1.3350 + bx.bottom = bx.y + bx.height; 1.3351 + return bx; 1.3352 + }, 1.3353 + 1.3354 + 1.3355 + getFrameWidth : function(sides, onlyContentBox){ 1.3356 + return onlyContentBox && Ext.isBorderBox ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides)); 1.3357 + }, 1.3358 + 1.3359 + 1.3360 + setBox : function(box, adjust, animate){ 1.3361 + var w = box.width, h = box.height; 1.3362 + if((adjust && !this.autoBoxAdjust) && !this.isBorderBox()){ 1.3363 + w -= (this.getBorderWidth("lr") + this.getPadding("lr")); 1.3364 + h -= (this.getBorderWidth("tb") + this.getPadding("tb")); 1.3365 + } 1.3366 + this.setBounds(box.x, box.y, w, h, this.preanim(arguments, 2)); 1.3367 + return this; 1.3368 + }, 1.3369 + 1.3370 + 1.3371 + repaint : function(){ 1.3372 + var dom = this.dom; 1.3373 + this.addClass("x-repaint"); 1.3374 + setTimeout(function(){ 1.3375 + Ext.get(dom).removeClass("x-repaint"); 1.3376 + }, 1); 1.3377 + return this; 1.3378 + }, 1.3379 + 1.3380 + 1.3381 + getMargins : function(side){ 1.3382 + if(!side){ 1.3383 + return { 1.3384 + top: parseInt(this.getStyle("margin-top"), 10) || 0, 1.3385 + left: parseInt(this.getStyle("margin-left"), 10) || 0, 1.3386 + bottom: parseInt(this.getStyle("margin-bottom"), 10) || 0, 1.3387 + right: parseInt(this.getStyle("margin-right"), 10) || 0 1.3388 + }; 1.3389 + }else{ 1.3390 + return this.addStyles(side, El.margins); 1.3391 + } 1.3392 + }, 1.3393 + 1.3394 + addStyles : function(sides, styles){ 1.3395 + var val = 0, v, w; 1.3396 + for(var i = 0, len = sides.length; i < len; i++){ 1.3397 + v = this.getStyle(styles[sides.charAt(i)]); 1.3398 + if(v){ 1.3399 + w = parseInt(v, 10); 1.3400 + if(w){ val += (w >= 0 ? w : -1 * w); } 1.3401 + } 1.3402 + } 1.3403 + return val; 1.3404 + }, 1.3405 + 1.3406 + 1.3407 + createProxy : function(config, renderTo, matchBox){ 1.3408 + config = typeof config == "object" ? 1.3409 + config : {tag : "div", cls: config}; 1.3410 + 1.3411 + var proxy; 1.3412 + if(renderTo){ 1.3413 + proxy = Ext.DomHelper.append(renderTo, config, true); 1.3414 + }else { 1.3415 + proxy = Ext.DomHelper.insertBefore(this.dom, config, true); 1.3416 + } 1.3417 + if(matchBox){ 1.3418 + proxy.setBox(this.getBox()); 1.3419 + } 1.3420 + return proxy; 1.3421 + }, 1.3422 + 1.3423 + 1.3424 + mask : function(msg, msgCls){ 1.3425 + if(this.getStyle("position") == "static"){ 1.3426 + this.setStyle("position", "relative"); 1.3427 + } 1.3428 + if(this._maskMsg){ 1.3429 + this._maskMsg.remove(); 1.3430 + } 1.3431 + if(this._mask){ 1.3432 + this._mask.remove(); 1.3433 + } 1.3434 + 1.3435 + this._mask = Ext.DomHelper.append(this.dom, {cls:"ext-el-mask"}, true); 1.3436 + 1.3437 + this.addClass("x-masked"); 1.3438 + this._mask.setDisplayed(true); 1.3439 + if(typeof msg == 'string'){ 1.3440 + this._maskMsg = Ext.DomHelper.append(this.dom, {cls:"ext-el-mask-msg", cn:{tag:'div'}}, true); 1.3441 + var mm = this._maskMsg; 1.3442 + mm.dom.className = msgCls ? "ext-el-mask-msg " + msgCls : "ext-el-mask-msg"; 1.3443 + mm.dom.firstChild.innerHTML = msg; 1.3444 + mm.setDisplayed(true); 1.3445 + mm.center(this); 1.3446 + } 1.3447 + if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && this.getStyle('height') == 'auto'){ this._mask.setSize(this.dom.clientWidth, this.getHeight()); 1.3448 + } 1.3449 + return this._mask; 1.3450 + }, 1.3451 + 1.3452 + 1.3453 + unmask : function(){ 1.3454 + if(this._mask){ 1.3455 + if(this._maskMsg){ 1.3456 + this._maskMsg.remove(); 1.3457 + delete this._maskMsg; 1.3458 + } 1.3459 + this._mask.remove(); 1.3460 + delete this._mask; 1.3461 + } 1.3462 + this.removeClass("x-masked"); 1.3463 + }, 1.3464 + 1.3465 + 1.3466 + isMasked : function(){ 1.3467 + return this._mask && this._mask.isVisible(); 1.3468 + }, 1.3469 + 1.3470 + 1.3471 + createShim : function(){ 1.3472 + var el = document.createElement('iframe'); 1.3473 + el.frameBorder = 'no'; 1.3474 + el.className = 'ext-shim'; 1.3475 + if(Ext.isIE && Ext.isSecure){ 1.3476 + el.src = Ext.SSL_SECURE_URL; 1.3477 + } 1.3478 + var shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom)); 1.3479 + shim.autoBoxAdjust = false; 1.3480 + return shim; 1.3481 + }, 1.3482 + 1.3483 + 1.3484 + remove : function(){ 1.3485 + Ext.removeNode(this.dom); 1.3486 + delete El.cache[this.dom.id]; 1.3487 + }, 1.3488 + 1.3489 + 1.3490 + hover : function(overFn, outFn, scope){ 1.3491 + var preOverFn = function(e){ 1.3492 + if(!e.within(this, true)){ 1.3493 + overFn.apply(scope || this, arguments); 1.3494 + } 1.3495 + }; 1.3496 + var preOutFn = function(e){ 1.3497 + if(!e.within(this, true)){ 1.3498 + outFn.apply(scope || this, arguments); 1.3499 + } 1.3500 + }; 1.3501 + this.on("mouseover", preOverFn, this.dom); 1.3502 + this.on("mouseout", preOutFn, this.dom); 1.3503 + return this; 1.3504 + }, 1.3505 + 1.3506 + 1.3507 + addClassOnOver : function(className){ 1.3508 + this.hover( 1.3509 + function(){ 1.3510 + Ext.fly(this, '_internal').addClass(className); 1.3511 + }, 1.3512 + function(){ 1.3513 + Ext.fly(this, '_internal').removeClass(className); 1.3514 + } 1.3515 + ); 1.3516 + return this; 1.3517 + }, 1.3518 + 1.3519 + 1.3520 + addClassOnFocus : function(className){ 1.3521 + this.on("focus", function(){ 1.3522 + Ext.fly(this, '_internal').addClass(className); 1.3523 + }, this.dom); 1.3524 + this.on("blur", function(){ 1.3525 + Ext.fly(this, '_internal').removeClass(className); 1.3526 + }, this.dom); 1.3527 + return this; 1.3528 + }, 1.3529 + 1.3530 + addClassOnClick : function(className){ 1.3531 + var dom = this.dom; 1.3532 + this.on("mousedown", function(){ 1.3533 + Ext.fly(dom, '_internal').addClass(className); 1.3534 + var d = Ext.getDoc(); 1.3535 + var fn = function(){ 1.3536 + Ext.fly(dom, '_internal').removeClass(className); 1.3537 + d.removeListener("mouseup", fn); 1.3538 + }; 1.3539 + d.on("mouseup", fn); 1.3540 + }); 1.3541 + return this; 1.3542 + }, 1.3543 + 1.3544 + 1.3545 + swallowEvent : function(eventName, preventDefault){ 1.3546 + var fn = function(e){ 1.3547 + e.stopPropagation(); 1.3548 + if(preventDefault){ 1.3549 + e.preventDefault(); 1.3550 + } 1.3551 + }; 1.3552 + if(Ext.isArray(eventName)){ 1.3553 + for(var i = 0, len = eventName.length; i < len; i++){ 1.3554 + this.on(eventName[i], fn); 1.3555 + } 1.3556 + return this; 1.3557 + } 1.3558 + this.on(eventName, fn); 1.3559 + return this; 1.3560 + }, 1.3561 + 1.3562 + 1.3563 + parent : function(selector, returnDom){ 1.3564 + return this.matchNode('parentNode', 'parentNode', selector, returnDom); 1.3565 + }, 1.3566 + 1.3567 + 1.3568 + next : function(selector, returnDom){ 1.3569 + return this.matchNode('nextSibling', 'nextSibling', selector, returnDom); 1.3570 + }, 1.3571 + 1.3572 + 1.3573 + prev : function(selector, returnDom){ 1.3574 + return this.matchNode('previousSibling', 'previousSibling', selector, returnDom); 1.3575 + }, 1.3576 + 1.3577 + 1.3578 + 1.3579 + first : function(selector, returnDom){ 1.3580 + return this.matchNode('nextSibling', 'firstChild', selector, returnDom); 1.3581 + }, 1.3582 + 1.3583 + 1.3584 + last : function(selector, returnDom){ 1.3585 + return this.matchNode('previousSibling', 'lastChild', selector, returnDom); 1.3586 + }, 1.3587 + 1.3588 + matchNode : function(dir, start, selector, returnDom){ 1.3589 + var n = this.dom[start]; 1.3590 + while(n){ 1.3591 + if(n.nodeType == 1 && (!selector || Ext.DomQuery.is(n, selector))){ 1.3592 + return !returnDom ? Ext.get(n) : n; 1.3593 + } 1.3594 + n = n[dir]; 1.3595 + } 1.3596 + return null; 1.3597 + }, 1.3598 + 1.3599 + 1.3600 + appendChild: function(el){ 1.3601 + el = Ext.get(el); 1.3602 + el.appendTo(this); 1.3603 + return this; 1.3604 + }, 1.3605 + 1.3606 + 1.3607 + createChild: function(config, insertBefore, returnDom){ 1.3608 + config = config || {tag:'div'}; 1.3609 + if(insertBefore){ 1.3610 + return Ext.DomHelper.insertBefore(insertBefore, config, returnDom !== true); 1.3611 + } 1.3612 + return Ext.DomHelper[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config, returnDom !== true); 1.3613 + }, 1.3614 + 1.3615 + 1.3616 + appendTo: function(el){ 1.3617 + el = Ext.getDom(el); 1.3618 + el.appendChild(this.dom); 1.3619 + return this; 1.3620 + }, 1.3621 + 1.3622 + 1.3623 + insertBefore: function(el){ 1.3624 + el = Ext.getDom(el); 1.3625 + el.parentNode.insertBefore(this.dom, el); 1.3626 + return this; 1.3627 + }, 1.3628 + 1.3629 + 1.3630 + insertAfter: function(el){ 1.3631 + el = Ext.getDom(el); 1.3632 + el.parentNode.insertBefore(this.dom, el.nextSibling); 1.3633 + return this; 1.3634 + }, 1.3635 + 1.3636 + 1.3637 + insertFirst: function(el, returnDom){ 1.3638 + el = el || {}; 1.3639 + if(typeof el == 'object' && !el.nodeType && !el.dom){ return this.createChild(el, this.dom.firstChild, returnDom); 1.3640 + }else{ 1.3641 + el = Ext.getDom(el); 1.3642 + this.dom.insertBefore(el, this.dom.firstChild); 1.3643 + return !returnDom ? Ext.get(el) : el; 1.3644 + } 1.3645 + }, 1.3646 + 1.3647 + 1.3648 + insertSibling: function(el, where, returnDom){ 1.3649 + var rt; 1.3650 + if(Ext.isArray(el)){ 1.3651 + for(var i = 0, len = el.length; i < len; i++){ 1.3652 + rt = this.insertSibling(el[i], where, returnDom); 1.3653 + } 1.3654 + return rt; 1.3655 + } 1.3656 + where = where ? where.toLowerCase() : 'before'; 1.3657 + el = el || {}; 1.3658 + var refNode = where == 'before' ? this.dom : this.dom.nextSibling; 1.3659 + 1.3660 + if(typeof el == 'object' && !el.nodeType && !el.dom){ if(where == 'after' && !this.dom.nextSibling){ 1.3661 + rt = Ext.DomHelper.append(this.dom.parentNode, el, !returnDom); 1.3662 + }else{ 1.3663 + rt = Ext.DomHelper[where == 'after' ? 'insertAfter' : 'insertBefore'](this.dom, el, !returnDom); 1.3664 + } 1.3665 + 1.3666 + }else{ 1.3667 + rt = this.dom.parentNode.insertBefore(Ext.getDom(el), refNode); 1.3668 + if(!returnDom){ 1.3669 + rt = Ext.get(rt); 1.3670 + } 1.3671 + } 1.3672 + return rt; 1.3673 + }, 1.3674 + 1.3675 + 1.3676 + wrap: function(config, returnDom){ 1.3677 + if(!config){ 1.3678 + config = {tag: "div"}; 1.3679 + } 1.3680 + var newEl = Ext.DomHelper.insertBefore(this.dom, config, !returnDom); 1.3681 + newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom); 1.3682 + return newEl; 1.3683 + }, 1.3684 + 1.3685 + 1.3686 + replace: function(el){ 1.3687 + el = Ext.get(el); 1.3688 + this.insertBefore(el); 1.3689 + el.remove(); 1.3690 + return this; 1.3691 + }, 1.3692 + 1.3693 + 1.3694 + replaceWith: function(el){ 1.3695 + if(typeof el == 'object' && !el.nodeType && !el.dom){ el = this.insertSibling(el, 'before'); 1.3696 + }else{ 1.3697 + el = Ext.getDom(el); 1.3698 + this.dom.parentNode.insertBefore(el, this.dom); 1.3699 + } 1.3700 + El.uncache(this.id); 1.3701 + this.dom.parentNode.removeChild(this.dom); 1.3702 + this.dom = el; 1.3703 + this.id = Ext.id(el); 1.3704 + El.cache[this.id] = this; 1.3705 + return this; 1.3706 + }, 1.3707 + 1.3708 + 1.3709 + insertHtml : function(where, html, returnEl){ 1.3710 + var el = Ext.DomHelper.insertHtml(where, this.dom, html); 1.3711 + return returnEl ? Ext.get(el) : el; 1.3712 + }, 1.3713 + 1.3714 + 1.3715 + set : function(o, useSet){ 1.3716 + var el = this.dom; 1.3717 + useSet = typeof useSet == 'undefined' ? (el.setAttribute ? true : false) : useSet; 1.3718 + for(var attr in o){ 1.3719 + if(attr == "style" || typeof o[attr] == "function") continue; 1.3720 + if(attr=="cls"){ 1.3721 + el.className = o["cls"]; 1.3722 + }else if(o.hasOwnProperty(attr)){ 1.3723 + if(useSet) el.setAttribute(attr, o[attr]); 1.3724 + else el[attr] = o[attr]; 1.3725 + } 1.3726 + } 1.3727 + if(o.style){ 1.3728 + Ext.DomHelper.applyStyles(el, o.style); 1.3729 + } 1.3730 + return this; 1.3731 + }, 1.3732 + 1.3733 + 1.3734 + addKeyListener : function(key, fn, scope){ 1.3735 + var config; 1.3736 + if(typeof key != "object" || Ext.isArray(key)){ 1.3737 + config = { 1.3738 + key: key, 1.3739 + fn: fn, 1.3740 + scope: scope 1.3741 + }; 1.3742 + }else{ 1.3743 + config = { 1.3744 + key : key.key, 1.3745 + shift : key.shift, 1.3746 + ctrl : key.ctrl, 1.3747 + alt : key.alt, 1.3748 + fn: fn, 1.3749 + scope: scope 1.3750 + }; 1.3751 + } 1.3752 + return new Ext.KeyMap(this, config); 1.3753 + }, 1.3754 + 1.3755 + 1.3756 + addKeyMap : function(config){ 1.3757 + return new Ext.KeyMap(this, config); 1.3758 + }, 1.3759 + 1.3760 + 1.3761 + isScrollable : function(){ 1.3762 + var dom = this.dom; 1.3763 + return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth; 1.3764 + }, 1.3765 + 1.3766 + 1.3767 + scrollTo : function(side, value, animate){ 1.3768 + var prop = side.toLowerCase() == "left" ? "scrollLeft" : "scrollTop"; 1.3769 + if(!animate || !A){ 1.3770 + this.dom[prop] = value; 1.3771 + }else{ 1.3772 + var to = prop == "scrollLeft" ? [value, this.dom.scrollTop] : [this.dom.scrollLeft, value]; 1.3773 + this.anim({scroll: {"to": to}}, this.preanim(arguments, 2), 'scroll'); 1.3774 + } 1.3775 + return this; 1.3776 + }, 1.3777 + 1.3778 + 1.3779 + scroll : function(direction, distance, animate){ 1.3780 + if(!this.isScrollable()){ 1.3781 + return; 1.3782 + } 1.3783 + var el = this.dom; 1.3784 + var l = el.scrollLeft, t = el.scrollTop; 1.3785 + var w = el.scrollWidth, h = el.scrollHeight; 1.3786 + var cw = el.clientWidth, ch = el.clientHeight; 1.3787 + direction = direction.toLowerCase(); 1.3788 + var scrolled = false; 1.3789 + var a = this.preanim(arguments, 2); 1.3790 + switch(direction){ 1.3791 + case "l": 1.3792 + case "left": 1.3793 + if(w - l > cw){ 1.3794 + var v = Math.min(l + distance, w-cw); 1.3795 + this.scrollTo("left", v, a); 1.3796 + scrolled = true; 1.3797 + } 1.3798 + break; 1.3799 + case "r": 1.3800 + case "right": 1.3801 + if(l > 0){ 1.3802 + var v = Math.max(l - distance, 0); 1.3803 + this.scrollTo("left", v, a); 1.3804 + scrolled = true; 1.3805 + } 1.3806 + break; 1.3807 + case "t": 1.3808 + case "top": 1.3809 + case "up": 1.3810 + if(t > 0){ 1.3811 + var v = Math.max(t - distance, 0); 1.3812 + this.scrollTo("top", v, a); 1.3813 + scrolled = true; 1.3814 + } 1.3815 + break; 1.3816 + case "b": 1.3817 + case "bottom": 1.3818 + case "down": 1.3819 + if(h - t > ch){ 1.3820 + var v = Math.min(t + distance, h-ch); 1.3821 + this.scrollTo("top", v, a); 1.3822 + scrolled = true; 1.3823 + } 1.3824 + break; 1.3825 + } 1.3826 + return scrolled; 1.3827 + }, 1.3828 + 1.3829 + 1.3830 + translatePoints : function(x, y){ 1.3831 + if(typeof x == 'object' || Ext.isArray(x)){ 1.3832 + y = x[1]; x = x[0]; 1.3833 + } 1.3834 + var p = this.getStyle('position'); 1.3835 + var o = this.getXY(); 1.3836 + 1.3837 + var l = parseInt(this.getStyle('left'), 10); 1.3838 + var t = parseInt(this.getStyle('top'), 10); 1.3839 + 1.3840 + if(isNaN(l)){ 1.3841 + l = (p == "relative") ? 0 : this.dom.offsetLeft; 1.3842 + } 1.3843 + if(isNaN(t)){ 1.3844 + t = (p == "relative") ? 0 : this.dom.offsetTop; 1.3845 + } 1.3846 + 1.3847 + return {left: (x - o[0] + l), top: (y - o[1] + t)}; 1.3848 + }, 1.3849 + 1.3850 + 1.3851 + getScroll : function(){ 1.3852 + var d = this.dom, doc = document; 1.3853 + if(d == doc || d == doc.body){ 1.3854 + var l, t; 1.3855 + if(Ext.isIE && Ext.isStrict){ 1.3856 + l = doc.documentElement.scrollLeft || (doc.body.scrollLeft || 0); 1.3857 + t = doc.documentElement.scrollTop || (doc.body.scrollTop || 0); 1.3858 + }else{ 1.3859 + l = window.pageXOffset || (doc.body.scrollLeft || 0); 1.3860 + t = window.pageYOffset || (doc.body.scrollTop || 0); 1.3861 + } 1.3862 + return {left: l, top: t}; 1.3863 + }else{ 1.3864 + return {left: d.scrollLeft, top: d.scrollTop}; 1.3865 + } 1.3866 + }, 1.3867 + 1.3868 + 1.3869 + getColor : function(attr, defaultValue, prefix){ 1.3870 + var v = this.getStyle(attr); 1.3871 + if(!v || v == "transparent" || v == "inherit") { 1.3872 + return defaultValue; 1.3873 + } 1.3874 + var color = typeof prefix == "undefined" ? "#" : prefix; 1.3875 + if(v.substr(0, 4) == "rgb("){ 1.3876 + var rvs = v.slice(4, v.length -1).split(","); 1.3877 + for(var i = 0; i < 3; i++){ 1.3878 + var h = parseInt(rvs[i]); 1.3879 + var s = h.toString(16); 1.3880 + if(h < 16){ 1.3881 + s = "0" + s; 1.3882 + } 1.3883 + color += s; 1.3884 + } 1.3885 + } else { 1.3886 + if(v.substr(0, 1) == "#"){ 1.3887 + if(v.length == 4) { 1.3888 + for(var i = 1; i < 4; i++){ 1.3889 + var c = v.charAt(i); 1.3890 + color += c + c; 1.3891 + } 1.3892 + }else if(v.length == 7){ 1.3893 + color += v.substr(1); 1.3894 + } 1.3895 + } 1.3896 + } 1.3897 + return(color.length > 5 ? color.toLowerCase() : defaultValue); 1.3898 + }, 1.3899 + 1.3900 + 1.3901 + boxWrap : function(cls){ 1.3902 + cls = cls || 'x-box'; 1.3903 + var el = Ext.get(this.insertHtml('beforeBegin', String.format('<div class="{0}">'+El.boxMarkup+'</div>', cls))); 1.3904 + el.child('.'+cls+'-mc').dom.appendChild(this.dom); 1.3905 + return el; 1.3906 + }, 1.3907 + 1.3908 + 1.3909 + getAttributeNS : Ext.isIE ? function(ns, name){ 1.3910 + var d = this.dom; 1.3911 + var type = typeof d[ns+":"+name]; 1.3912 + if(type != 'undefined' && type != 'unknown'){ 1.3913 + return d[ns+":"+name]; 1.3914 + } 1.3915 + return d[name]; 1.3916 + } : function(ns, name){ 1.3917 + var d = this.dom; 1.3918 + return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name]; 1.3919 + }, 1.3920 + 1.3921 + getTextWidth : function(text, min, max){ 1.3922 + return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text, this.dom.innerHTML, true)).width).constrain(min || 0, max || 1000000); 1.3923 + } 1.3924 +}; 1.3925 + 1.3926 +var ep = El.prototype; 1.3927 + 1.3928 + 1.3929 +ep.on = ep.addListener; 1.3930 + ep.mon = ep.addListener; 1.3931 + 1.3932 +ep.getUpdateManager = ep.getUpdater; 1.3933 + 1.3934 + 1.3935 +ep.un = ep.removeListener; 1.3936 + 1.3937 + 1.3938 +ep.autoBoxAdjust = true; 1.3939 + 1.3940 +El.unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i; 1.3941 + 1.3942 +El.addUnits = function(v, defaultUnit){ 1.3943 + if(v === "" || v == "auto"){ 1.3944 + return v; 1.3945 + } 1.3946 + if(v === undefined){ 1.3947 + return ''; 1.3948 + } 1.3949 + if(typeof v == "number" || !El.unitPattern.test(v)){ 1.3950 + return v + (defaultUnit || 'px'); 1.3951 + } 1.3952 + return v; 1.3953 +}; 1.3954 + 1.3955 +El.boxMarkup = '<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>'; 1.3956 + 1.3957 +El.VISIBILITY = 1; 1.3958 + 1.3959 +El.DISPLAY = 2; 1.3960 + 1.3961 +El.borders = {l: "border-left-width", r: "border-right-width", t: "border-top-width", b: "border-bottom-width"}; 1.3962 +El.paddings = {l: "padding-left", r: "padding-right", t: "padding-top", b: "padding-bottom"}; 1.3963 +El.margins = {l: "margin-left", r: "margin-right", t: "margin-top", b: "margin-bottom"}; 1.3964 + 1.3965 + 1.3966 + 1.3967 + 1.3968 +El.cache = {}; 1.3969 + 1.3970 +var docEl; 1.3971 + 1.3972 + 1.3973 +El.get = function(el){ 1.3974 + var ex, elm, id; 1.3975 + if(!el){ return null; } 1.3976 + if(typeof el == "string"){ if(!(elm = document.getElementById(el))){ 1.3977 + return null; 1.3978 + } 1.3979 + if(ex = El.cache[el]){ 1.3980 + ex.dom = elm; 1.3981 + }else{ 1.3982 + ex = El.cache[el] = new El(elm); 1.3983 + } 1.3984 + return ex; 1.3985 + }else if(el.tagName){ if(!(id = el.id)){ 1.3986 + id = Ext.id(el); 1.3987 + } 1.3988 + if(ex = El.cache[id]){ 1.3989 + ex.dom = el; 1.3990 + }else{ 1.3991 + ex = El.cache[id] = new El(el); 1.3992 + } 1.3993 + return ex; 1.3994 + }else if(el instanceof El){ 1.3995 + if(el != docEl){ 1.3996 + el.dom = document.getElementById(el.id) || el.dom; El.cache[el.id] = el; } 1.3997 + return el; 1.3998 + }else if(el.isComposite){ 1.3999 + return el; 1.4000 + }else if(Ext.isArray(el)){ 1.4001 + return El.select(el); 1.4002 + }else if(el == document){ 1.4003 + if(!docEl){ 1.4004 + var f = function(){}; 1.4005 + f.prototype = El.prototype; 1.4006 + docEl = new f(); 1.4007 + docEl.dom = document; 1.4008 + } 1.4009 + return docEl; 1.4010 + } 1.4011 + return null; 1.4012 +}; 1.4013 + 1.4014 +El.uncache = function(el){ 1.4015 + for(var i = 0, a = arguments, len = a.length; i < len; i++) { 1.4016 + if(a[i]){ 1.4017 + delete El.cache[a[i].id || a[i]]; 1.4018 + } 1.4019 + } 1.4020 +}; 1.4021 + 1.4022 +El.garbageCollect = function(){ 1.4023 + if(!Ext.enableGarbageCollector){ 1.4024 + clearInterval(El.collectorThread); 1.4025 + return; 1.4026 + } 1.4027 + for(var eid in El.cache){ 1.4028 + var el = El.cache[eid], d = el.dom; 1.4029 + if(!d || !d.parentNode || (!d.offsetParent && !document.getElementById(eid))){ 1.4030 + delete El.cache[eid]; 1.4031 + if(d && Ext.enableListenerCollection){ 1.4032 + E.purgeElement(d); 1.4033 + } 1.4034 + } 1.4035 + } 1.4036 +} 1.4037 +El.collectorThreadId = setInterval(El.garbageCollect, 30000); 1.4038 + 1.4039 +var flyFn = function(){}; 1.4040 +flyFn.prototype = El.prototype; 1.4041 +var _cls = new flyFn(); 1.4042 + 1.4043 +El.Flyweight = function(dom){ 1.4044 + this.dom = dom; 1.4045 +}; 1.4046 + 1.4047 +El.Flyweight.prototype = _cls; 1.4048 +El.Flyweight.prototype.isFlyweight = true; 1.4049 + 1.4050 +El._flyweights = {}; 1.4051 + 1.4052 +El.fly = function(el, named){ 1.4053 + named = named || '_global'; 1.4054 + el = Ext.getDom(el); 1.4055 + if(!el){ 1.4056 + return null; 1.4057 + } 1.4058 + if(!El._flyweights[named]){ 1.4059 + El._flyweights[named] = new El.Flyweight(); 1.4060 + } 1.4061 + El._flyweights[named].dom = el; 1.4062 + return El._flyweights[named]; 1.4063 +}; 1.4064 + 1.4065 + 1.4066 +Ext.get = El.get; 1.4067 + 1.4068 +Ext.fly = El.fly; 1.4069 + 1.4070 +var noBoxAdjust = Ext.isStrict ? { 1.4071 + select:1 1.4072 +} : { 1.4073 + input:1, select:1, textarea:1 1.4074 +}; 1.4075 +if(Ext.isIE || Ext.isGecko){ 1.4076 + noBoxAdjust['button'] = 1; 1.4077 +} 1.4078 + 1.4079 + 1.4080 +Ext.EventManager.on(window, 'unload', function(){ 1.4081 + delete El.cache; 1.4082 + delete El._flyweights; 1.4083 +}); 1.4084 +})(); 1.4085 + 1.4086 +Ext.enableFx = true; 1.4087 + 1.4088 + 1.4089 +Ext.Fx = { 1.4090 + 1.4091 + slideIn : function(anchor, o){ 1.4092 + var el = this.getFxEl(); 1.4093 + o = o || {}; 1.4094 + 1.4095 + el.queueFx(o, function(){ 1.4096 + 1.4097 + anchor = anchor || "t"; 1.4098 + 1.4099 + this.fixDisplay(); 1.4100 + 1.4101 + var r = this.getFxRestore(); 1.4102 + var b = this.getBox(); 1.4103 + this.setSize(b); 1.4104 + 1.4105 + var wrap = this.fxWrap(r.pos, o, "hidden"); 1.4106 + 1.4107 + var st = this.dom.style; 1.4108 + st.visibility = "visible"; 1.4109 + st.position = "absolute"; 1.4110 + 1.4111 + var after = function(){ 1.4112 + el.fxUnwrap(wrap, r.pos, o); 1.4113 + st.width = r.width; 1.4114 + st.height = r.height; 1.4115 + el.afterFx(o); 1.4116 + }; 1.4117 + var a, pt = {to: [b.x, b.y]}, bw = {to: b.width}, bh = {to: b.height}; 1.4118 + 1.4119 + switch(anchor.toLowerCase()){ 1.4120 + case "t": 1.4121 + wrap.setSize(b.width, 0); 1.4122 + st.left = st.bottom = "0"; 1.4123 + a = {height: bh}; 1.4124 + break; 1.4125 + case "l": 1.4126 + wrap.setSize(0, b.height); 1.4127 + st.right = st.top = "0"; 1.4128 + a = {width: bw}; 1.4129 + break; 1.4130 + case "r": 1.4131 + wrap.setSize(0, b.height); 1.4132 + wrap.setX(b.right); 1.4133 + st.left = st.top = "0"; 1.4134 + a = {width: bw, points: pt}; 1.4135 + break; 1.4136 + case "b": 1.4137 + wrap.setSize(b.width, 0); 1.4138 + wrap.setY(b.bottom); 1.4139 + st.left = st.top = "0"; 1.4140 + a = {height: bh, points: pt}; 1.4141 + break; 1.4142 + case "tl": 1.4143 + wrap.setSize(0, 0); 1.4144 + st.right = st.bottom = "0"; 1.4145 + a = {width: bw, height: bh}; 1.4146 + break; 1.4147 + case "bl": 1.4148 + wrap.setSize(0, 0); 1.4149 + wrap.setY(b.y+b.height); 1.4150 + st.right = st.top = "0"; 1.4151 + a = {width: bw, height: bh, points: pt}; 1.4152 + break; 1.4153 + case "br": 1.4154 + wrap.setSize(0, 0); 1.4155 + wrap.setXY([b.right, b.bottom]); 1.4156 + st.left = st.top = "0"; 1.4157 + a = {width: bw, height: bh, points: pt}; 1.4158 + break; 1.4159 + case "tr": 1.4160 + wrap.setSize(0, 0); 1.4161 + wrap.setX(b.x+b.width); 1.4162 + st.left = st.bottom = "0"; 1.4163 + a = {width: bw, height: bh, points: pt}; 1.4164 + break; 1.4165 + } 1.4166 + this.dom.style.visibility = "visible"; 1.4167 + wrap.show(); 1.4168 + 1.4169 + arguments.callee.anim = wrap.fxanim(a, 1.4170 + o, 1.4171 + 'motion', 1.4172 + .5, 1.4173 + 'easeOut', after); 1.4174 + }); 1.4175 + return this; 1.4176 + }, 1.4177 + 1.4178 + 1.4179 + slideOut : function(anchor, o){ 1.4180 + var el = this.getFxEl(); 1.4181 + o = o || {}; 1.4182 + 1.4183 + el.queueFx(o, function(){ 1.4184 + 1.4185 + anchor = anchor || "t"; 1.4186 + 1.4187 + var r = this.getFxRestore(); 1.4188 + 1.4189 + var b = this.getBox(); 1.4190 + this.setSize(b); 1.4191 + 1.4192 + var wrap = this.fxWrap(r.pos, o, "visible"); 1.4193 + 1.4194 + var st = this.dom.style; 1.4195 + st.visibility = "visible"; 1.4196 + st.position = "absolute"; 1.4197 + 1.4198 + wrap.setSize(b); 1.4199 + 1.4200 + var after = function(){ 1.4201 + if(o.useDisplay){ 1.4202 + el.setDisplayed(false); 1.4203 + }else{ 1.4204 + el.hide(); 1.4205 + } 1.4206 + 1.4207 + el.fxUnwrap(wrap, r.pos, o); 1.4208 + 1.4209 + st.width = r.width; 1.4210 + st.height = r.height; 1.4211 + 1.4212 + el.afterFx(o); 1.4213 + }; 1.4214 + 1.4215 + var a, zero = {to: 0}; 1.4216 + switch(anchor.toLowerCase()){ 1.4217 + case "t": 1.4218 + st.left = st.bottom = "0"; 1.4219 + a = {height: zero}; 1.4220 + break; 1.4221 + case "l": 1.4222 + st.right = st.top = "0"; 1.4223 + a = {width: zero}; 1.4224 + break; 1.4225 + case "r": 1.4226 + st.left = st.top = "0"; 1.4227 + a = {width: zero, points: {to:[b.right, b.y]}}; 1.4228 + break; 1.4229 + case "b": 1.4230 + st.left = st.top = "0"; 1.4231 + a = {height: zero, points: {to:[b.x, b.bottom]}}; 1.4232 + break; 1.4233 + case "tl": 1.4234 + st.right = st.bottom = "0"; 1.4235 + a = {width: zero, height: zero}; 1.4236 + break; 1.4237 + case "bl": 1.4238 + st.right = st.top = "0"; 1.4239 + a = {width: zero, height: zero, points: {to:[b.x, b.bottom]}}; 1.4240 + break; 1.4241 + case "br": 1.4242 + st.left = st.top = "0"; 1.4243 + a = {width: zero, height: zero, points: {to:[b.x+b.width, b.bottom]}}; 1.4244 + break; 1.4245 + case "tr": 1.4246 + st.left = st.bottom = "0"; 1.4247 + a = {width: zero, height: zero, points: {to:[b.right, b.y]}}; 1.4248 + break; 1.4249 + } 1.4250 + 1.4251 + arguments.callee.anim = wrap.fxanim(a, 1.4252 + o, 1.4253 + 'motion', 1.4254 + .5, 1.4255 + "easeOut", after); 1.4256 + }); 1.4257 + return this; 1.4258 + }, 1.4259 + 1.4260 + 1.4261 + puff : function(o){ 1.4262 + var el = this.getFxEl(); 1.4263 + o = o || {}; 1.4264 + 1.4265 + el.queueFx(o, function(){ 1.4266 + this.clearOpacity(); 1.4267 + this.show(); 1.4268 + 1.4269 + var r = this.getFxRestore(); 1.4270 + var st = this.dom.style; 1.4271 + 1.4272 + var after = function(){ 1.4273 + if(o.useDisplay){ 1.4274 + el.setDisplayed(false); 1.4275 + }else{ 1.4276 + el.hide(); 1.4277 + } 1.4278 + 1.4279 + el.clearOpacity(); 1.4280 + 1.4281 + el.setPositioning(r.pos); 1.4282 + st.width = r.width; 1.4283 + st.height = r.height; 1.4284 + st.fontSize = ''; 1.4285 + el.afterFx(o); 1.4286 + }; 1.4287 + 1.4288 + var width = this.getWidth(); 1.4289 + var height = this.getHeight(); 1.4290 + 1.4291 + arguments.callee.anim = this.fxanim({ 1.4292 + width : {to: this.adjustWidth(width * 2)}, 1.4293 + height : {to: this.adjustHeight(height * 2)}, 1.4294 + points : {by: [-(width * .5), -(height * .5)]}, 1.4295 + opacity : {to: 0}, 1.4296 + fontSize: {to:200, unit: "%"} 1.4297 + }, 1.4298 + o, 1.4299 + 'motion', 1.4300 + .5, 1.4301 + "easeOut", after); 1.4302 + }); 1.4303 + return this; 1.4304 + }, 1.4305 + 1.4306 + 1.4307 + switchOff : function(o){ 1.4308 + var el = this.getFxEl(); 1.4309 + o = o || {}; 1.4310 + 1.4311 + el.queueFx(o, function(){ 1.4312 + this.clearOpacity(); 1.4313 + this.clip(); 1.4314 + 1.4315 + var r = this.getFxRestore(); 1.4316 + var st = this.dom.style; 1.4317 + 1.4318 + var after = function(){ 1.4319 + if(o.useDisplay){ 1.4320 + el.setDisplayed(false); 1.4321 + }else{ 1.4322 + el.hide(); 1.4323 + } 1.4324 + 1.4325 + el.clearOpacity(); 1.4326 + el.setPositioning(r.pos); 1.4327 + st.width = r.width; 1.4328 + st.height = r.height; 1.4329 + 1.4330 + el.afterFx(o); 1.4331 + }; 1.4332 + 1.4333 + this.fxanim({opacity:{to:0.3}}, null, null, .1, null, function(){ 1.4334 + this.clearOpacity(); 1.4335 + (function(){ 1.4336 + this.fxanim({ 1.4337 + height:{to:1}, 1.4338 + points:{by:[0, this.getHeight() * .5]} 1.4339 + }, o, 'motion', 0.3, 'easeIn', after); 1.4340 + }).defer(100, this); 1.4341 + }); 1.4342 + }); 1.4343 + return this; 1.4344 + }, 1.4345 + 1.4346 + 1.4347 + highlight : function(color, o){ 1.4348 + var el = this.getFxEl(); 1.4349 + o = o || {}; 1.4350 + 1.4351 + el.queueFx(o, function(){ 1.4352 + color = color || "ffff9c"; 1.4353 + var attr = o.attr || "backgroundColor"; 1.4354 + 1.4355 + this.clearOpacity(); 1.4356 + this.show(); 1.4357 + 1.4358 + var origColor = this.getColor(attr); 1.4359 + var restoreColor = this.dom.style[attr]; 1.4360 + var endColor = (o.endColor || origColor) || "ffffff"; 1.4361 + 1.4362 + var after = function(){ 1.4363 + el.dom.style[attr] = restoreColor; 1.4364 + el.afterFx(o); 1.4365 + }; 1.4366 + 1.4367 + var a = {}; 1.4368 + a[attr] = {from: color, to: endColor}; 1.4369 + arguments.callee.anim = this.fxanim(a, 1.4370 + o, 1.4371 + 'color', 1.4372 + 1, 1.4373 + 'easeIn', after); 1.4374 + }); 1.4375 + return this; 1.4376 + }, 1.4377 + 1.4378 + 1.4379 + frame : function(color, count, o){ 1.4380 + var el = this.getFxEl(); 1.4381 + o = o || {}; 1.4382 + 1.4383 + el.queueFx(o, function(){ 1.4384 + color = color || "#C3DAF9"; 1.4385 + if(color.length == 6){ 1.4386 + color = "#" + color; 1.4387 + } 1.4388 + count = count || 1; 1.4389 + var duration = o.duration || 1; 1.4390 + this.show(); 1.4391 + 1.4392 + var b = this.getBox(); 1.4393 + var animFn = function(){ 1.4394 + var proxy = Ext.getBody().createChild({ 1.4395 + style:{ 1.4396 + visbility:"hidden", 1.4397 + position:"absolute", 1.4398 + "z-index":"35000", border:"0px solid " + color 1.4399 + } 1.4400 + }); 1.4401 + var scale = Ext.isBorderBox ? 2 : 1; 1.4402 + proxy.animate({ 1.4403 + top:{from:b.y, to:b.y - 20}, 1.4404 + left:{from:b.x, to:b.x - 20}, 1.4405 + borderWidth:{from:0, to:10}, 1.4406 + opacity:{from:1, to:0}, 1.4407 + height:{from:b.height, to:(b.height + (20*scale))}, 1.4408 + width:{from:b.width, to:(b.width + (20*scale))} 1.4409 + }, duration, function(){ 1.4410 + proxy.remove(); 1.4411 + if(--count > 0){ 1.4412 + animFn(); 1.4413 + }else{ 1.4414 + el.afterFx(o); 1.4415 + } 1.4416 + }); 1.4417 + }; 1.4418 + animFn.call(this); 1.4419 + }); 1.4420 + return this; 1.4421 + }, 1.4422 + 1.4423 + 1.4424 + pause : function(seconds){ 1.4425 + var el = this.getFxEl(); 1.4426 + var o = {}; 1.4427 + 1.4428 + el.queueFx(o, function(){ 1.4429 + setTimeout(function(){ 1.4430 + el.afterFx(o); 1.4431 + }, seconds * 1000); 1.4432 + }); 1.4433 + return this; 1.4434 + }, 1.4435 + 1.4436 + 1.4437 + fadeIn : function(o){ 1.4438 + var el = this.getFxEl(); 1.4439 + o = o || {}; 1.4440 + el.queueFx(o, function(){ 1.4441 + this.setOpacity(0); 1.4442 + this.fixDisplay(); 1.4443 + this.dom.style.visibility = 'visible'; 1.4444 + var to = o.endOpacity || 1; 1.4445 + arguments.callee.anim = this.fxanim({opacity:{to:to}}, 1.4446 + o, null, .5, "easeOut", function(){ 1.4447 + if(to == 1){ 1.4448 + this.clearOpacity(); 1.4449 + } 1.4450 + el.afterFx(o); 1.4451 + }); 1.4452 + }); 1.4453 + return this; 1.4454 + }, 1.4455 + 1.4456 + 1.4457 + fadeOut : function(o){ 1.4458 + var el = this.getFxEl(); 1.4459 + o = o || {}; 1.4460 + el.queueFx(o, function(){ 1.4461 + arguments.callee.anim = this.fxanim({opacity:{to:o.endOpacity || 0}}, 1.4462 + o, null, .5, "easeOut", function(){ 1.4463 + if(this.visibilityMode == Ext.Element.DISPLAY || o.useDisplay){ 1.4464 + this.dom.style.display = "none"; 1.4465 + }else{ 1.4466 + this.dom.style.visibility = "hidden"; 1.4467 + } 1.4468 + this.clearOpacity(); 1.4469 + el.afterFx(o); 1.4470 + }); 1.4471 + }); 1.4472 + return this; 1.4473 + }, 1.4474 + 1.4475 + 1.4476 + scale : function(w, h, o){ 1.4477 + this.shift(Ext.apply({}, o, { 1.4478 + width: w, 1.4479 + height: h 1.4480 + })); 1.4481 + return this; 1.4482 + }, 1.4483 + 1.4484 + 1.4485 + shift : function(o){ 1.4486 + var el = this.getFxEl(); 1.4487 + o = o || {}; 1.4488 + el.queueFx(o, function(){ 1.4489 + var a = {}, w = o.width, h = o.height, x = o.x, y = o.y, op = o.opacity; 1.4490 + if(w !== undefined){ 1.4491 + a.width = {to: this.adjustWidth(w)}; 1.4492 + } 1.4493 + if(h !== undefined){ 1.4494 + a.height = {to: this.adjustHeight(h)}; 1.4495 + } 1.4496 + if(o.left !== undefined){ 1.4497 + a.left = {to: o.left}; 1.4498 + } 1.4499 + if(o.top !== undefined){ 1.4500 + a.top = {to: o.top}; 1.4501 + } 1.4502 + if(o.right !== undefined){ 1.4503 + a.right = {to: o.right}; 1.4504 + } 1.4505 + if(o.bottom !== undefined){ 1.4506 + a.bottom = {to: o.bottom}; 1.4507 + } 1.4508 + if(x !== undefined || y !== undefined){ 1.4509 + a.points = {to: [ 1.4510 + x !== undefined ? x : this.getX(), 1.4511 + y !== undefined ? y : this.getY() 1.4512 + ]}; 1.4513 + } 1.4514 + if(op !== undefined){ 1.4515 + a.opacity = {to: op}; 1.4516 + } 1.4517 + if(o.xy !== undefined){ 1.4518 + a.points = {to: o.xy}; 1.4519 + } 1.4520 + arguments.callee.anim = this.fxanim(a, 1.4521 + o, 'motion', .35, "easeOut", function(){ 1.4522 + el.afterFx(o); 1.4523 + }); 1.4524 + }); 1.4525 + return this; 1.4526 + }, 1.4527 + 1.4528 + 1.4529 + ghost : function(anchor, o){ 1.4530 + var el = this.getFxEl(); 1.4531 + o = o || {}; 1.4532 + 1.4533 + el.queueFx(o, function(){ 1.4534 + anchor = anchor || "b"; 1.4535 + 1.4536 + var r = this.getFxRestore(); 1.4537 + var w = this.getWidth(), 1.4538 + h = this.getHeight(); 1.4539 + 1.4540 + var st = this.dom.style; 1.4541 + 1.4542 + var after = function(){ 1.4543 + if(o.useDisplay){ 1.4544 + el.setDisplayed(false); 1.4545 + }else{ 1.4546 + el.hide(); 1.4547 + } 1.4548 + 1.4549 + el.clearOpacity(); 1.4550 + el.setPositioning(r.pos); 1.4551 + st.width = r.width; 1.4552 + st.height = r.height; 1.4553 + 1.4554 + el.afterFx(o); 1.4555 + }; 1.4556 + 1.4557 + var a = {opacity: {to: 0}, points: {}}, pt = a.points; 1.4558 + switch(anchor.toLowerCase()){ 1.4559 + case "t": 1.4560 + pt.by = [0, -h]; 1.4561 + break; 1.4562 + case "l": 1.4563 + pt.by = [-w, 0]; 1.4564 + break; 1.4565 + case "r": 1.4566 + pt.by = [w, 0]; 1.4567 + break; 1.4568 + case "b": 1.4569 + pt.by = [0, h]; 1.4570 + break; 1.4571 + case "tl": 1.4572 + pt.by = [-w, -h]; 1.4573 + break; 1.4574 + case "bl": 1.4575 + pt.by = [-w, h]; 1.4576 + break; 1.4577 + case "br": 1.4578 + pt.by = [w, h]; 1.4579 + break; 1.4580 + case "tr": 1.4581 + pt.by = [w, -h]; 1.4582 + break; 1.4583 + } 1.4584 + 1.4585 + arguments.callee.anim = this.fxanim(a, 1.4586 + o, 1.4587 + 'motion', 1.4588 + .5, 1.4589 + "easeOut", after); 1.4590 + }); 1.4591 + return this; 1.4592 + }, 1.4593 + 1.4594 + 1.4595 + syncFx : function(){ 1.4596 + this.fxDefaults = Ext.apply(this.fxDefaults || {}, { 1.4597 + block : false, 1.4598 + concurrent : true, 1.4599 + stopFx : false 1.4600 + }); 1.4601 + return this; 1.4602 + }, 1.4603 + 1.4604 + 1.4605 + sequenceFx : function(){ 1.4606 + this.fxDefaults = Ext.apply(this.fxDefaults || {}, { 1.4607 + block : false, 1.4608 + concurrent : false, 1.4609 + stopFx : false 1.4610 + }); 1.4611 + return this; 1.4612 + }, 1.4613 + 1.4614 + 1.4615 + nextFx : function(){ 1.4616 + var ef = this.fxQueue[0]; 1.4617 + if(ef){ 1.4618 + ef.call(this); 1.4619 + } 1.4620 + }, 1.4621 + 1.4622 + 1.4623 + hasActiveFx : function(){ 1.4624 + return this.fxQueue && this.fxQueue[0]; 1.4625 + }, 1.4626 + 1.4627 + 1.4628 + stopFx : function(){ 1.4629 + if(this.hasActiveFx()){ 1.4630 + var cur = this.fxQueue[0]; 1.4631 + if(cur && cur.anim && cur.anim.isAnimated()){ 1.4632 + this.fxQueue = [cur]; cur.anim.stop(true); 1.4633 + } 1.4634 + } 1.4635 + return this; 1.4636 + }, 1.4637 + 1.4638 + 1.4639 + beforeFx : function(o){ 1.4640 + if(this.hasActiveFx() && !o.concurrent){ 1.4641 + if(o.stopFx){ 1.4642 + this.stopFx(); 1.4643 + return true; 1.4644 + } 1.4645 + return false; 1.4646 + } 1.4647 + return true; 1.4648 + }, 1.4649 + 1.4650 + 1.4651 + hasFxBlock : function(){ 1.4652 + var q = this.fxQueue; 1.4653 + return q && q[0] && q[0].block; 1.4654 + }, 1.4655 + 1.4656 + 1.4657 + queueFx : function(o, fn){ 1.4658 + if(!this.fxQueue){ 1.4659 + this.fxQueue = []; 1.4660 + } 1.4661 + if(!this.hasFxBlock()){ 1.4662 + Ext.applyIf(o, this.fxDefaults); 1.4663 + if(!o.concurrent){ 1.4664 + var run = this.beforeFx(o); 1.4665 + fn.block = o.block; 1.4666 + this.fxQueue.push(fn); 1.4667 + if(run){ 1.4668 + this.nextFx(); 1.4669 + } 1.4670 + }else{ 1.4671 + fn.call(this); 1.4672 + } 1.4673 + } 1.4674 + return this; 1.4675 + }, 1.4676 + 1.4677 + 1.4678 + fxWrap : function(pos, o, vis){ 1.4679 + var wrap; 1.4680 + if(!o.wrap || !(wrap = Ext.get(o.wrap))){ 1.4681 + var wrapXY; 1.4682 + if(o.fixPosition){ 1.4683 + wrapXY = this.getXY(); 1.4684 + } 1.4685 + var div = document.createElement("div"); 1.4686 + div.style.visibility = vis; 1.4687 + wrap = Ext.get(this.dom.parentNode.insertBefore(div, this.dom)); 1.4688 + wrap.setPositioning(pos); 1.4689 + if(wrap.getStyle("position") == "static"){ 1.4690 + wrap.position("relative"); 1.4691 + } 1.4692 + this.clearPositioning('auto'); 1.4693 + wrap.clip(); 1.4694 + wrap.dom.appendChild(this.dom); 1.4695 + if(wrapXY){ 1.4696 + wrap.setXY(wrapXY); 1.4697 + } 1.4698 + } 1.4699 + return wrap; 1.4700 + }, 1.4701 + 1.4702 + 1.4703 + fxUnwrap : function(wrap, pos, o){ 1.4704 + this.clearPositioning(); 1.4705 + this.setPositioning(pos); 1.4706 + if(!o.wrap){ 1.4707 + wrap.dom.parentNode.insertBefore(this.dom, wrap.dom); 1.4708 + wrap.remove(); 1.4709 + } 1.4710 + }, 1.4711 + 1.4712 + 1.4713 + getFxRestore : function(){ 1.4714 + var st = this.dom.style; 1.4715 + return {pos: this.getPositioning(), width: st.width, height : st.height}; 1.4716 + }, 1.4717 + 1.4718 + 1.4719 + afterFx : function(o){ 1.4720 + if(o.afterStyle){ 1.4721 + this.applyStyles(o.afterStyle); 1.4722 + } 1.4723 + if(o.afterCls){ 1.4724 + this.addClass(o.afterCls); 1.4725 + } 1.4726 + if(o.remove === true){ 1.4727 + this.remove(); 1.4728 + } 1.4729 + Ext.callback(o.callback, o.scope, [this]); 1.4730 + if(!o.concurrent){ 1.4731 + this.fxQueue.shift(); 1.4732 + this.nextFx(); 1.4733 + } 1.4734 + }, 1.4735 + 1.4736 + 1.4737 + getFxEl : function(){ return Ext.get(this.dom); 1.4738 + }, 1.4739 + 1.4740 + 1.4741 + fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){ 1.4742 + animType = animType || 'run'; 1.4743 + opt = opt || {}; 1.4744 + var anim = Ext.lib.Anim[animType]( 1.4745 + this.dom, args, 1.4746 + (opt.duration || defaultDur) || .35, 1.4747 + (opt.easing || defaultEase) || 'easeOut', 1.4748 + function(){ 1.4749 + Ext.callback(cb, this); 1.4750 + }, 1.4751 + this 1.4752 + ); 1.4753 + opt.anim = anim; 1.4754 + return anim; 1.4755 + } 1.4756 +}; 1.4757 + 1.4758 +Ext.Fx.resize = Ext.Fx.scale; 1.4759 + 1.4760 +Ext.apply(Ext.Element.prototype, Ext.Fx); 1.4761 + 1.4762 + 1.4763 +Ext.CompositeElement = function(els){ 1.4764 + this.elements = []; 1.4765 + this.addElements(els); 1.4766 +}; 1.4767 +Ext.CompositeElement.prototype = { 1.4768 + isComposite: true, 1.4769 + addElements : function(els){ 1.4770 + if(!els) return this; 1.4771 + if(typeof els == "string"){ 1.4772 + els = Ext.Element.selectorFunction(els); 1.4773 + } 1.4774 + var yels = this.elements; 1.4775 + var index = yels.length-1; 1.4776 + for(var i = 0, len = els.length; i < len; i++) { 1.4777 + yels[++index] = Ext.get(els[i]); 1.4778 + } 1.4779 + return this; 1.4780 + }, 1.4781 + 1.4782 + 1.4783 + fill : function(els){ 1.4784 + this.elements = []; 1.4785 + this.add(els); 1.4786 + return this; 1.4787 + }, 1.4788 + 1.4789 + 1.4790 + filter : function(selector){ 1.4791 + var els = []; 1.4792 + this.each(function(el){ 1.4793 + if(el.is(selector)){ 1.4794 + els[els.length] = el.dom; 1.4795 + } 1.4796 + }); 1.4797 + this.fill(els); 1.4798 + return this; 1.4799 + }, 1.4800 + 1.4801 + invoke : function(fn, args){ 1.4802 + var els = this.elements; 1.4803 + for(var i = 0, len = els.length; i < len; i++) { 1.4804 + Ext.Element.prototype[fn].apply(els[i], args); 1.4805 + } 1.4806 + return this; 1.4807 + }, 1.4808 + 1.4809 + add : function(els){ 1.4810 + if(typeof els == "string"){ 1.4811 + this.addElements(Ext.Element.selectorFunction(els)); 1.4812 + }else if(els.length !== undefined){ 1.4813 + this.addElements(els); 1.4814 + }else{ 1.4815 + this.addElements([els]); 1.4816 + } 1.4817 + return this; 1.4818 + }, 1.4819 + 1.4820 + each : function(fn, scope){ 1.4821 + var els = this.elements; 1.4822 + for(var i = 0, len = els.length; i < len; i++){ 1.4823 + if(fn.call(scope || els[i], els[i], this, i) === false) { 1.4824 + break; 1.4825 + } 1.4826 + } 1.4827 + return this; 1.4828 + }, 1.4829 + 1.4830 + 1.4831 + item : function(index){ 1.4832 + return this.elements[index] || null; 1.4833 + }, 1.4834 + 1.4835 + 1.4836 + first : function(){ 1.4837 + return this.item(0); 1.4838 + }, 1.4839 + 1.4840 + 1.4841 + last : function(){ 1.4842 + return this.item(this.elements.length-1); 1.4843 + }, 1.4844 + 1.4845 + 1.4846 + getCount : function(){ 1.4847 + return this.elements.length; 1.4848 + }, 1.4849 + 1.4850 + 1.4851 + contains : function(el){ 1.4852 + return this.indexOf(el) !== -1; 1.4853 + }, 1.4854 + 1.4855 + 1.4856 + indexOf : function(el){ 1.4857 + return this.elements.indexOf(Ext.get(el)); 1.4858 + }, 1.4859 + 1.4860 + 1.4861 + 1.4862 + removeElement : function(el, removeDom){ 1.4863 + if(Ext.isArray(el)){ 1.4864 + for(var i = 0, len = el.length; i < len; i++){ 1.4865 + this.removeElement(el[i]); 1.4866 + } 1.4867 + return this; 1.4868 + } 1.4869 + var index = typeof el == 'number' ? el : this.indexOf(el); 1.4870 + if(index !== -1 && this.elements[index]){ 1.4871 + if(removeDom){ 1.4872 + var d = this.elements[index]; 1.4873 + if(d.dom){ 1.4874 + d.remove(); 1.4875 + }else{ 1.4876 + Ext.removeNode(d); 1.4877 + } 1.4878 + } 1.4879 + this.elements.splice(index, 1); 1.4880 + } 1.4881 + return this; 1.4882 + }, 1.4883 + 1.4884 + 1.4885 + replaceElement : function(el, replacement, domReplace){ 1.4886 + var index = typeof el == 'number' ? el : this.indexOf(el); 1.4887 + if(index !== -1){ 1.4888 + if(domReplace){ 1.4889 + this.elements[index].replaceWith(replacement); 1.4890 + }else{ 1.4891 + this.elements.splice(index, 1, Ext.get(replacement)) 1.4892 + } 1.4893 + } 1.4894 + return this; 1.4895 + }, 1.4896 + 1.4897 + 1.4898 + clear : function(){ 1.4899 + this.elements = []; 1.4900 + } 1.4901 +}; 1.4902 +(function(){ 1.4903 +Ext.CompositeElement.createCall = function(proto, fnName){ 1.4904 + if(!proto[fnName]){ 1.4905 + proto[fnName] = function(){ 1.4906 + return this.invoke(fnName, arguments); 1.4907 + }; 1.4908 + } 1.4909 +}; 1.4910 +for(var fnName in Ext.Element.prototype){ 1.4911 + if(typeof Ext.Element.prototype[fnName] == "function"){ 1.4912 + Ext.CompositeElement.createCall(Ext.CompositeElement.prototype, fnName); 1.4913 + } 1.4914 +}; 1.4915 +})(); 1.4916 + 1.4917 + 1.4918 +Ext.CompositeElementLite = function(els){ 1.4919 + Ext.CompositeElementLite.superclass.constructor.call(this, els); 1.4920 + this.el = new Ext.Element.Flyweight(); 1.4921 +}; 1.4922 +Ext.extend(Ext.CompositeElementLite, Ext.CompositeElement, { 1.4923 + addElements : function(els){ 1.4924 + if(els){ 1.4925 + if(Ext.isArray(els)){ 1.4926 + this.elements = this.elements.concat(els); 1.4927 + }else{ 1.4928 + var yels = this.elements; 1.4929 + var index = yels.length-1; 1.4930 + for(var i = 0, len = els.length; i < len; i++) { 1.4931 + yels[++index] = els[i]; 1.4932 + } 1.4933 + } 1.4934 + } 1.4935 + return this; 1.4936 + }, 1.4937 + invoke : function(fn, args){ 1.4938 + var els = this.elements; 1.4939 + var el = this.el; 1.4940 + for(var i = 0, len = els.length; i < len; i++) { 1.4941 + el.dom = els[i]; 1.4942 + Ext.Element.prototype[fn].apply(el, args); 1.4943 + } 1.4944 + return this; 1.4945 + }, 1.4946 + 1.4947 + item : function(index){ 1.4948 + if(!this.elements[index]){ 1.4949 + return null; 1.4950 + } 1.4951 + this.el.dom = this.elements[index]; 1.4952 + return this.el; 1.4953 + }, 1.4954 + 1.4955 + 1.4956 + addListener : function(eventName, handler, scope, opt){ 1.4957 + var els = this.elements; 1.4958 + for(var i = 0, len = els.length; i < len; i++) { 1.4959 + Ext.EventManager.on(els[i], eventName, handler, scope || els[i], opt); 1.4960 + } 1.4961 + return this; 1.4962 + }, 1.4963 + 1.4964 + 1.4965 + each : function(fn, scope){ 1.4966 + var els = this.elements; 1.4967 + var el = this.el; 1.4968 + for(var i = 0, len = els.length; i < len; i++){ 1.4969 + el.dom = els[i]; 1.4970 + if(fn.call(scope || el, el, this, i) === false){ 1.4971 + break; 1.4972 + } 1.4973 + } 1.4974 + return this; 1.4975 + }, 1.4976 + 1.4977 + indexOf : function(el){ 1.4978 + return this.elements.indexOf(Ext.getDom(el)); 1.4979 + }, 1.4980 + 1.4981 + replaceElement : function(el, replacement, domReplace){ 1.4982 + var index = typeof el == 'number' ? el : this.indexOf(el); 1.4983 + if(index !== -1){ 1.4984 + replacement = Ext.getDom(replacement); 1.4985 + if(domReplace){ 1.4986 + var d = this.elements[index]; 1.4987 + d.parentNode.insertBefore(replacement, d); 1.4988 + Ext.removeNode(d); 1.4989 + } 1.4990 + this.elements.splice(index, 1, replacement); 1.4991 + } 1.4992 + return this; 1.4993 + } 1.4994 +}); 1.4995 +Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener; 1.4996 +if(Ext.DomQuery){ 1.4997 + Ext.Element.selectorFunction = Ext.DomQuery.select; 1.4998 +} 1.4999 + 1.5000 +Ext.Element.select = function(selector, unique, root){ 1.5001 + var els; 1.5002 + if(typeof selector == "string"){ 1.5003 + els = Ext.Element.selectorFunction(selector, root); 1.5004 + }else if(selector.length !== undefined){ 1.5005 + els = selector; 1.5006 + }else{ 1.5007 + throw "Invalid selector"; 1.5008 + } 1.5009 + if(unique === true){ 1.5010 + return new Ext.CompositeElement(els); 1.5011 + }else{ 1.5012 + return new Ext.CompositeElementLite(els); 1.5013 + } 1.5014 +}; 1.5015 + 1.5016 +Ext.select = Ext.Element.select; 1.5017 + 1.5018 +Ext.data.Connection = function(config){ 1.5019 + Ext.apply(this, config); 1.5020 + this.addEvents( 1.5021 + 1.5022 + "beforerequest", 1.5023 + 1.5024 + "requestcomplete", 1.5025 + 1.5026 + "requestexception" 1.5027 + ); 1.5028 + Ext.data.Connection.superclass.constructor.call(this); 1.5029 +}; 1.5030 + 1.5031 +Ext.extend(Ext.data.Connection, Ext.util.Observable, { 1.5032 + 1.5033 + 1.5034 + 1.5035 + 1.5036 + 1.5037 + timeout : 30000, 1.5038 + 1.5039 + autoAbort:false, 1.5040 + 1.5041 + 1.5042 + disableCaching: true, 1.5043 + 1.5044 + 1.5045 + request : function(o){ 1.5046 + if(this.fireEvent("beforerequest", this, o) !== false){ 1.5047 + var p = o.params; 1.5048 + 1.5049 + if(typeof p == "function"){ 1.5050 + p = p.call(o.scope||window, o); 1.5051 + } 1.5052 + if(typeof p == "object"){ 1.5053 + p = Ext.urlEncode(p); 1.5054 + } 1.5055 + if(this.extraParams){ 1.5056 + var extras = Ext.urlEncode(this.extraParams); 1.5057 + p = p ? (p + '&' + extras) : extras; 1.5058 + } 1.5059 + 1.5060 + var url = o.url || this.url; 1.5061 + if(typeof url == 'function'){ 1.5062 + url = url.call(o.scope||window, o); 1.5063 + } 1.5064 + 1.5065 + if(o.form){ 1.5066 + var form = Ext.getDom(o.form); 1.5067 + url = url || form.action; 1.5068 + 1.5069 + var enctype = form.getAttribute("enctype"); 1.5070 + if(o.isUpload || (enctype && enctype.toLowerCase() == 'multipart/form-data')){ 1.5071 + return this.doFormUpload(o, p, url); 1.5072 + } 1.5073 + var f = Ext.lib.Ajax.serializeForm(form); 1.5074 + p = p ? (p + '&' + f) : f; 1.5075 + } 1.5076 + 1.5077 + var hs = o.headers; 1.5078 + if(this.defaultHeaders){ 1.5079 + hs = Ext.apply(hs || {}, this.defaultHeaders); 1.5080 + if(!o.headers){ 1.5081 + o.headers = hs; 1.5082 + } 1.5083 + } 1.5084 + 1.5085 + var cb = { 1.5086 + success: this.handleResponse, 1.5087 + failure: this.handleFailure, 1.5088 + scope: this, 1.5089 + argument: {options: o}, 1.5090 + timeout : o.timeout || this.timeout 1.5091 + }; 1.5092 + 1.5093 + var method = o.method||this.method||(p ? "POST" : "GET"); 1.5094 + 1.5095 + if(method == 'GET' && (this.disableCaching && o.disableCaching !== false) || o.disableCaching === true){ 1.5096 + url += (url.indexOf('?') != -1 ? '&' : '?') + '_dc=' + (new Date().getTime()); 1.5097 + } 1.5098 + 1.5099 + if(typeof o.autoAbort == 'boolean'){ if(o.autoAbort){ 1.5100 + this.abort(); 1.5101 + } 1.5102 + }else if(this.autoAbort !== false){ 1.5103 + this.abort(); 1.5104 + } 1.5105 + if((method == 'GET' || o.xmlData || o.jsonData) && p){ 1.5106 + url += (url.indexOf('?') != -1 ? '&' : '?') + p; 1.5107 + p = ''; 1.5108 + } 1.5109 + this.transId = Ext.lib.Ajax.request(method, url, cb, p, o); 1.5110 + return this.transId; 1.5111 + }else{ 1.5112 + Ext.callback(o.callback, o.scope, [o, null, null]); 1.5113 + return null; 1.5114 + } 1.5115 + }, 1.5116 + 1.5117 + 1.5118 + isLoading : function(transId){ 1.5119 + if(transId){ 1.5120 + return Ext.lib.Ajax.isCallInProgress(transId); 1.5121 + }else{ 1.5122 + return this.transId ? true : false; 1.5123 + } 1.5124 + }, 1.5125 + 1.5126 + 1.5127 + abort : function(transId){ 1.5128 + if(transId || this.isLoading()){ 1.5129 + Ext.lib.Ajax.abort(transId || this.transId); 1.5130 + } 1.5131 + }, 1.5132 + 1.5133 + handleResponse : function(response){ 1.5134 + this.transId = false; 1.5135 + var options = response.argument.options; 1.5136 + response.argument = options ? options.argument : null; 1.5137 + this.fireEvent("requestcomplete", this, response, options); 1.5138 + Ext.callback(options.success, options.scope, [response, options]); 1.5139 + Ext.callback(options.callback, options.scope, [options, true, response]); 1.5140 + }, 1.5141 + 1.5142 + handleFailure : function(response, e){ 1.5143 + this.transId = false; 1.5144 + var options = response.argument.options; 1.5145 + response.argument = options ? options.argument : null; 1.5146 + this.fireEvent("requestexception", this, response, options, e); 1.5147 + Ext.callback(options.failure, options.scope, [response, options]); 1.5148 + Ext.callback(options.callback, options.scope, [options, false, response]); 1.5149 + }, 1.5150 + 1.5151 + doFormUpload : function(o, ps, url){ 1.5152 + var id = Ext.id(); 1.5153 + var frame = document.createElement('iframe'); 1.5154 + frame.id = id; 1.5155 + frame.name = id; 1.5156 + frame.className = 'x-hidden'; 1.5157 + if(Ext.isIE){ 1.5158 + frame.src = Ext.SSL_SECURE_URL; 1.5159 + } 1.5160 + document.body.appendChild(frame); 1.5161 + 1.5162 + if(Ext.isIE){ 1.5163 + document.frames[id].name = id; 1.5164 + } 1.5165 + 1.5166 + var form = Ext.getDom(o.form); 1.5167 + form.target = id; 1.5168 + form.method = 'POST'; 1.5169 + form.enctype = form.encoding = 'multipart/form-data'; 1.5170 + if(url){ 1.5171 + form.action = url; 1.5172 + } 1.5173 + 1.5174 + var hiddens, hd; 1.5175 + if(ps){ hiddens = []; 1.5176 + ps = Ext.urlDecode(ps, false); 1.5177 + for(var k in ps){ 1.5178 + if(ps.hasOwnProperty(k)){ 1.5179 + hd = document.createElement('input'); 1.5180 + hd.type = 'hidden'; 1.5181 + hd.name = k; 1.5182 + hd.value = ps[k]; 1.5183 + form.appendChild(hd); 1.5184 + hiddens.push(hd); 1.5185 + } 1.5186 + } 1.5187 + } 1.5188 + 1.5189 + function cb(){ 1.5190 + var r = { responseText : '', 1.5191 + responseXML : null 1.5192 + }; 1.5193 + 1.5194 + r.argument = o ? o.argument : null; 1.5195 + 1.5196 + try { var doc; 1.5197 + if(Ext.isIE){ 1.5198 + doc = frame.contentWindow.document; 1.5199 + }else { 1.5200 + doc = (frame.contentDocument || window.frames[id].document); 1.5201 + } 1.5202 + if(doc && doc.body){ 1.5203 + r.responseText = doc.body.innerHTML; 1.5204 + } 1.5205 + if(doc && doc.XMLDocument){ 1.5206 + r.responseXML = doc.XMLDocument; 1.5207 + }else { 1.5208 + r.responseXML = doc; 1.5209 + } 1.5210 + } 1.5211 + catch(e) { 1.5212 + } 1.5213 + 1.5214 + Ext.EventManager.removeListener(frame, 'load', cb, this); 1.5215 + 1.5216 + this.fireEvent("requestcomplete", this, r, o); 1.5217 + 1.5218 + Ext.callback(o.success, o.scope, [r, o]); 1.5219 + Ext.callback(o.callback, o.scope, [o, true, r]); 1.5220 + 1.5221 + setTimeout(function(){Ext.removeNode(frame);}, 100); 1.5222 + } 1.5223 + 1.5224 + Ext.EventManager.on(frame, 'load', cb, this); 1.5225 + form.submit(); 1.5226 + 1.5227 + if(hiddens){ for(var i = 0, len = hiddens.length; i < len; i++){ 1.5228 + Ext.removeNode(hiddens[i]); 1.5229 + } 1.5230 + } 1.5231 + } 1.5232 +}); 1.5233 + 1.5234 + 1.5235 +Ext.Ajax = new Ext.data.Connection({ 1.5236 + 1.5237 + 1.5238 + 1.5239 + 1.5240 + 1.5241 + 1.5242 + 1.5243 + 1.5244 + 1.5245 + 1.5246 + 1.5247 + 1.5248 + 1.5249 + 1.5250 + 1.5251 + 1.5252 + 1.5253 + autoAbort : false, 1.5254 + 1.5255 + 1.5256 + serializeForm : function(form){ 1.5257 + return Ext.lib.Ajax.serializeForm(form); 1.5258 + } 1.5259 +}); 1.5260 + 1.5261 +Ext.Updater = function(el, forceNew){ 1.5262 + el = Ext.get(el); 1.5263 + if(!forceNew && el.updateManager){ 1.5264 + return el.updateManager; 1.5265 + } 1.5266 + 1.5267 + this.el = el; 1.5268 + 1.5269 + this.defaultUrl = null; 1.5270 + 1.5271 + this.addEvents( 1.5272 + 1.5273 + "beforeupdate", 1.5274 + 1.5275 + "update", 1.5276 + 1.5277 + "failure" 1.5278 + ); 1.5279 + var d = Ext.Updater.defaults; 1.5280 + 1.5281 + this.sslBlankUrl = d.sslBlankUrl; 1.5282 + 1.5283 + this.disableCaching = d.disableCaching; 1.5284 + 1.5285 + this.indicatorText = d.indicatorText; 1.5286 + 1.5287 + this.showLoadIndicator = d.showLoadIndicator; 1.5288 + 1.5289 + this.timeout = d.timeout; 1.5290 + 1.5291 + this.loadScripts = d.loadScripts; 1.5292 + 1.5293 + this.transaction = null; 1.5294 + 1.5295 + this.refreshDelegate = this.refresh.createDelegate(this); 1.5296 + 1.5297 + this.updateDelegate = this.update.createDelegate(this); 1.5298 + 1.5299 + this.formUpdateDelegate = this.formUpdate.createDelegate(this); 1.5300 + 1.5301 + if(!this.renderer){ 1.5302 + 1.5303 + this.renderer = new Ext.Updater.BasicRenderer(); 1.5304 + } 1.5305 + Ext.Updater.superclass.constructor.call(this); 1.5306 +}; 1.5307 + 1.5308 +Ext.extend(Ext.Updater, Ext.util.Observable, { 1.5309 + 1.5310 + getEl : function(){ 1.5311 + return this.el; 1.5312 + }, 1.5313 + 1.5314 + 1.5315 + update : function(url, params, callback, discardUrl){ 1.5316 + if(this.fireEvent("beforeupdate", this.el, url, params) !== false){ 1.5317 + var cfg, callerScope; 1.5318 + if(typeof url == "object"){ 1.5319 + cfg = url; 1.5320 + url = cfg.url; 1.5321 + params = params || cfg.params; 1.5322 + callback = callback || cfg.callback; 1.5323 + discardUrl = discardUrl || cfg.discardUrl; 1.5324 + callerScope = cfg.scope; 1.5325 + if(typeof cfg.nocache != "undefined"){this.disableCaching = cfg.nocache;}; 1.5326 + if(typeof cfg.text != "undefined"){this.indicatorText = '<div class="loading-indicator">'+cfg.text+"</div>";}; 1.5327 + if(typeof cfg.scripts != "undefined"){this.loadScripts = cfg.scripts;}; 1.5328 + if(typeof cfg.timeout != "undefined"){this.timeout = cfg.timeout;}; 1.5329 + } 1.5330 + this.showLoading(); 1.5331 + 1.5332 + if(!discardUrl){ 1.5333 + this.defaultUrl = url; 1.5334 + } 1.5335 + if(typeof url == "function"){ 1.5336 + url = url.call(this); 1.5337 + } 1.5338 + 1.5339 + var o = Ext.apply(cfg ||{}, { 1.5340 + url : url, 1.5341 + params: (typeof params == "function" && callerScope) ? params.createDelegate(callerScope) : params, 1.5342 + success: this.processSuccess, 1.5343 + failure: this.processFailure, 1.5344 + scope: this, 1.5345 + callback: undefined, 1.5346 + timeout: (this.timeout*1000), 1.5347 + disableCaching: this.disableCaching, 1.5348 + argument: { 1.5349 + "options": cfg, 1.5350 + "url": url, 1.5351 + "form": null, 1.5352 + "callback": callback, 1.5353 + "scope": callerScope || window, 1.5354 + "params": params 1.5355 + } 1.5356 + }); 1.5357 + 1.5358 + this.transaction = Ext.Ajax.request(o); 1.5359 + } 1.5360 + }, 1.5361 + 1.5362 + 1.5363 + formUpdate : function(form, url, reset, callback){ 1.5364 + if(this.fireEvent("beforeupdate", this.el, form, url) !== false){ 1.5365 + if(typeof url == "function"){ 1.5366 + url = url.call(this); 1.5367 + } 1.5368 + form = Ext.getDom(form) 1.5369 + this.transaction = Ext.Ajax.request({ 1.5370 + form: form, 1.5371 + url:url, 1.5372 + success: this.processSuccess, 1.5373 + failure: this.processFailure, 1.5374 + scope: this, 1.5375 + timeout: (this.timeout*1000), 1.5376 + argument: { 1.5377 + "url": url, 1.5378 + "form": form, 1.5379 + "callback": callback, 1.5380 + "reset": reset 1.5381 + } 1.5382 + }); 1.5383 + this.showLoading.defer(1, this); 1.5384 + } 1.5385 + }, 1.5386 + 1.5387 + 1.5388 + refresh : function(callback){ 1.5389 + if(this.defaultUrl == null){ 1.5390 + return; 1.5391 + } 1.5392 + this.update(this.defaultUrl, null, callback, true); 1.5393 + }, 1.5394 + 1.5395 + 1.5396 + startAutoRefresh : function(interval, url, params, callback, refreshNow){ 1.5397 + if(refreshNow){ 1.5398 + this.update(url || this.defaultUrl, params, callback, true); 1.5399 + } 1.5400 + if(this.autoRefreshProcId){ 1.5401 + clearInterval(this.autoRefreshProcId); 1.5402 + } 1.5403 + this.autoRefreshProcId = setInterval(this.update.createDelegate(this, [url || this.defaultUrl, params, callback, true]), interval*1000); 1.5404 + }, 1.5405 + 1.5406 + 1.5407 + stopAutoRefresh : function(){ 1.5408 + if(this.autoRefreshProcId){ 1.5409 + clearInterval(this.autoRefreshProcId); 1.5410 + delete this.autoRefreshProcId; 1.5411 + } 1.5412 + }, 1.5413 + 1.5414 + 1.5415 + isAutoRefreshing : function(){ 1.5416 + return this.autoRefreshProcId ? true : false; 1.5417 + }, 1.5418 + 1.5419 + 1.5420 + showLoading : function(){ 1.5421 + if(this.showLoadIndicator){ 1.5422 + this.el.update(this.indicatorText); 1.5423 + } 1.5424 + }, 1.5425 + 1.5426 + 1.5427 + processSuccess : function(response){ 1.5428 + this.transaction = null; 1.5429 + if(response.argument.form && response.argument.reset){ 1.5430 + try{ 1.5431 + response.argument.form.reset(); 1.5432 + }catch(e){} 1.5433 + } 1.5434 + if(this.loadScripts){ 1.5435 + this.renderer.render(this.el, response, this, 1.5436 + this.updateComplete.createDelegate(this, [response])); 1.5437 + }else{ 1.5438 + this.renderer.render(this.el, response, this); 1.5439 + this.updateComplete(response); 1.5440 + } 1.5441 + }, 1.5442 + 1.5443 + 1.5444 + updateComplete : function(response){ 1.5445 + this.fireEvent("update", this.el, response); 1.5446 + if(typeof response.argument.callback == "function"){ 1.5447 + response.argument.callback.call(response.argument.scope, this.el, true, response, response.argument.options); 1.5448 + } 1.5449 + }, 1.5450 + 1.5451 + 1.5452 + processFailure : function(response){ 1.5453 + this.transaction = null; 1.5454 + this.fireEvent("failure", this.el, response); 1.5455 + if(typeof response.argument.callback == "function"){ 1.5456 + response.argument.callback.call(response.argument.scope, this.el, false, response, response.argument.options); 1.5457 + } 1.5458 + }, 1.5459 + 1.5460 + 1.5461 + setRenderer : function(renderer){ 1.5462 + this.renderer = renderer; 1.5463 + }, 1.5464 + 1.5465 + 1.5466 + getRenderer : function(){ 1.5467 + return this.renderer; 1.5468 + }, 1.5469 + 1.5470 + 1.5471 + setDefaultUrl : function(defaultUrl){ 1.5472 + this.defaultUrl = defaultUrl; 1.5473 + }, 1.5474 + 1.5475 + 1.5476 + abort : function(){ 1.5477 + if(this.transaction){ 1.5478 + Ext.Ajax.abort(this.transaction); 1.5479 + } 1.5480 + }, 1.5481 + 1.5482 + 1.5483 + isUpdating : function(){ 1.5484 + if(this.transaction){ 1.5485 + return Ext.Ajax.isLoading(this.transaction); 1.5486 + } 1.5487 + return false; 1.5488 + } 1.5489 +}); 1.5490 + 1.5491 + 1.5492 + Ext.Updater.defaults = { 1.5493 + 1.5494 + timeout : 30, 1.5495 + 1.5496 + loadScripts : false, 1.5497 + 1.5498 + sslBlankUrl : (Ext.SSL_SECURE_URL || "javascript:false"), 1.5499 + 1.5500 + disableCaching : false, 1.5501 + 1.5502 + showLoadIndicator : true, 1.5503 + 1.5504 + indicatorText : '<div class="loading-indicator">Loading...</div>' 1.5505 + }; 1.5506 + 1.5507 + 1.5508 +Ext.Updater.updateElement = function(el, url, params, options){ 1.5509 + var um = Ext.get(el).getUpdater(); 1.5510 + Ext.apply(um, options); 1.5511 + um.update(url, params, options ? options.callback : null); 1.5512 +}; 1.5513 + 1.5514 +Ext.Updater.BasicRenderer = function(){}; 1.5515 + 1.5516 +Ext.Updater.BasicRenderer.prototype = { 1.5517 + 1.5518 + render : function(el, response, updateManager, callback){ 1.5519 + el.update(response.responseText, updateManager.loadScripts, callback); 1.5520 + } 1.5521 +}; 1.5522 + 1.5523 +Ext.UpdateManager = Ext.Updater; 1.5524 + 1.5525 + 1.5526 + 1.5527 + 1.5528 + 1.5529 +Date.parseFunctions = {count:0}; 1.5530 +Date.parseRegexes = []; 1.5531 +Date.formatFunctions = {count:0}; 1.5532 + 1.5533 +Date.prototype.dateFormat = function(format) { 1.5534 + if (Date.formatFunctions[format] == null) { 1.5535 + Date.createNewFormat(format); 1.5536 + } 1.5537 + var func = Date.formatFunctions[format]; 1.5538 + return this[func](); 1.5539 +}; 1.5540 + 1.5541 + 1.5542 + 1.5543 +Date.prototype.format = Date.prototype.dateFormat; 1.5544 + 1.5545 +Date.createNewFormat = function(format) { 1.5546 + var funcName = "format" + Date.formatFunctions.count++; 1.5547 + Date.formatFunctions[format] = funcName; 1.5548 + var code = "Date.prototype." + funcName + " = function(){return "; 1.5549 + var special = false; 1.5550 + var ch = ''; 1.5551 + for (var i = 0; i < format.length; ++i) { 1.5552 + ch = format.charAt(i); 1.5553 + if (!special && ch == "\\") { 1.5554 + special = true; 1.5555 + } 1.5556 + else if (special) { 1.5557 + special = false; 1.5558 + code += "'" + String.escape(ch) + "' + "; 1.5559 + } 1.5560 + else { 1.5561 + code += Date.getFormatCode(ch) + " + "; 1.5562 + } 1.5563 + } 1.5564 + eval(code.substring(0, code.length - 3) + ";}"); 1.5565 +}; 1.5566 + 1.5567 + 1.5568 +Date.formatCodes = { 1.5569 + d: "String.leftPad(this.getDate(), 2, '0')", 1.5570 + D: "Date.getShortDayName(this.getDay())", j: "this.getDate()", 1.5571 + l: "Date.dayNames[this.getDay()]", 1.5572 + N: "(this.getDay() ? this.getDay() : 7)", 1.5573 + S: "this.getSuffix()", 1.5574 + w: "this.getDay()", 1.5575 + z: "this.getDayOfYear()", 1.5576 + W: "String.leftPad(this.getWeekOfYear(), 2, '0')", 1.5577 + F: "Date.monthNames[this.getMonth()]", 1.5578 + m: "String.leftPad(this.getMonth() + 1, 2, '0')", 1.5579 + M: "Date.getShortMonthName(this.getMonth())", n: "(this.getMonth() + 1)", 1.5580 + t: "this.getDaysInMonth()", 1.5581 + L: "(this.isLeapYear() ? 1 : 0)", 1.5582 + o: "(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))", 1.5583 + Y: "this.getFullYear()", 1.5584 + y: "('' + this.getFullYear()).substring(2, 4)", 1.5585 + a: "(this.getHours() < 12 ? 'am' : 'pm')", 1.5586 + A: "(this.getHours() < 12 ? 'AM' : 'PM')", 1.5587 + g: "((this.getHours() % 12) ? this.getHours() % 12 : 12)", 1.5588 + G: "this.getHours()", 1.5589 + h: "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')", 1.5590 + H: "String.leftPad(this.getHours(), 2, '0')", 1.5591 + i: "String.leftPad(this.getMinutes(), 2, '0')", 1.5592 + s: "String.leftPad(this.getSeconds(), 2, '0')", 1.5593 + u: "String.leftPad(this.getMilliseconds(), 3, '0')", 1.5594 + O: "this.getGMTOffset()", 1.5595 + P: "this.getGMTOffset(true)", 1.5596 + T: "this.getTimezone()", 1.5597 + Z: "(this.getTimezoneOffset() * -60)", 1.5598 + c: function() { for (var c = "Y-m-dTH:i:sP", code = [], i = 0, l = c.length; i < l; ++i) { 1.5599 + var e = c.charAt(i); 1.5600 + code.push(e == "T" ? "'T'" : Date.getFormatCode(e)); } 1.5601 + return code.join(" + "); 1.5602 + }, 1.5603 + 1.5604 + U: "Math.round(this.getTime() / 1000)" 1.5605 +} 1.5606 + 1.5607 +Date.getFormatCode = function(character) { 1.5608 + var f = Date.formatCodes[character]; 1.5609 + 1.5610 + if (f) { 1.5611 + f = Ext.type(f) == 'function'? f() : f; 1.5612 + Date.formatCodes[character] = f; } 1.5613 + 1.5614 + return f || ("'" + String.escape(character) + "'"); 1.5615 +}; 1.5616 + 1.5617 + 1.5618 +Date.parseDate = function(input, format) { 1.5619 + if (Date.parseFunctions[format] == null) { 1.5620 + Date.createParser(format); 1.5621 + } 1.5622 + var func = Date.parseFunctions[format]; 1.5623 + return Date[func](input); 1.5624 +}; 1.5625 + 1.5626 +Date.createParser = function(format) { 1.5627 + var funcName = "parse" + Date.parseFunctions.count++; 1.5628 + var regexNum = Date.parseRegexes.length; 1.5629 + var currentGroup = 1; 1.5630 + Date.parseFunctions[format] = funcName; 1.5631 + 1.5632 + var code = "Date." + funcName + " = function(input){\n" 1.5633 + + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, o, z, u, v;\n" 1.5634 + + "input = String(input);var d = new Date();\n" 1.5635 + + "y = d.getFullYear();\n" 1.5636 + + "m = d.getMonth();\n" 1.5637 + + "d = d.getDate();\n" 1.5638 + + "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n" 1.5639 + + "if (results && results.length > 0) {"; 1.5640 + var regex = ""; 1.5641 + 1.5642 + var special = false; 1.5643 + var ch = ''; 1.5644 + for (var i = 0; i < format.length; ++i) { 1.5645 + ch = format.charAt(i); 1.5646 + if (!special && ch == "\\") { 1.5647 + special = true; 1.5648 + } 1.5649 + else if (special) { 1.5650 + special = false; 1.5651 + regex += String.escape(ch); 1.5652 + } 1.5653 + else { 1.5654 + var obj = Date.formatCodeToRegex(ch, currentGroup); 1.5655 + currentGroup += obj.g; 1.5656 + regex += obj.s; 1.5657 + if (obj.g && obj.c) { 1.5658 + code += obj.c; 1.5659 + } 1.5660 + } 1.5661 + } 1.5662 + 1.5663 + code += "if (u){\n" 1.5664 + + "v = new Date(u * 1000);\n" + "}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0){\n" 1.5665 + + "v = new Date(y, m, d, h, i, s, ms);\n" 1.5666 + + "}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0){\n" 1.5667 + + "v = new Date(y, m, d, h, i, s);\n" 1.5668 + + "}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0){\n" 1.5669 + + "v = new Date(y, m, d, h, i);\n" 1.5670 + + "}else if (y >= 0 && m >= 0 && d > 0 && h >= 0){\n" 1.5671 + + "v = new Date(y, m, d, h);\n" 1.5672 + + "}else if (y >= 0 && m >= 0 && d > 0){\n" 1.5673 + + "v = new Date(y, m, d);\n" 1.5674 + + "}else if (y >= 0 && m >= 0){\n" 1.5675 + + "v = new Date(y, m);\n" 1.5676 + + "}else if (y >= 0){\n" 1.5677 + + "v = new Date(y);\n" 1.5678 + + "}\n}\nreturn (v && Ext.type(z || o) == 'number')?" + " (Ext.type(z) == 'number' ? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + z) :" + " v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v;\n" + "}"; 1.5679 + 1.5680 + Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$", "i"); 1.5681 + eval(code); 1.5682 +}; 1.5683 + 1.5684 +Date.parseCodes = { 1.5685 + 1.5686 + d: { 1.5687 + g:1, 1.5688 + c:"d = parseInt(results[{0}], 10);\n", 1.5689 + s:"(\\d{2})" }, 1.5690 + j: function() { 1.5691 + return Ext.applyIf({ 1.5692 + s:"(\\d{1,2})" }, Date.parseCodes["d"]); 1.5693 + }, 1.5694 + D: function() { 1.5695 + for (var a = [], i = 0; i < 7; a.push(Date.getShortDayName(i)), ++i); return { 1.5696 + g:0, 1.5697 + c:null, 1.5698 + s:"(?:" + a.join("|") +")" 1.5699 + } 1.5700 + }, 1.5701 + l: function() { 1.5702 + return { 1.5703 + g:0, 1.5704 + c:null, 1.5705 + s:"(?:" + Date.dayNames.join("|") + ")" 1.5706 + } 1.5707 + }, 1.5708 + N: { 1.5709 + g:0, 1.5710 + c:null, 1.5711 + s:"[1-7]" }, 1.5712 + S: { 1.5713 + g:0, 1.5714 + c:null, 1.5715 + s:"(?:st|nd|rd|th)" 1.5716 + }, 1.5717 + w: { 1.5718 + g:0, 1.5719 + c:null, 1.5720 + s:"[0-6]" }, 1.5721 + z: { 1.5722 + g:0, 1.5723 + c:null, 1.5724 + s:"(?:\\d{1,3}" }, 1.5725 + W: { 1.5726 + g:0, 1.5727 + c:null, 1.5728 + s:"(?:\\d{2})" }, 1.5729 + F: function() { 1.5730 + return { 1.5731 + g:1, 1.5732 + c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n", s:"(" + Date.monthNames.join("|") + ")" 1.5733 + } 1.5734 + }, 1.5735 + M: function() { 1.5736 + for (var a = [], i = 0; i < 12; a.push(Date.getShortMonthName(i)), ++i); return Ext.applyIf({ 1.5737 + s:"(" + a.join("|") + ")" 1.5738 + }, Date.parseCodes["F"]); 1.5739 + }, 1.5740 + m: { 1.5741 + g:1, 1.5742 + c:"m = parseInt(results[{0}], 10) - 1;\n", 1.5743 + s:"(\\d{2})" }, 1.5744 + n: function() { 1.5745 + return Ext.applyIf({ 1.5746 + s:"(\\d{1,2})" }, Date.parseCodes["m"]); 1.5747 + }, 1.5748 + t: { 1.5749 + g:0, 1.5750 + c:null, 1.5751 + s:"(?:\\d{2})" }, 1.5752 + L: { 1.5753 + g:0, 1.5754 + c:null, 1.5755 + s:"(?:1|0)" 1.5756 + }, 1.5757 + o: function() { 1.5758 + return Date.parseCodes["Y"]; 1.5759 + }, 1.5760 + Y: { 1.5761 + g:1, 1.5762 + c:"y = parseInt(results[{0}], 10);\n", 1.5763 + s:"(\\d{4})" }, 1.5764 + y: { 1.5765 + g:1, 1.5766 + c:"var ty = parseInt(results[{0}], 10);\n" 1.5767 + + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", s:"(\\d{1,2})" 1.5768 + }, 1.5769 + a: { 1.5770 + g:1, 1.5771 + c:"if (results[{0}] == 'am') {\n" 1.5772 + + "if (h == 12) { h = 0; }\n" 1.5773 + + "} else { if (h < 12) { h += 12; }}", 1.5774 + s:"(am|pm)" 1.5775 + }, 1.5776 + A: { 1.5777 + g:1, 1.5778 + c:"if (results[{0}] == 'AM') {\n" 1.5779 + + "if (h == 12) { h = 0; }\n" 1.5780 + + "} else { if (h < 12) { h += 12; }}", 1.5781 + s:"(AM|PM)" 1.5782 + }, 1.5783 + g: function() { 1.5784 + return Date.parseCodes["G"]; 1.5785 + }, 1.5786 + G: { 1.5787 + g:1, 1.5788 + c:"h = parseInt(results[{0}], 10);\n", 1.5789 + s:"(\\d{1,2})" }, 1.5790 + h: function() { 1.5791 + return Date.parseCodes["H"]; 1.5792 + }, 1.5793 + H: { 1.5794 + g:1, 1.5795 + c:"h = parseInt(results[{0}], 10);\n", 1.5796 + s:"(\\d{2})" }, 1.5797 + i: { 1.5798 + g:1, 1.5799 + c:"i = parseInt(results[{0}], 10);\n", 1.5800 + s:"(\\d{2})" }, 1.5801 + s: { 1.5802 + g:1, 1.5803 + c:"s = parseInt(results[{0}], 10);\n", 1.5804 + s:"(\\d{2})" }, 1.5805 + u: { 1.5806 + g:1, 1.5807 + c:"ms = parseInt(results[{0}], 10);\n", 1.5808 + s:"(\\d{3})" }, 1.5809 + O: { 1.5810 + g:1, 1.5811 + c:[ 1.5812 + "o = results[{0}];", 1.5813 + "var sn = o.substring(0,1);", "var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);", "var mn = o.substring(3,5) % 60;", "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" ].join("\n"), 1.5814 + s: "([+\-]\\d{4})" }, 1.5815 + P: function() { 1.5816 + return Ext.applyIf({ 1.5817 + s: "([+\-]\\d{2}:\\d{2})" }, Date.parseCodes["O"]); 1.5818 + }, 1.5819 + T: { 1.5820 + g:0, 1.5821 + c:null, 1.5822 + s:"[A-Z]{1,4}" }, 1.5823 + Z: { 1.5824 + g:1, 1.5825 + c:"z = results[{0}] * 1;\n" + "z = (-43200 <= z && z <= 50400)? z : null;\n", 1.5826 + s:"([+\-]?\\d{1,5})" }, 1.5827 + c: function() { 1.5828 + var df = Date.formatCodeToRegex, calc = []; 1.5829 + var arr = [ 1.5830 + df("Y", 1), 1.5831 + df("m", 2), 1.5832 + df("d", 3), 1.5833 + df("h", 4), 1.5834 + df("i", 5), 1.5835 + df("s", 6), 1.5836 + {c:"if(results[7] == 'Z'){\no = 0;\n}else{\n" + df("P", 7).c + "\n}"} ]; 1.5837 + for (var i = 0, l = arr.length; i < l; ++i) { 1.5838 + calc.push(arr[i].c); 1.5839 + } 1.5840 + 1.5841 + return { 1.5842 + g:1, 1.5843 + c:calc.join(""), 1.5844 + s:arr[0].s + "-" + arr[1].s + "-" + arr[2].s + "T" + arr[3].s + ":" + arr[4].s + ":" + arr[5].s + "(" + df("P", 7).s + "|Z)" 1.5845 + } 1.5846 + }, 1.5847 + U: { 1.5848 + g:1, 1.5849 + c:"u = parseInt(results[{0}], 10);\n", 1.5850 + s:"(-?\\d+)" } 1.5851 +} 1.5852 + 1.5853 +Date.formatCodeToRegex = function(character, currentGroup) { 1.5854 + var p = Date.parseCodes[character]; 1.5855 + 1.5856 + if (p) { 1.5857 + p = Ext.type(p) == 'function'? p() : p; 1.5858 + Date.parseCodes[character] = p; 1.5859 + if (p.c) { 1.5860 + p.c = String.format(p.c, currentGroup); 1.5861 + } 1.5862 + } 1.5863 + 1.5864 + return p || { 1.5865 + g:0, 1.5866 + c:null, 1.5867 + s:Ext.escapeRe(character) } 1.5868 +}; 1.5869 + 1.5870 + 1.5871 +Date.prototype.getTimezone = function() { 1.5872 + return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, ""); 1.5873 +}; 1.5874 + 1.5875 + 1.5876 +Date.prototype.getGMTOffset = function(colon) { 1.5877 + return (this.getTimezoneOffset() > 0 ? "-" : "+") 1.5878 + + String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset() / 60)), 2, "0") 1.5879 + + (colon ? ":" : "") 1.5880 + + String.leftPad(this.getTimezoneOffset() % 60, 2, "0"); 1.5881 +}; 1.5882 + 1.5883 + 1.5884 +Date.prototype.getDayOfYear = function() { 1.5885 + var num = 0; 1.5886 + Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28; 1.5887 + for (var i = 0; i < this.getMonth(); ++i) { 1.5888 + num += Date.daysInMonth[i]; 1.5889 + } 1.5890 + return num + this.getDate() - 1; 1.5891 +}; 1.5892 + 1.5893 + 1.5894 +Date.prototype.getWeekOfYear = function() { 1.5895 + var ms1d = 864e5; var ms7d = 7 * ms1d; var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d; var AWN = Math.floor(DC3 / 7); var Wyr = new Date(AWN * ms7d).getUTCFullYear(); 1.5896 + return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1; 1.5897 +}; 1.5898 + 1.5899 + 1.5900 +Date.prototype.isLeapYear = function() { 1.5901 + var year = this.getFullYear(); 1.5902 + return !!((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year))); 1.5903 +}; 1.5904 + 1.5905 + 1.5906 +Date.prototype.getFirstDayOfMonth = function() { 1.5907 + var day = (this.getDay() - (this.getDate() - 1)) % 7; 1.5908 + return (day < 0) ? (day + 7) : day; 1.5909 +}; 1.5910 + 1.5911 + 1.5912 +Date.prototype.getLastDayOfMonth = function() { 1.5913 + var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7; 1.5914 + return (day < 0) ? (day + 7) : day; 1.5915 +}; 1.5916 + 1.5917 + 1.5918 + 1.5919 +Date.prototype.getFirstDateOfMonth = function() { 1.5920 + return new Date(this.getFullYear(), this.getMonth(), 1); 1.5921 +}; 1.5922 + 1.5923 + 1.5924 +Date.prototype.getLastDateOfMonth = function() { 1.5925 + return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth()); 1.5926 +}; 1.5927 + 1.5928 +Date.prototype.getDaysInMonth = function() { 1.5929 + Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28; 1.5930 + return Date.daysInMonth[this.getMonth()]; 1.5931 +}; 1.5932 + 1.5933 + 1.5934 +Date.prototype.getSuffix = function() { 1.5935 + switch (this.getDate()) { 1.5936 + case 1: 1.5937 + case 21: 1.5938 + case 31: 1.5939 + return "st"; 1.5940 + case 2: 1.5941 + case 22: 1.5942 + return "nd"; 1.5943 + case 3: 1.5944 + case 23: 1.5945 + return "rd"; 1.5946 + default: 1.5947 + return "th"; 1.5948 + } 1.5949 +}; 1.5950 + 1.5951 +Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31]; 1.5952 + 1.5953 + 1.5954 +Date.monthNames = [ 1.5955 + "January", 1.5956 + "February", 1.5957 + "March", 1.5958 + "April", 1.5959 + "May", 1.5960 + "June", 1.5961 + "July", 1.5962 + "August", 1.5963 + "September", 1.5964 + "October", 1.5965 + "November", 1.5966 + "December" 1.5967 +]; 1.5968 + 1.5969 + 1.5970 +Date.getShortMonthName = function(month) { 1.5971 + return Date.monthNames[month].substring(0, 3); 1.5972 +} 1.5973 + 1.5974 + 1.5975 +Date.dayNames = [ 1.5976 + "Sunday", 1.5977 + "Monday", 1.5978 + "Tuesday", 1.5979 + "Wednesday", 1.5980 + "Thursday", 1.5981 + "Friday", 1.5982 + "Saturday" 1.5983 +]; 1.5984 + 1.5985 + 1.5986 +Date.getShortDayName = function(day) { 1.5987 + return Date.dayNames[day].substring(0, 3); 1.5988 +} 1.5989 + 1.5990 +Date.y2kYear = 50; 1.5991 + 1.5992 + 1.5993 +Date.monthNumbers = { 1.5994 + Jan:0, 1.5995 + Feb:1, 1.5996 + Mar:2, 1.5997 + Apr:3, 1.5998 + May:4, 1.5999 + Jun:5, 1.6000 + Jul:6, 1.6001 + Aug:7, 1.6002 + Sep:8, 1.6003 + Oct:9, 1.6004 + Nov:10, 1.6005 + Dec:11 1.6006 +}; 1.6007 + 1.6008 + 1.6009 +Date.getMonthNumber = function(name) { 1.6010 + return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()]; 1.6011 +} 1.6012 + 1.6013 + 1.6014 +Date.prototype.clone = function() { 1.6015 + return new Date(this.getTime()); 1.6016 +}; 1.6017 + 1.6018 + 1.6019 +Date.prototype.clearTime = function(clone){ 1.6020 + if(clone){ 1.6021 + return this.clone().clearTime(); 1.6022 + } 1.6023 + this.setHours(0); 1.6024 + this.setMinutes(0); 1.6025 + this.setSeconds(0); 1.6026 + this.setMilliseconds(0); 1.6027 + return this; 1.6028 +}; 1.6029 + 1.6030 +if(Ext.isSafari){ 1.6031 + Date.brokenSetMonth = Date.prototype.setMonth; 1.6032 + Date.prototype.setMonth = function(num){ 1.6033 + if(num <= -1){ 1.6034 + var n = Math.ceil(-num); 1.6035 + var back_year = Math.ceil(n/12); 1.6036 + var month = (n % 12) ? 12 - n % 12 : 0 ; 1.6037 + this.setFullYear(this.getFullYear() - back_year); 1.6038 + return Date.brokenSetMonth.call(this, month); 1.6039 + } else { 1.6040 + return Date.brokenSetMonth.apply(this, arguments); 1.6041 + } 1.6042 + }; 1.6043 +} 1.6044 + 1.6045 + 1.6046 +Date.MILLI = "ms"; 1.6047 + 1.6048 +Date.SECOND = "s"; 1.6049 + 1.6050 +Date.MINUTE = "mi"; 1.6051 + 1.6052 +Date.HOUR = "h"; 1.6053 + 1.6054 +Date.DAY = "d"; 1.6055 + 1.6056 +Date.MONTH = "mo"; 1.6057 + 1.6058 +Date.YEAR = "y"; 1.6059 + 1.6060 + 1.6061 +Date.prototype.add = function(interval, value){ 1.6062 + var d = this.clone(); 1.6063 + if (!interval || value === 0) return d; 1.6064 + switch(interval.toLowerCase()){ 1.6065 + case Date.MILLI: 1.6066 + d.setMilliseconds(this.getMilliseconds() + value); 1.6067 + break; 1.6068 + case Date.SECOND: 1.6069 + d.setSeconds(this.getSeconds() + value); 1.6070 + break; 1.6071 + case Date.MINUTE: 1.6072 + d.setMinutes(this.getMinutes() + value); 1.6073 + break; 1.6074 + case Date.HOUR: 1.6075 + d.setHours(this.getHours() + value); 1.6076 + break; 1.6077 + case Date.DAY: 1.6078 + d.setDate(this.getDate() + value); 1.6079 + break; 1.6080 + case Date.MONTH: 1.6081 + var day = this.getDate(); 1.6082 + if(day > 28){ 1.6083 + day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate()); 1.6084 + } 1.6085 + d.setDate(day); 1.6086 + d.setMonth(this.getMonth() + value); 1.6087 + break; 1.6088 + case Date.YEAR: 1.6089 + d.setFullYear(this.getFullYear() + value); 1.6090 + break; 1.6091 + } 1.6092 + return d; 1.6093 +}; 1.6094 + 1.6095 + 1.6096 +Date.prototype.between = function(start, end){ 1.6097 + var t = this.getTime(); 1.6098 + return start.getTime() <= t && t <= end.getTime(); 1.6099 +} 1.6100 + 1.6101 +Ext.util.DelayedTask = function(fn, scope, args){ 1.6102 + var id = null, d, t; 1.6103 + 1.6104 + var call = function(){ 1.6105 + var now = new Date().getTime(); 1.6106 + if(now - t >= d){ 1.6107 + clearInterval(id); 1.6108 + id = null; 1.6109 + fn.apply(scope, args || []); 1.6110 + } 1.6111 + }; 1.6112 + 1.6113 + this.delay = function(delay, newFn, newScope, newArgs){ 1.6114 + if(id && delay != d){ 1.6115 + this.cancel(); 1.6116 + } 1.6117 + d = delay; 1.6118 + t = new Date().getTime(); 1.6119 + fn = newFn || fn; 1.6120 + scope = newScope || scope; 1.6121 + args = newArgs || args; 1.6122 + if(!id){ 1.6123 + id = setInterval(call, d); 1.6124 + } 1.6125 + }; 1.6126 + 1.6127 + 1.6128 + this.cancel = function(){ 1.6129 + if(id){ 1.6130 + clearInterval(id); 1.6131 + id = null; 1.6132 + } 1.6133 + }; 1.6134 +}; 1.6135 + 1.6136 +Ext.util.TaskRunner = function(interval){ 1.6137 + interval = interval || 10; 1.6138 + var tasks = [], removeQueue = []; 1.6139 + var id = 0; 1.6140 + var running = false; 1.6141 + 1.6142 + var stopThread = function(){ 1.6143 + running = false; 1.6144 + clearInterval(id); 1.6145 + id = 0; 1.6146 + }; 1.6147 + 1.6148 + var startThread = function(){ 1.6149 + if(!running){ 1.6150 + running = true; 1.6151 + id = setInterval(runTasks, interval); 1.6152 + } 1.6153 + }; 1.6154 + 1.6155 + var removeTask = function(t){ 1.6156 + removeQueue.push(t); 1.6157 + if(t.onStop){ 1.6158 + t.onStop.apply(t.scope || t); 1.6159 + } 1.6160 + }; 1.6161 + 1.6162 + var runTasks = function(){ 1.6163 + if(removeQueue.length > 0){ 1.6164 + for(var i = 0, len = removeQueue.length; i < len; i++){ 1.6165 + tasks.remove(removeQueue[i]); 1.6166 + } 1.6167 + removeQueue = []; 1.6168 + if(tasks.length < 1){ 1.6169 + stopThread(); 1.6170 + return; 1.6171 + } 1.6172 + } 1.6173 + var now = new Date().getTime(); 1.6174 + for(var i = 0, len = tasks.length; i < len; ++i){ 1.6175 + var t = tasks[i]; 1.6176 + var itime = now - t.taskRunTime; 1.6177 + if(t.interval <= itime){ 1.6178 + var rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]); 1.6179 + t.taskRunTime = now; 1.6180 + if(rt === false || t.taskRunCount === t.repeat){ 1.6181 + removeTask(t); 1.6182 + return; 1.6183 + } 1.6184 + } 1.6185 + if(t.duration && t.duration <= (now - t.taskStartTime)){ 1.6186 + removeTask(t); 1.6187 + } 1.6188 + } 1.6189 + }; 1.6190 + 1.6191 + 1.6192 + this.start = function(task){ 1.6193 + tasks.push(task); 1.6194 + task.taskStartTime = new Date().getTime(); 1.6195 + task.taskRunTime = 0; 1.6196 + task.taskRunCount = 0; 1.6197 + startThread(); 1.6198 + return task; 1.6199 + }; 1.6200 + 1.6201 + 1.6202 + this.stop = function(task){ 1.6203 + removeTask(task); 1.6204 + return task; 1.6205 + }; 1.6206 + 1.6207 + 1.6208 + this.stopAll = function(){ 1.6209 + stopThread(); 1.6210 + for(var i = 0, len = tasks.length; i < len; i++){ 1.6211 + if(tasks[i].onStop){ 1.6212 + tasks[i].onStop(); 1.6213 + } 1.6214 + } 1.6215 + tasks = []; 1.6216 + removeQueue = []; 1.6217 + }; 1.6218 +}; 1.6219 + 1.6220 + 1.6221 +Ext.TaskMgr = new Ext.util.TaskRunner(); 1.6222 + 1.6223 +Ext.util.MixedCollection = function(allowFunctions, keyFn){ 1.6224 + this.items = []; 1.6225 + this.map = {}; 1.6226 + this.keys = []; 1.6227 + this.length = 0; 1.6228 + this.addEvents( 1.6229 + 1.6230 + "clear", 1.6231 + 1.6232 + "add", 1.6233 + 1.6234 + "replace", 1.6235 + 1.6236 + "remove", 1.6237 + "sort" 1.6238 + ); 1.6239 + this.allowFunctions = allowFunctions === true; 1.6240 + if(keyFn){ 1.6241 + this.getKey = keyFn; 1.6242 + } 1.6243 + Ext.util.MixedCollection.superclass.constructor.call(this); 1.6244 +}; 1.6245 + 1.6246 +Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, { 1.6247 + allowFunctions : false, 1.6248 + 1.6249 + 1.6250 + add : function(key, o){ 1.6251 + if(arguments.length == 1){ 1.6252 + o = arguments[0]; 1.6253 + key = this.getKey(o); 1.6254 + } 1.6255 + if(typeof key == "undefined" || key === null){ 1.6256 + this.length++; 1.6257 + this.items.push(o); 1.6258 + this.keys.push(null); 1.6259 + }else{ 1.6260 + var old = this.map[key]; 1.6261 + if(old){ 1.6262 + return this.replace(key, o); 1.6263 + } 1.6264 + this.length++; 1.6265 + this.items.push(o); 1.6266 + this.map[key] = o; 1.6267 + this.keys.push(key); 1.6268 + } 1.6269 + this.fireEvent("add", this.length-1, o, key); 1.6270 + return o; 1.6271 + }, 1.6272 + 1.6273 + 1.6274 + getKey : function(o){ 1.6275 + return o.id; 1.6276 + }, 1.6277 + 1.6278 + 1.6279 + replace : function(key, o){ 1.6280 + if(arguments.length == 1){ 1.6281 + o = arguments[0]; 1.6282 + key = this.getKey(o); 1.6283 + } 1.6284 + var old = this.item(key); 1.6285 + if(typeof key == "undefined" || key === null || typeof old == "undefined"){ 1.6286 + return this.add(key, o); 1.6287 + } 1.6288 + var index = this.indexOfKey(key); 1.6289 + this.items[index] = o; 1.6290 + this.map[key] = o; 1.6291 + this.fireEvent("replace", key, old, o); 1.6292 + return o; 1.6293 + }, 1.6294 + 1.6295 + 1.6296 + addAll : function(objs){ 1.6297 + if(arguments.length > 1 || Ext.isArray(objs)){ 1.6298 + var args = arguments.length > 1 ? arguments : objs; 1.6299 + for(var i = 0, len = args.length; i < len; i++){ 1.6300 + this.add(args[i]); 1.6301 + } 1.6302 + }else{ 1.6303 + for(var key in objs){ 1.6304 + if(this.allowFunctions || typeof objs[key] != "function"){ 1.6305 + this.add(key, objs[key]); 1.6306 + } 1.6307 + } 1.6308 + } 1.6309 + }, 1.6310 + 1.6311 + 1.6312 + each : function(fn, scope){ 1.6313 + var items = [].concat(this.items); 1.6314 + for(var i = 0, len = items.length; i < len; i++){ 1.6315 + if(fn.call(scope || items[i], items[i], i, len) === false){ 1.6316 + break; 1.6317 + } 1.6318 + } 1.6319 + }, 1.6320 + 1.6321 + 1.6322 + eachKey : function(fn, scope){ 1.6323 + for(var i = 0, len = this.keys.length; i < len; i++){ 1.6324 + fn.call(scope || window, this.keys[i], this.items[i], i, len); 1.6325 + } 1.6326 + }, 1.6327 + 1.6328 + 1.6329 + find : function(fn, scope){ 1.6330 + for(var i = 0, len = this.items.length; i < len; i++){ 1.6331 + if(fn.call(scope || window, this.items[i], this.keys[i])){ 1.6332 + return this.items[i]; 1.6333 + } 1.6334 + } 1.6335 + return null; 1.6336 + }, 1.6337 + 1.6338 + 1.6339 + insert : function(index, key, o){ 1.6340 + if(arguments.length == 2){ 1.6341 + o = arguments[1]; 1.6342 + key = this.getKey(o); 1.6343 + } 1.6344 + if(index >= this.length){ 1.6345 + return this.add(key, o); 1.6346 + } 1.6347 + this.length++; 1.6348 + this.items.splice(index, 0, o); 1.6349 + if(typeof key != "undefined" && key != null){ 1.6350 + this.map[key] = o; 1.6351 + } 1.6352 + this.keys.splice(index, 0, key); 1.6353 + this.fireEvent("add", index, o, key); 1.6354 + return o; 1.6355 + }, 1.6356 + 1.6357 + 1.6358 + remove : function(o){ 1.6359 + return this.removeAt(this.indexOf(o)); 1.6360 + }, 1.6361 + 1.6362 + 1.6363 + removeAt : function(index){ 1.6364 + if(index < this.length && index >= 0){ 1.6365 + this.length--; 1.6366 + var o = this.items[index]; 1.6367 + this.items.splice(index, 1); 1.6368 + var key = this.keys[index]; 1.6369 + if(typeof key != "undefined"){ 1.6370 + delete this.map[key]; 1.6371 + } 1.6372 + this.keys.splice(index, 1); 1.6373 + this.fireEvent("remove", o, key); 1.6374 + return o; 1.6375 + } 1.6376 + return false; 1.6377 + }, 1.6378 + 1.6379 + 1.6380 + removeKey : function(key){ 1.6381 + return this.removeAt(this.indexOfKey(key)); 1.6382 + }, 1.6383 + 1.6384 + 1.6385 + getCount : function(){ 1.6386 + return this.length; 1.6387 + }, 1.6388 + 1.6389 + 1.6390 + indexOf : function(o){ 1.6391 + return this.items.indexOf(o); 1.6392 + }, 1.6393 + 1.6394 + 1.6395 + indexOfKey : function(key){ 1.6396 + return this.keys.indexOf(key); 1.6397 + }, 1.6398 + 1.6399 + 1.6400 + item : function(key){ 1.6401 + var item = typeof this.map[key] != "undefined" ? this.map[key] : this.items[key]; 1.6402 + return typeof item != 'function' || this.allowFunctions ? item : null; 1.6403 + }, 1.6404 + 1.6405 + 1.6406 + itemAt : function(index){ 1.6407 + return this.items[index]; 1.6408 + }, 1.6409 + 1.6410 + 1.6411 + key : function(key){ 1.6412 + return this.map[key]; 1.6413 + }, 1.6414 + 1.6415 + 1.6416 + contains : function(o){ 1.6417 + return this.indexOf(o) != -1; 1.6418 + }, 1.6419 + 1.6420 + 1.6421 + containsKey : function(key){ 1.6422 + return typeof this.map[key] != "undefined"; 1.6423 + }, 1.6424 + 1.6425 + 1.6426 + clear : function(){ 1.6427 + this.length = 0; 1.6428 + this.items = []; 1.6429 + this.keys = []; 1.6430 + this.map = {}; 1.6431 + this.fireEvent("clear"); 1.6432 + }, 1.6433 + 1.6434 + 1.6435 + first : function(){ 1.6436 + return this.items[0]; 1.6437 + }, 1.6438 + 1.6439 + 1.6440 + last : function(){ 1.6441 + return this.items[this.length-1]; 1.6442 + }, 1.6443 + 1.6444 + 1.6445 + _sort : function(property, dir, fn){ 1.6446 + var dsc = String(dir).toUpperCase() == "DESC" ? -1 : 1; 1.6447 + fn = fn || function(a, b){ 1.6448 + return a-b; 1.6449 + }; 1.6450 + var c = [], k = this.keys, items = this.items; 1.6451 + for(var i = 0, len = items.length; i < len; i++){ 1.6452 + c[c.length] = {key: k[i], value: items[i], index: i}; 1.6453 + } 1.6454 + c.sort(function(a, b){ 1.6455 + var v = fn(a[property], b[property]) * dsc; 1.6456 + if(v == 0){ 1.6457 + v = (a.index < b.index ? -1 : 1); 1.6458 + } 1.6459 + return v; 1.6460 + }); 1.6461 + for(var i = 0, len = c.length; i < len; i++){ 1.6462 + items[i] = c[i].value; 1.6463 + k[i] = c[i].key; 1.6464 + } 1.6465 + this.fireEvent("sort", this); 1.6466 + }, 1.6467 + 1.6468 + 1.6469 + sort : function(dir, fn){ 1.6470 + this._sort("value", dir, fn); 1.6471 + }, 1.6472 + 1.6473 + 1.6474 + keySort : function(dir, fn){ 1.6475 + this._sort("key", dir, fn || function(a, b){ 1.6476 + return String(a).toUpperCase()-String(b).toUpperCase(); 1.6477 + }); 1.6478 + }, 1.6479 + 1.6480 + 1.6481 + getRange : function(start, end){ 1.6482 + var items = this.items; 1.6483 + if(items.length < 1){ 1.6484 + return []; 1.6485 + } 1.6486 + start = start || 0; 1.6487 + end = Math.min(typeof end == "undefined" ? this.length-1 : end, this.length-1); 1.6488 + var r = []; 1.6489 + if(start <= end){ 1.6490 + for(var i = start; i <= end; i++) { 1.6491 + r[r.length] = items[i]; 1.6492 + } 1.6493 + }else{ 1.6494 + for(var i = start; i >= end; i--) { 1.6495 + r[r.length] = items[i]; 1.6496 + } 1.6497 + } 1.6498 + return r; 1.6499 + }, 1.6500 + 1.6501 + 1.6502 + filter : function(property, value, anyMatch, caseSensitive){ 1.6503 + if(Ext.isEmpty(value, false)){ 1.6504 + return this.clone(); 1.6505 + } 1.6506 + value = this.createValueMatcher(value, anyMatch, caseSensitive); 1.6507 + return this.filterBy(function(o){ 1.6508 + return o && value.test(o[property]); 1.6509 + }); 1.6510 + }, 1.6511 + 1.6512 + 1.6513 + filterBy : function(fn, scope){ 1.6514 + var r = new Ext.util.MixedCollection(); 1.6515 + r.getKey = this.getKey; 1.6516 + var k = this.keys, it = this.items; 1.6517 + for(var i = 0, len = it.length; i < len; i++){ 1.6518 + if(fn.call(scope||this, it[i], k[i])){ 1.6519 + r.add(k[i], it[i]); 1.6520 + } 1.6521 + } 1.6522 + return r; 1.6523 + }, 1.6524 + 1.6525 + 1.6526 + findIndex : function(property, value, start, anyMatch, caseSensitive){ 1.6527 + if(Ext.isEmpty(value, false)){ 1.6528 + return -1; 1.6529 + } 1.6530 + value = this.createValueMatcher(value, anyMatch, caseSensitive); 1.6531 + return this.findIndexBy(function(o){ 1.6532 + return o && value.test(o[property]); 1.6533 + }, null, start); 1.6534 + }, 1.6535 + 1.6536 + 1.6537 + findIndexBy : function(fn, scope, start){ 1.6538 + var k = this.keys, it = this.items; 1.6539 + for(var i = (start||0), len = it.length; i < len; i++){ 1.6540 + if(fn.call(scope||this, it[i], k[i])){ 1.6541 + return i; 1.6542 + } 1.6543 + } 1.6544 + if(typeof start == 'number' && start > 0){ 1.6545 + for(var i = 0; i < start; i++){ 1.6546 + if(fn.call(scope||this, it[i], k[i])){ 1.6547 + return i; 1.6548 + } 1.6549 + } 1.6550 + } 1.6551 + return -1; 1.6552 + }, 1.6553 + 1.6554 + 1.6555 + createValueMatcher : function(value, anyMatch, caseSensitive){ 1.6556 + if(!value.exec){ 1.6557 + value = String(value); 1.6558 + value = new RegExp((anyMatch === true ? '' : '^') + Ext.escapeRe(value), caseSensitive ? '' : 'i'); 1.6559 + } 1.6560 + return value; 1.6561 + }, 1.6562 + 1.6563 + 1.6564 + clone : function(){ 1.6565 + var r = new Ext.util.MixedCollection(); 1.6566 + var k = this.keys, it = this.items; 1.6567 + for(var i = 0, len = it.length; i < len; i++){ 1.6568 + r.add(k[i], it[i]); 1.6569 + } 1.6570 + r.getKey = this.getKey; 1.6571 + return r; 1.6572 + } 1.6573 +}); 1.6574 + 1.6575 +Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item; 1.6576 + 1.6577 +Ext.util.JSON = new (function(){ 1.6578 + var useHasOwn = !!{}.hasOwnProperty; 1.6579 + 1.6580 + 1.6581 + var pad = function(n) { 1.6582 + return n < 10 ? "0" + n : n; 1.6583 + }; 1.6584 + 1.6585 + var m = { 1.6586 + "\b": '\\b', 1.6587 + "\t": '\\t', 1.6588 + "\n": '\\n', 1.6589 + "\f": '\\f', 1.6590 + "\r": '\\r', 1.6591 + '"' : '\\"', 1.6592 + "\\": '\\\\' 1.6593 + }; 1.6594 + 1.6595 + var encodeString = function(s){ 1.6596 + if (/["\\\x00-\x1f]/.test(s)) { 1.6597 + return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) { 1.6598 + var c = m[b]; 1.6599 + if(c){ 1.6600 + return c; 1.6601 + } 1.6602 + c = b.charCodeAt(); 1.6603 + return "\\u00" + 1.6604 + Math.floor(c / 16).toString(16) + 1.6605 + (c % 16).toString(16); 1.6606 + }) + '"'; 1.6607 + } 1.6608 + return '"' + s + '"'; 1.6609 + }; 1.6610 + 1.6611 + var encodeArray = function(o){ 1.6612 + var a = ["["], b, i, l = o.length, v; 1.6613 + for (i = 0; i < l; i += 1) { 1.6614 + v = o[i]; 1.6615 + switch (typeof v) { 1.6616 + case "undefined": 1.6617 + case "function": 1.6618 + case "unknown": 1.6619 + break; 1.6620 + default: 1.6621 + if (b) { 1.6622 + a.push(','); 1.6623 + } 1.6624 + a.push(v === null ? "null" : Ext.util.JSON.encode(v)); 1.6625 + b = true; 1.6626 + } 1.6627 + } 1.6628 + a.push("]"); 1.6629 + return a.join(""); 1.6630 + }; 1.6631 + 1.6632 + this.encodeDate = function(o){ 1.6633 + return '"' + o.getFullYear() + "-" + 1.6634 + pad(o.getMonth() + 1) + "-" + 1.6635 + pad(o.getDate()) + "T" + 1.6636 + pad(o.getHours()) + ":" + 1.6637 + pad(o.getMinutes()) + ":" + 1.6638 + pad(o.getSeconds()) + '"'; 1.6639 + }; 1.6640 + 1.6641 + 1.6642 + this.encode = function(o){ 1.6643 + if(typeof o == "undefined" || o === null){ 1.6644 + return "null"; 1.6645 + }else if(Ext.isArray(o)){ 1.6646 + return encodeArray(o); 1.6647 + }else if(Ext.isDate(o)){ 1.6648 + return Ext.util.JSON.encodeDate(o); 1.6649 + }else if(typeof o == "string"){ 1.6650 + return encodeString(o); 1.6651 + }else if(typeof o == "number"){ 1.6652 + return isFinite(o) ? String(o) : "null"; 1.6653 + }else if(typeof o == "boolean"){ 1.6654 + return String(o); 1.6655 + }else { 1.6656 + var a = ["{"], b, i, v; 1.6657 + for (i in o) { 1.6658 + if(!useHasOwn || o.hasOwnProperty(i)) { 1.6659 + v = o[i]; 1.6660 + switch (typeof v) { 1.6661 + case "undefined": 1.6662 + case "function": 1.6663 + case "unknown": 1.6664 + break; 1.6665 + default: 1.6666 + if(b){ 1.6667 + a.push(','); 1.6668 + } 1.6669 + a.push(this.encode(i), ":", 1.6670 + v === null ? "null" : this.encode(v)); 1.6671 + b = true; 1.6672 + } 1.6673 + } 1.6674 + } 1.6675 + a.push("}"); 1.6676 + return a.join(""); 1.6677 + } 1.6678 + }; 1.6679 + 1.6680 + 1.6681 + this.decode = function(json){ 1.6682 + return eval("(" + json + ')'); 1.6683 + }; 1.6684 +})(); 1.6685 + 1.6686 +Ext.encode = Ext.util.JSON.encode; 1.6687 + 1.6688 +Ext.decode = Ext.util.JSON.decode; 1.6689 + 1.6690 + 1.6691 +Ext.util.Format = function(){ 1.6692 + var trimRe = /^\s+|\s+$/g; 1.6693 + return { 1.6694 + 1.6695 + ellipsis : function(value, len){ 1.6696 + if(value && value.length > len){ 1.6697 + return value.substr(0, len-3)+"..."; 1.6698 + } 1.6699 + return value; 1.6700 + }, 1.6701 + 1.6702 + 1.6703 + undef : function(value){ 1.6704 + return value !== undefined ? value : ""; 1.6705 + }, 1.6706 + 1.6707 + 1.6708 + defaultValue : function(value, defaultValue){ 1.6709 + return value !== undefined && value !== '' ? value : defaultValue; 1.6710 + }, 1.6711 + 1.6712 + 1.6713 + htmlEncode : function(value){ 1.6714 + return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """); 1.6715 + }, 1.6716 + 1.6717 + 1.6718 + htmlDecode : function(value){ 1.6719 + return !value ? value : String(value).replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"'); 1.6720 + }, 1.6721 + 1.6722 + 1.6723 + trim : function(value){ 1.6724 + return String(value).replace(trimRe, ""); 1.6725 + }, 1.6726 + 1.6727 + 1.6728 + substr : function(value, start, length){ 1.6729 + return String(value).substr(start, length); 1.6730 + }, 1.6731 + 1.6732 + 1.6733 + lowercase : function(value){ 1.6734 + return String(value).toLowerCase(); 1.6735 + }, 1.6736 + 1.6737 + 1.6738 + uppercase : function(value){ 1.6739 + return String(value).toUpperCase(); 1.6740 + }, 1.6741 + 1.6742 + 1.6743 + capitalize : function(value){ 1.6744 + return !value ? value : value.charAt(0).toUpperCase() + value.substr(1).toLowerCase(); 1.6745 + }, 1.6746 + 1.6747 + 1.6748 + call : function(value, fn){ 1.6749 + if(arguments.length > 2){ 1.6750 + var args = Array.prototype.slice.call(arguments, 2); 1.6751 + args.unshift(value); 1.6752 + return eval(fn).apply(window, args); 1.6753 + }else{ 1.6754 + return eval(fn).call(window, value); 1.6755 + } 1.6756 + }, 1.6757 + 1.6758 + 1.6759 + usMoney : function(v){ 1.6760 + v = (Math.round((v-0)*100))/100; 1.6761 + v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v); 1.6762 + v = String(v); 1.6763 + var ps = v.split('.'); 1.6764 + var whole = ps[0]; 1.6765 + var sub = ps[1] ? '.'+ ps[1] : '.00'; 1.6766 + var r = /(\d+)(\d{3})/; 1.6767 + while (r.test(whole)) { 1.6768 + whole = whole.replace(r, '$1' + ',' + '$2'); 1.6769 + } 1.6770 + v = whole + sub; 1.6771 + if(v.charAt(0) == '-'){ 1.6772 + return '-$' + v.substr(1); 1.6773 + } 1.6774 + return "$" + v; 1.6775 + }, 1.6776 + 1.6777 + 1.6778 + date : function(v, format){ 1.6779 + if(!v){ 1.6780 + return ""; 1.6781 + } 1.6782 + if(!Ext.isDate(v)){ 1.6783 + v = new Date(Date.parse(v)); 1.6784 + } 1.6785 + return v.dateFormat(format || "m/d/Y"); 1.6786 + }, 1.6787 + 1.6788 + 1.6789 + dateRenderer : function(format){ 1.6790 + return function(v){ 1.6791 + return Ext.util.Format.date(v, format); 1.6792 + }; 1.6793 + }, 1.6794 + 1.6795 + 1.6796 + stripTagsRE : /<\/?[^>]+>/gi, 1.6797 + 1.6798 + 1.6799 + stripTags : function(v){ 1.6800 + return !v ? v : String(v).replace(this.stripTagsRE, ""); 1.6801 + }, 1.6802 + 1.6803 + stripScriptsRe : /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, 1.6804 + 1.6805 + 1.6806 + stripScripts : function(v){ 1.6807 + return !v ? v : String(v).replace(this.stripScriptsRe, ""); 1.6808 + }, 1.6809 + 1.6810 + 1.6811 + fileSize : function(size){ 1.6812 + if(size < 1024) { 1.6813 + return size + " bytes"; 1.6814 + } else if(size < 1048576) { 1.6815 + return (Math.round(((size*10) / 1024))/10) + " KB"; 1.6816 + } else { 1.6817 + return (Math.round(((size*10) / 1048576))/10) + " MB"; 1.6818 + } 1.6819 + }, 1.6820 + 1.6821 + math : function(){ 1.6822 + var fns = {}; 1.6823 + return function(v, a){ 1.6824 + if(!fns[a]){ 1.6825 + fns[a] = new Function('v', 'return v ' + a + ';'); 1.6826 + } 1.6827 + return fns[a](v); 1.6828 + } 1.6829 + }() 1.6830 + }; 1.6831 +}(); 1.6832 + 1.6833 +Ext.XTemplate = function(){ 1.6834 + Ext.XTemplate.superclass.constructor.apply(this, arguments); 1.6835 + var s = this.html; 1.6836 + 1.6837 + s = ['<tpl>', s, '</tpl>'].join(''); 1.6838 + 1.6839 + var re = /<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/; 1.6840 + 1.6841 + var nameRe = /^<tpl\b[^>]*?for="(.*?)"/; 1.6842 + var ifRe = /^<tpl\b[^>]*?if="(.*?)"/; 1.6843 + var execRe = /^<tpl\b[^>]*?exec="(.*?)"/; 1.6844 + var m, id = 0; 1.6845 + var tpls = []; 1.6846 + 1.6847 + while(m = s.match(re)){ 1.6848 + var m2 = m[0].match(nameRe); 1.6849 + var m3 = m[0].match(ifRe); 1.6850 + var m4 = m[0].match(execRe); 1.6851 + var exp = null, fn = null, exec = null; 1.6852 + var name = m2 && m2[1] ? m2[1] : ''; 1.6853 + if(m3){ 1.6854 + exp = m3 && m3[1] ? m3[1] : null; 1.6855 + if(exp){ 1.6856 + fn = new Function('values', 'parent', 'xindex', 'xcount', 'with(values){ return '+(Ext.util.Format.htmlDecode(exp))+'; }'); 1.6857 + } 1.6858 + } 1.6859 + if(m4){ 1.6860 + exp = m4 && m4[1] ? m4[1] : null; 1.6861 + if(exp){ 1.6862 + exec = new Function('values', 'parent', 'xindex', 'xcount', 'with(values){ '+(Ext.util.Format.htmlDecode(exp))+'; }'); 1.6863 + } 1.6864 + } 1.6865 + if(name){ 1.6866 + switch(name){ 1.6867 + case '.': name = new Function('values', 'parent', 'with(values){ return values; }'); break; 1.6868 + case '..': name = new Function('values', 'parent', 'with(values){ return parent; }'); break; 1.6869 + default: name = new Function('values', 'parent', 'with(values){ return '+name+'; }'); 1.6870 + } 1.6871 + } 1.6872 + tpls.push({ 1.6873 + id: id, 1.6874 + target: name, 1.6875 + exec: exec, 1.6876 + test: fn, 1.6877 + body: m[1]||'' 1.6878 + }); 1.6879 + s = s.replace(m[0], '{xtpl'+ id + '}'); 1.6880 + ++id; 1.6881 + } 1.6882 + for(var i = tpls.length-1; i >= 0; --i){ 1.6883 + this.compileTpl(tpls[i]); 1.6884 + } 1.6885 + this.master = tpls[tpls.length-1]; 1.6886 + this.tpls = tpls; 1.6887 +}; 1.6888 +Ext.extend(Ext.XTemplate, Ext.Template, { 1.6889 + re : /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g, 1.6890 + codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g, 1.6891 + 1.6892 + applySubTemplate : function(id, values, parent, xindex, xcount){ 1.6893 + var t = this.tpls[id]; 1.6894 + if(t.test && !t.test.call(this, values, parent, xindex, xcount)){ 1.6895 + return ''; 1.6896 + } 1.6897 + if(t.exec && t.exec.call(this, values, parent, xindex, xcount)){ 1.6898 + return ''; 1.6899 + } 1.6900 + var vs = t.target ? t.target.call(this, values, parent) : values; 1.6901 + parent = t.target ? values : parent; 1.6902 + if(t.target && Ext.isArray(vs)){ 1.6903 + var buf = []; 1.6904 + for(var i = 0, len = vs.length; i < len; i++){ 1.6905 + buf[buf.length] = t.compiled.call(this, vs[i], parent, i+1, len); 1.6906 + } 1.6907 + return buf.join(''); 1.6908 + } 1.6909 + return t.compiled.call(this, vs, parent, xindex, xcount); 1.6910 + }, 1.6911 + 1.6912 + compileTpl : function(tpl){ 1.6913 + var fm = Ext.util.Format; 1.6914 + var useF = this.disableFormats !== true; 1.6915 + var sep = Ext.isGecko ? "+" : ","; 1.6916 + var fn = function(m, name, format, args, math){ 1.6917 + if(name.substr(0, 4) == 'xtpl'){ 1.6918 + return "'"+ sep +'this.applySubTemplate('+name.substr(4)+', values, parent, xindex, xcount)'+sep+"'"; 1.6919 + } 1.6920 + var v; 1.6921 + if(name === '.'){ 1.6922 + v = 'values'; 1.6923 + }else if(name === '#'){ 1.6924 + v = 'xindex'; 1.6925 + }else if(name.indexOf('.') != -1){ 1.6926 + v = name; 1.6927 + }else{ 1.6928 + v = "values['" + name + "']"; 1.6929 + } 1.6930 + if(math){ 1.6931 + v = '(' + v + math + ')'; 1.6932 + } 1.6933 + if(format && useF){ 1.6934 + args = args ? ',' + args : ""; 1.6935 + if(format.substr(0, 5) != "this."){ 1.6936 + format = "fm." + format + '('; 1.6937 + }else{ 1.6938 + format = 'this.call("'+ format.substr(5) + '", '; 1.6939 + args = ", values"; 1.6940 + } 1.6941 + }else{ 1.6942 + args= ''; format = "("+v+" === undefined ? '' : "; 1.6943 + } 1.6944 + return "'"+ sep + format + v + args + ")"+sep+"'"; 1.6945 + }; 1.6946 + var codeFn = function(m, code){ 1.6947 + return "'"+ sep +'('+code+')'+sep+"'"; 1.6948 + }; 1.6949 + 1.6950 + var body; 1.6951 + if(Ext.isGecko){ 1.6952 + body = "tpl.compiled = function(values, parent, xindex, xcount){ return '" + 1.6953 + tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn) + 1.6954 + "';};"; 1.6955 + }else{ 1.6956 + body = ["tpl.compiled = function(values, parent, xindex, xcount){ return ['"]; 1.6957 + body.push(tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn)); 1.6958 + body.push("'].join('');};"); 1.6959 + body = body.join(''); 1.6960 + } 1.6961 + eval(body); 1.6962 + return this; 1.6963 + }, 1.6964 + 1.6965 + 1.6966 + applyTemplate : function(values){ 1.6967 + return this.master.compiled.call(this, values, {}, 1, 1); 1.6968 + }, 1.6969 + 1.6970 + 1.6971 + compile : function(){return this;} 1.6972 + 1.6973 + 1.6974 + 1.6975 + 1.6976 + 1.6977 +}); 1.6978 + 1.6979 +Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate; 1.6980 + 1.6981 + 1.6982 +Ext.XTemplate.from = function(el){ 1.6983 + el = Ext.getDom(el); 1.6984 + return new Ext.XTemplate(el.value || el.innerHTML); 1.6985 +}; 1.6986 + 1.6987 +Ext.util.CSS = function(){ 1.6988 + var rules = null; 1.6989 + var doc = document; 1.6990 + 1.6991 + var camelRe = /(-[a-z])/gi; 1.6992 + var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); }; 1.6993 + 1.6994 + return { 1.6995 + 1.6996 + createStyleSheet : function(cssText, id){ 1.6997 + var ss; 1.6998 + var head = doc.getElementsByTagName("head")[0]; 1.6999 + var rules = doc.createElement("style"); 1.7000 + rules.setAttribute("type", "text/css"); 1.7001 + if(id){ 1.7002 + rules.setAttribute("id", id); 1.7003 + } 1.7004 + if(Ext.isIE){ 1.7005 + head.appendChild(rules); 1.7006 + ss = rules.styleSheet; 1.7007 + ss.cssText = cssText; 1.7008 + }else{ 1.7009 + try{ 1.7010 + rules.appendChild(doc.createTextNode(cssText)); 1.7011 + }catch(e){ 1.7012 + rules.cssText = cssText; 1.7013 + } 1.7014 + head.appendChild(rules); 1.7015 + ss = rules.styleSheet ? rules.styleSheet : (rules.sheet || doc.styleSheets[doc.styleSheets.length-1]); 1.7016 + } 1.7017 + this.cacheStyleSheet(ss); 1.7018 + return ss; 1.7019 + }, 1.7020 + 1.7021 + 1.7022 + removeStyleSheet : function(id){ 1.7023 + var existing = doc.getElementById(id); 1.7024 + if(existing){ 1.7025 + existing.parentNode.removeChild(existing); 1.7026 + } 1.7027 + }, 1.7028 + 1.7029 + 1.7030 + swapStyleSheet : function(id, url){ 1.7031 + this.removeStyleSheet(id); 1.7032 + var ss = doc.createElement("link"); 1.7033 + ss.setAttribute("rel", "stylesheet"); 1.7034 + ss.setAttribute("type", "text/css"); 1.7035 + ss.setAttribute("id", id); 1.7036 + ss.setAttribute("href", url); 1.7037 + doc.getElementsByTagName("head")[0].appendChild(ss); 1.7038 + }, 1.7039 + 1.7040 + 1.7041 + refreshCache : function(){ 1.7042 + return this.getRules(true); 1.7043 + }, 1.7044 + 1.7045 + 1.7046 + cacheStyleSheet : function(ss){ 1.7047 + if(!rules){ 1.7048 + rules = {}; 1.7049 + } 1.7050 + try{ 1.7051 + var ssRules = ss.cssRules || ss.rules; 1.7052 + for(var j = ssRules.length-1; j >= 0; --j){ 1.7053 + rules[ssRules[j].selectorText] = ssRules[j]; 1.7054 + } 1.7055 + }catch(e){} 1.7056 + }, 1.7057 + 1.7058 + 1.7059 + getRules : function(refreshCache){ 1.7060 + if(rules == null || refreshCache){ 1.7061 + rules = {}; 1.7062 + var ds = doc.styleSheets; 1.7063 + for(var i =0, len = ds.length; i < len; i++){ 1.7064 + try{ 1.7065 + this.cacheStyleSheet(ds[i]); 1.7066 + }catch(e){} 1.7067 + } 1.7068 + } 1.7069 + return rules; 1.7070 + }, 1.7071 + 1.7072 + 1.7073 + getRule : function(selector, refreshCache){ 1.7074 + var rs = this.getRules(refreshCache); 1.7075 + if(!Ext.isArray(selector)){ 1.7076 + return rs[selector]; 1.7077 + } 1.7078 + for(var i = 0; i < selector.length; i++){ 1.7079 + if(rs[selector[i]]){ 1.7080 + return rs[selector[i]]; 1.7081 + } 1.7082 + } 1.7083 + return null; 1.7084 + }, 1.7085 + 1.7086 + 1.7087 + 1.7088 + updateRule : function(selector, property, value){ 1.7089 + if(!Ext.isArray(selector)){ 1.7090 + var rule = this.getRule(selector); 1.7091 + if(rule){ 1.7092 + rule.style[property.replace(camelRe, camelFn)] = value; 1.7093 + return true; 1.7094 + } 1.7095 + }else{ 1.7096 + for(var i = 0; i < selector.length; i++){ 1.7097 + if(this.updateRule(selector[i], property, value)){ 1.7098 + return true; 1.7099 + } 1.7100 + } 1.7101 + } 1.7102 + return false; 1.7103 + } 1.7104 + }; 1.7105 +}(); 1.7106 + 1.7107 +Ext.util.ClickRepeater = function(el, config) 1.7108 +{ 1.7109 + this.el = Ext.get(el); 1.7110 + this.el.unselectable(); 1.7111 + 1.7112 + Ext.apply(this, config); 1.7113 + 1.7114 + this.addEvents( 1.7115 + 1.7116 + "mousedown", 1.7117 + 1.7118 + "click", 1.7119 + 1.7120 + "mouseup" 1.7121 + ); 1.7122 + 1.7123 + this.el.on("mousedown", this.handleMouseDown, this); 1.7124 + if(this.preventDefault || this.stopDefault){ 1.7125 + this.el.on("click", function(e){ 1.7126 + if(this.preventDefault){ 1.7127 + e.preventDefault(); 1.7128 + } 1.7129 + if(this.stopDefault){ 1.7130 + e.stopEvent(); 1.7131 + } 1.7132 + }, this); 1.7133 + } 1.7134 + 1.7135 + if(this.handler){ 1.7136 + this.on("click", this.handler, this.scope || this); 1.7137 + } 1.7138 + 1.7139 + Ext.util.ClickRepeater.superclass.constructor.call(this); 1.7140 +}; 1.7141 + 1.7142 +Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, { 1.7143 + interval : 20, 1.7144 + delay: 250, 1.7145 + preventDefault : true, 1.7146 + stopDefault : false, 1.7147 + timer : 0, 1.7148 + 1.7149 + handleMouseDown : function(){ 1.7150 + clearTimeout(this.timer); 1.7151 + this.el.blur(); 1.7152 + if(this.pressClass){ 1.7153 + this.el.addClass(this.pressClass); 1.7154 + } 1.7155 + this.mousedownTime = new Date(); 1.7156 + 1.7157 + Ext.getDoc().on("mouseup", this.handleMouseUp, this); 1.7158 + this.el.on("mouseout", this.handleMouseOut, this); 1.7159 + 1.7160 + this.fireEvent("mousedown", this); 1.7161 + this.fireEvent("click", this); 1.7162 + 1.7163 + if (this.accelerate) { 1.7164 + this.delay = 400; 1.7165 + } 1.7166 + this.timer = this.click.defer(this.delay || this.interval, this); 1.7167 + }, 1.7168 + 1.7169 + click : function(){ 1.7170 + this.fireEvent("click", this); 1.7171 + this.timer = this.click.defer(this.accelerate ? 1.7172 + this.easeOutExpo(this.mousedownTime.getElapsed(), 1.7173 + 400, 1.7174 + -390, 1.7175 + 12000) : 1.7176 + this.interval, this); 1.7177 + }, 1.7178 + 1.7179 + easeOutExpo : function (t, b, c, d) { 1.7180 + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 1.7181 + }, 1.7182 + 1.7183 + handleMouseOut : function(){ 1.7184 + clearTimeout(this.timer); 1.7185 + if(this.pressClass){ 1.7186 + this.el.removeClass(this.pressClass); 1.7187 + } 1.7188 + this.el.on("mouseover", this.handleMouseReturn, this); 1.7189 + }, 1.7190 + 1.7191 + handleMouseReturn : function(){ 1.7192 + this.el.un("mouseover", this.handleMouseReturn); 1.7193 + if(this.pressClass){ 1.7194 + this.el.addClass(this.pressClass); 1.7195 + } 1.7196 + this.click(); 1.7197 + }, 1.7198 + 1.7199 + handleMouseUp : function(){ 1.7200 + clearTimeout(this.timer); 1.7201 + this.el.un("mouseover", this.handleMouseReturn); 1.7202 + this.el.un("mouseout", this.handleMouseOut); 1.7203 + Ext.getDoc().un("mouseup", this.handleMouseUp); 1.7204 + this.el.removeClass(this.pressClass); 1.7205 + this.fireEvent("mouseup", this); 1.7206 + } 1.7207 +}); 1.7208 + 1.7209 +Ext.KeyNav = function(el, config){ 1.7210 + this.el = Ext.get(el); 1.7211 + Ext.apply(this, config); 1.7212 + if(!this.disabled){ 1.7213 + this.disabled = true; 1.7214 + this.enable(); 1.7215 + } 1.7216 +}; 1.7217 + 1.7218 +Ext.KeyNav.prototype = { 1.7219 + 1.7220 + disabled : false, 1.7221 + 1.7222 + defaultEventAction: "stopEvent", 1.7223 + 1.7224 + forceKeyDown : false, 1.7225 + 1.7226 + prepareEvent : function(e){ 1.7227 + var k = e.getKey(); 1.7228 + var h = this.keyToHandler[k]; 1.7229 + if(Ext.isSafari2 && h && k >= 37 && k <= 40){ 1.7230 + e.stopEvent(); 1.7231 + } 1.7232 + }, 1.7233 + 1.7234 + relay : function(e){ 1.7235 + var k = e.getKey(); 1.7236 + var h = this.keyToHandler[k]; 1.7237 + if(h && this[h]){ 1.7238 + if(this.doRelay(e, this[h], h) !== true){ 1.7239 + e[this.defaultEventAction](); 1.7240 + } 1.7241 + } 1.7242 + }, 1.7243 + 1.7244 + doRelay : function(e, h, hname){ 1.7245 + return h.call(this.scope || this, e); 1.7246 + }, 1.7247 + 1.7248 + enter : false, 1.7249 + left : false, 1.7250 + right : false, 1.7251 + up : false, 1.7252 + down : false, 1.7253 + tab : false, 1.7254 + esc : false, 1.7255 + pageUp : false, 1.7256 + pageDown : false, 1.7257 + del : false, 1.7258 + home : false, 1.7259 + end : false, 1.7260 + 1.7261 + keyToHandler : { 1.7262 + 37 : "left", 1.7263 + 39 : "right", 1.7264 + 38 : "up", 1.7265 + 40 : "down", 1.7266 + 33 : "pageUp", 1.7267 + 34 : "pageDown", 1.7268 + 46 : "del", 1.7269 + 36 : "home", 1.7270 + 35 : "end", 1.7271 + 13 : "enter", 1.7272 + 27 : "esc", 1.7273 + 9 : "tab" 1.7274 + }, 1.7275 + 1.7276 + 1.7277 + enable: function(){ 1.7278 + if(this.disabled){ 1.7279 + if(this.forceKeyDown || Ext.isIE || Ext.isSafari3 || Ext.isAir){ 1.7280 + this.el.on("keydown", this.relay, this); 1.7281 + }else{ 1.7282 + this.el.on("keydown", this.prepareEvent, this); 1.7283 + this.el.on("keypress", this.relay, this); 1.7284 + } 1.7285 + this.disabled = false; 1.7286 + } 1.7287 + }, 1.7288 + 1.7289 + 1.7290 + disable: function(){ 1.7291 + if(!this.disabled){ 1.7292 + if(this.forceKeyDown || Ext.isIE || Ext.isSafari3 || Ext.isAir){ 1.7293 + this.el.un("keydown", this.relay); 1.7294 + }else{ 1.7295 + this.el.un("keydown", this.prepareEvent); 1.7296 + this.el.un("keypress", this.relay); 1.7297 + } 1.7298 + this.disabled = true; 1.7299 + } 1.7300 + } 1.7301 +}; 1.7302 + 1.7303 +Ext.KeyMap = function(el, config, eventName){ 1.7304 + this.el = Ext.get(el); 1.7305 + this.eventName = eventName || "keydown"; 1.7306 + this.bindings = []; 1.7307 + if(config){ 1.7308 + this.addBinding(config); 1.7309 + } 1.7310 + this.enable(); 1.7311 +}; 1.7312 + 1.7313 +Ext.KeyMap.prototype = { 1.7314 + 1.7315 + stopEvent : false, 1.7316 + 1.7317 + 1.7318 + addBinding : function(config){ 1.7319 + if(Ext.isArray(config)){ 1.7320 + for(var i = 0, len = config.length; i < len; i++){ 1.7321 + this.addBinding(config[i]); 1.7322 + } 1.7323 + return; 1.7324 + } 1.7325 + var keyCode = config.key, 1.7326 + shift = config.shift, 1.7327 + ctrl = config.ctrl, 1.7328 + alt = config.alt, 1.7329 + fn = config.fn || config.handler, 1.7330 + scope = config.scope; 1.7331 + 1.7332 + if(typeof keyCode == "string"){ 1.7333 + var ks = []; 1.7334 + var keyString = keyCode.toUpperCase(); 1.7335 + for(var j = 0, len = keyString.length; j < len; j++){ 1.7336 + ks.push(keyString.charCodeAt(j)); 1.7337 + } 1.7338 + keyCode = ks; 1.7339 + } 1.7340 + var keyArray = Ext.isArray(keyCode); 1.7341 + 1.7342 + var handler = function(e){ 1.7343 + if((!shift || e.shiftKey) && (!ctrl || e.ctrlKey) && (!alt || e.altKey)){ 1.7344 + var k = e.getKey(); 1.7345 + if(keyArray){ 1.7346 + for(var i = 0, len = keyCode.length; i < len; i++){ 1.7347 + if(keyCode[i] == k){ 1.7348 + if(this.stopEvent){ 1.7349 + e.stopEvent(); 1.7350 + } 1.7351 + fn.call(scope || window, k, e); 1.7352 + return; 1.7353 + } 1.7354 + } 1.7355 + }else{ 1.7356 + if(k == keyCode){ 1.7357 + if(this.stopEvent){ 1.7358 + e.stopEvent(); 1.7359 + } 1.7360 + fn.call(scope || window, k, e); 1.7361 + } 1.7362 + } 1.7363 + } 1.7364 + }; 1.7365 + this.bindings.push(handler); 1.7366 + }, 1.7367 + 1.7368 + 1.7369 + on : function(key, fn, scope){ 1.7370 + var keyCode, shift, ctrl, alt; 1.7371 + if(typeof key == "object" && !Ext.isArray(key)){ 1.7372 + keyCode = key.key; 1.7373 + shift = key.shift; 1.7374 + ctrl = key.ctrl; 1.7375 + alt = key.alt; 1.7376 + }else{ 1.7377 + keyCode = key; 1.7378 + } 1.7379 + this.addBinding({ 1.7380 + key: keyCode, 1.7381 + shift: shift, 1.7382 + ctrl: ctrl, 1.7383 + alt: alt, 1.7384 + fn: fn, 1.7385 + scope: scope 1.7386 + }) 1.7387 + }, 1.7388 + 1.7389 + 1.7390 + handleKeyDown : function(e){ 1.7391 + if(this.enabled){ 1.7392 + var b = this.bindings; 1.7393 + for(var i = 0, len = b.length; i < len; i++){ 1.7394 + b[i].call(this, e); 1.7395 + } 1.7396 + } 1.7397 + }, 1.7398 + 1.7399 + 1.7400 + isEnabled : function(){ 1.7401 + return this.enabled; 1.7402 + }, 1.7403 + 1.7404 + 1.7405 + enable: function(){ 1.7406 + if(!this.enabled){ 1.7407 + this.el.on(this.eventName, this.handleKeyDown, this); 1.7408 + this.enabled = true; 1.7409 + } 1.7410 + }, 1.7411 + 1.7412 + 1.7413 + disable: function(){ 1.7414 + if(this.enabled){ 1.7415 + this.el.removeListener(this.eventName, this.handleKeyDown, this); 1.7416 + this.enabled = false; 1.7417 + } 1.7418 + } 1.7419 +}; 1.7420 + 1.7421 +Ext.util.TextMetrics = function(){ 1.7422 + var shared; 1.7423 + return { 1.7424 + 1.7425 + measure : function(el, text, fixedWidth){ 1.7426 + if(!shared){ 1.7427 + shared = Ext.util.TextMetrics.Instance(el, fixedWidth); 1.7428 + } 1.7429 + shared.bind(el); 1.7430 + shared.setFixedWidth(fixedWidth || 'auto'); 1.7431 + return shared.getSize(text); 1.7432 + }, 1.7433 + 1.7434 + 1.7435 + createInstance : function(el, fixedWidth){ 1.7436 + return Ext.util.TextMetrics.Instance(el, fixedWidth); 1.7437 + } 1.7438 + }; 1.7439 +}(); 1.7440 + 1.7441 +Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){ 1.7442 + var ml = new Ext.Element(document.createElement('div')); 1.7443 + document.body.appendChild(ml.dom); 1.7444 + ml.position('absolute'); 1.7445 + ml.setLeftTop(-1000, -1000); 1.7446 + ml.hide(); 1.7447 + 1.7448 + if(fixedWidth){ 1.7449 + ml.setWidth(fixedWidth); 1.7450 + } 1.7451 + 1.7452 + var instance = { 1.7453 + 1.7454 + getSize : function(text){ 1.7455 + ml.update(text); 1.7456 + var s = ml.getSize(); 1.7457 + ml.update(''); 1.7458 + return s; 1.7459 + }, 1.7460 + 1.7461 + 1.7462 + bind : function(el){ 1.7463 + ml.setStyle( 1.7464 + Ext.fly(el).getStyles('font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing') 1.7465 + ); 1.7466 + }, 1.7467 + 1.7468 + 1.7469 + setFixedWidth : function(width){ 1.7470 + ml.setWidth(width); 1.7471 + }, 1.7472 + 1.7473 + 1.7474 + getWidth : function(text){ 1.7475 + ml.dom.style.width = 'auto'; 1.7476 + return this.getSize(text).width; 1.7477 + }, 1.7478 + 1.7479 + 1.7480 + getHeight : function(text){ 1.7481 + return this.getSize(text).height; 1.7482 + } 1.7483 + }; 1.7484 + 1.7485 + instance.bind(bindTo); 1.7486 + 1.7487 + return instance; 1.7488 +}; 1.7489 + 1.7490 +Ext.Element.measureText = Ext.util.TextMetrics.measure; 1.7491 + 1.7492 + 1.7493 +(function() { 1.7494 + 1.7495 +var Event=Ext.EventManager; 1.7496 +var Dom=Ext.lib.Dom; 1.7497 + 1.7498 + 1.7499 +Ext.dd.DragDrop = function(id, sGroup, config) { 1.7500 + if(id) { 1.7501 + this.init(id, sGroup, config); 1.7502 + } 1.7503 +}; 1.7504 + 1.7505 +Ext.dd.DragDrop.prototype = { 1.7506 + 1.7507 + 1.7508 + id: null, 1.7509 + 1.7510 + 1.7511 + config: null, 1.7512 + 1.7513 + 1.7514 + dragElId: null, 1.7515 + 1.7516 + 1.7517 + handleElId: null, 1.7518 + 1.7519 + 1.7520 + invalidHandleTypes: null, 1.7521 + 1.7522 + 1.7523 + invalidHandleIds: null, 1.7524 + 1.7525 + 1.7526 + invalidHandleClasses: null, 1.7527 + 1.7528 + 1.7529 + startPageX: 0, 1.7530 + 1.7531 + 1.7532 + startPageY: 0, 1.7533 + 1.7534 + 1.7535 + groups: null, 1.7536 + 1.7537 + 1.7538 + locked: false, 1.7539 + 1.7540 + 1.7541 + lock: function() { this.locked = true; }, 1.7542 + 1.7543 + 1.7544 + unlock: function() { this.locked = false; }, 1.7545 + 1.7546 + 1.7547 + isTarget: true, 1.7548 + 1.7549 + 1.7550 + padding: null, 1.7551 + 1.7552 + 1.7553 + _domRef: null, 1.7554 + 1.7555 + 1.7556 + __ygDragDrop: true, 1.7557 + 1.7558 + 1.7559 + constrainX: false, 1.7560 + 1.7561 + 1.7562 + constrainY: false, 1.7563 + 1.7564 + 1.7565 + minX: 0, 1.7566 + 1.7567 + 1.7568 + maxX: 0, 1.7569 + 1.7570 + 1.7571 + minY: 0, 1.7572 + 1.7573 + 1.7574 + maxY: 0, 1.7575 + 1.7576 + 1.7577 + maintainOffset: false, 1.7578 + 1.7579 + 1.7580 + xTicks: null, 1.7581 + 1.7582 + 1.7583 + yTicks: null, 1.7584 + 1.7585 + 1.7586 + primaryButtonOnly: true, 1.7587 + 1.7588 + 1.7589 + available: false, 1.7590 + 1.7591 + 1.7592 + hasOuterHandles: false, 1.7593 + 1.7594 + 1.7595 + b4StartDrag: function(x, y) { }, 1.7596 + 1.7597 + 1.7598 + startDrag: function(x, y) { }, 1.7599 + 1.7600 + 1.7601 + b4Drag: function(e) { }, 1.7602 + 1.7603 + 1.7604 + onDrag: function(e) { }, 1.7605 + 1.7606 + 1.7607 + onDragEnter: function(e, id) { }, 1.7608 + 1.7609 + 1.7610 + b4DragOver: function(e) { }, 1.7611 + 1.7612 + 1.7613 + onDragOver: function(e, id) { }, 1.7614 + 1.7615 + 1.7616 + b4DragOut: function(e) { }, 1.7617 + 1.7618 + 1.7619 + onDragOut: function(e, id) { }, 1.7620 + 1.7621 + 1.7622 + b4DragDrop: function(e) { }, 1.7623 + 1.7624 + 1.7625 + onDragDrop: function(e, id) { }, 1.7626 + 1.7627 + 1.7628 + onInvalidDrop: function(e) { }, 1.7629 + 1.7630 + 1.7631 + b4EndDrag: function(e) { }, 1.7632 + 1.7633 + 1.7634 + endDrag: function(e) { }, 1.7635 + 1.7636 + 1.7637 + b4MouseDown: function(e) { }, 1.7638 + 1.7639 + 1.7640 + onMouseDown: function(e) { }, 1.7641 + 1.7642 + 1.7643 + onMouseUp: function(e) { }, 1.7644 + 1.7645 + 1.7646 + onAvailable: function () { 1.7647 + }, 1.7648 + 1.7649 + 1.7650 + defaultPadding : {left:0, right:0, top:0, bottom:0}, 1.7651 + 1.7652 + 1.7653 + constrainTo : function(constrainTo, pad, inContent){ 1.7654 + if(typeof pad == "number"){ 1.7655 + pad = {left: pad, right:pad, top:pad, bottom:pad}; 1.7656 + } 1.7657 + pad = pad || this.defaultPadding; 1.7658 + var b = Ext.get(this.getEl()).getBox(); 1.7659 + var ce = Ext.get(constrainTo); 1.7660 + var s = ce.getScroll(); 1.7661 + var c, cd = ce.dom; 1.7662 + if(cd == document.body){ 1.7663 + c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()}; 1.7664 + }else{ 1.7665 + var xy = ce.getXY(); 1.7666 + c = {x : xy[0]+s.left, y: xy[1]+s.top, width: cd.clientWidth, height: cd.clientHeight}; 1.7667 + } 1.7668 + 1.7669 + 1.7670 + var topSpace = b.y - c.y; 1.7671 + var leftSpace = b.x - c.x; 1.7672 + 1.7673 + this.resetConstraints(); 1.7674 + this.setXConstraint(leftSpace - (pad.left||0), 1.7675 + c.width - leftSpace - b.width - (pad.right||0), 1.7676 + this.xTickSize 1.7677 + ); 1.7678 + this.setYConstraint(topSpace - (pad.top||0), 1.7679 + c.height - topSpace - b.height - (pad.bottom||0), 1.7680 + this.yTickSize 1.7681 + ); 1.7682 + }, 1.7683 + 1.7684 + 1.7685 + getEl: function() { 1.7686 + if (!this._domRef) { 1.7687 + this._domRef = Ext.getDom(this.id); 1.7688 + } 1.7689 + 1.7690 + return this._domRef; 1.7691 + }, 1.7692 + 1.7693 + 1.7694 + getDragEl: function() { 1.7695 + return Ext.getDom(this.dragElId); 1.7696 + }, 1.7697 + 1.7698 + 1.7699 + init: function(id, sGroup, config) { 1.7700 + this.initTarget(id, sGroup, config); 1.7701 + Event.on(this.id, "mousedown", this.handleMouseDown, this); 1.7702 + 1.7703 + }, 1.7704 + 1.7705 + 1.7706 + initTarget: function(id, sGroup, config) { 1.7707 + 1.7708 + 1.7709 + this.config = config || {}; 1.7710 + 1.7711 + 1.7712 + this.DDM = Ext.dd.DDM; 1.7713 + 1.7714 + this.groups = {}; 1.7715 + 1.7716 + 1.7717 + 1.7718 + if (typeof id !== "string") { 1.7719 + id = Ext.id(id); 1.7720 + } 1.7721 + 1.7722 + 1.7723 + this.id = id; 1.7724 + 1.7725 + 1.7726 + this.addToGroup((sGroup) ? sGroup : "default"); 1.7727 + 1.7728 + 1.7729 + 1.7730 + this.handleElId = id; 1.7731 + 1.7732 + 1.7733 + this.setDragElId(id); 1.7734 + 1.7735 + 1.7736 + this.invalidHandleTypes = { A: "A" }; 1.7737 + this.invalidHandleIds = {}; 1.7738 + this.invalidHandleClasses = []; 1.7739 + 1.7740 + this.applyConfig(); 1.7741 + 1.7742 + this.handleOnAvailable(); 1.7743 + }, 1.7744 + 1.7745 + 1.7746 + applyConfig: function() { 1.7747 + 1.7748 + 1.7749 + 1.7750 + this.padding = this.config.padding || [0, 0, 0, 0]; 1.7751 + this.isTarget = (this.config.isTarget !== false); 1.7752 + this.maintainOffset = (this.config.maintainOffset); 1.7753 + this.primaryButtonOnly = (this.config.primaryButtonOnly !== false); 1.7754 + 1.7755 + }, 1.7756 + 1.7757 + 1.7758 + handleOnAvailable: function() { 1.7759 + this.available = true; 1.7760 + this.resetConstraints(); 1.7761 + this.onAvailable(); 1.7762 + }, 1.7763 + 1.7764 + 1.7765 + setPadding: function(iTop, iRight, iBot, iLeft) { 1.7766 + 1.7767 + if (!iRight && 0 !== iRight) { 1.7768 + this.padding = [iTop, iTop, iTop, iTop]; 1.7769 + } else if (!iBot && 0 !== iBot) { 1.7770 + this.padding = [iTop, iRight, iTop, iRight]; 1.7771 + } else { 1.7772 + this.padding = [iTop, iRight, iBot, iLeft]; 1.7773 + } 1.7774 + }, 1.7775 + 1.7776 + 1.7777 + setInitPosition: function(diffX, diffY) { 1.7778 + var el = this.getEl(); 1.7779 + 1.7780 + if (!this.DDM.verifyEl(el)) { 1.7781 + return; 1.7782 + } 1.7783 + 1.7784 + var dx = diffX || 0; 1.7785 + var dy = diffY || 0; 1.7786 + 1.7787 + var p = Dom.getXY( el ); 1.7788 + 1.7789 + this.initPageX = p[0] - dx; 1.7790 + this.initPageY = p[1] - dy; 1.7791 + 1.7792 + this.lastPageX = p[0]; 1.7793 + this.lastPageY = p[1]; 1.7794 + 1.7795 + 1.7796 + this.setStartPosition(p); 1.7797 + }, 1.7798 + 1.7799 + 1.7800 + setStartPosition: function(pos) { 1.7801 + var p = pos || Dom.getXY( this.getEl() ); 1.7802 + this.deltaSetXY = null; 1.7803 + 1.7804 + this.startPageX = p[0]; 1.7805 + this.startPageY = p[1]; 1.7806 + }, 1.7807 + 1.7808 + 1.7809 + addToGroup: function(sGroup) { 1.7810 + this.groups[sGroup] = true; 1.7811 + this.DDM.regDragDrop(this, sGroup); 1.7812 + }, 1.7813 + 1.7814 + 1.7815 + removeFromGroup: function(sGroup) { 1.7816 + if (this.groups[sGroup]) { 1.7817 + delete this.groups[sGroup]; 1.7818 + } 1.7819 + 1.7820 + this.DDM.removeDDFromGroup(this, sGroup); 1.7821 + }, 1.7822 + 1.7823 + 1.7824 + setDragElId: function(id) { 1.7825 + this.dragElId = id; 1.7826 + }, 1.7827 + 1.7828 + 1.7829 + setHandleElId: function(id) { 1.7830 + if (typeof id !== "string") { 1.7831 + id = Ext.id(id); 1.7832 + } 1.7833 + this.handleElId = id; 1.7834 + this.DDM.regHandle(this.id, id); 1.7835 + }, 1.7836 + 1.7837 + 1.7838 + setOuterHandleElId: function(id) { 1.7839 + if (typeof id !== "string") { 1.7840 + id = Ext.id(id); 1.7841 + } 1.7842 + Event.on(id, "mousedown", 1.7843 + this.handleMouseDown, this); 1.7844 + this.setHandleElId(id); 1.7845 + 1.7846 + this.hasOuterHandles = true; 1.7847 + }, 1.7848 + 1.7849 + 1.7850 + unreg: function() { 1.7851 + Event.un(this.id, "mousedown", 1.7852 + this.handleMouseDown); 1.7853 + this._domRef = null; 1.7854 + this.DDM._remove(this); 1.7855 + }, 1.7856 + 1.7857 + destroy : function(){ 1.7858 + this.unreg(); 1.7859 + }, 1.7860 + 1.7861 + 1.7862 + isLocked: function() { 1.7863 + return (this.DDM.isLocked() || this.locked); 1.7864 + }, 1.7865 + 1.7866 + 1.7867 + handleMouseDown: function(e, oDD){ 1.7868 + if (this.primaryButtonOnly && e.button != 0) { 1.7869 + return; 1.7870 + } 1.7871 + 1.7872 + if (this.isLocked()) { 1.7873 + return; 1.7874 + } 1.7875 + 1.7876 + this.DDM.refreshCache(this.groups); 1.7877 + 1.7878 + var pt = new Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.lib.Event.getPageY(e)); 1.7879 + if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) { 1.7880 + } else { 1.7881 + if (this.clickValidator(e)) { 1.7882 + 1.7883 + 1.7884 + this.setStartPosition(); 1.7885 + 1.7886 + 1.7887 + this.b4MouseDown(e); 1.7888 + this.onMouseDown(e); 1.7889 + 1.7890 + this.DDM.handleMouseDown(e, this); 1.7891 + 1.7892 + this.DDM.stopEvent(e); 1.7893 + } else { 1.7894 + 1.7895 + 1.7896 + } 1.7897 + } 1.7898 + }, 1.7899 + 1.7900 + clickValidator: function(e) { 1.7901 + var target = e.getTarget(); 1.7902 + return ( this.isValidHandleChild(target) && 1.7903 + (this.id == this.handleElId || 1.7904 + this.DDM.handleWasClicked(target, this.id)) ); 1.7905 + }, 1.7906 + 1.7907 + 1.7908 + addInvalidHandleType: function(tagName) { 1.7909 + var type = tagName.toUpperCase(); 1.7910 + this.invalidHandleTypes[type] = type; 1.7911 + }, 1.7912 + 1.7913 + 1.7914 + addInvalidHandleId: function(id) { 1.7915 + if (typeof id !== "string") { 1.7916 + id = Ext.id(id); 1.7917 + } 1.7918 + this.invalidHandleIds[id] = id; 1.7919 + }, 1.7920 + 1.7921 + 1.7922 + addInvalidHandleClass: function(cssClass) { 1.7923 + this.invalidHandleClasses.push(cssClass); 1.7924 + }, 1.7925 + 1.7926 + 1.7927 + removeInvalidHandleType: function(tagName) { 1.7928 + var type = tagName.toUpperCase(); 1.7929 + 1.7930 + delete this.invalidHandleTypes[type]; 1.7931 + }, 1.7932 + 1.7933 + 1.7934 + removeInvalidHandleId: function(id) { 1.7935 + if (typeof id !== "string") { 1.7936 + id = Ext.id(id); 1.7937 + } 1.7938 + delete this.invalidHandleIds[id]; 1.7939 + }, 1.7940 + 1.7941 + 1.7942 + removeInvalidHandleClass: function(cssClass) { 1.7943 + for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) { 1.7944 + if (this.invalidHandleClasses[i] == cssClass) { 1.7945 + delete this.invalidHandleClasses[i]; 1.7946 + } 1.7947 + } 1.7948 + }, 1.7949 + 1.7950 + 1.7951 + isValidHandleChild: function(node) { 1.7952 + 1.7953 + var valid = true; 1.7954 + 1.7955 + var nodeName; 1.7956 + try { 1.7957 + nodeName = node.nodeName.toUpperCase(); 1.7958 + } catch(e) { 1.7959 + nodeName = node.nodeName; 1.7960 + } 1.7961 + valid = valid && !this.invalidHandleTypes[nodeName]; 1.7962 + valid = valid && !this.invalidHandleIds[node.id]; 1.7963 + 1.7964 + for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) { 1.7965 + valid = !Dom.hasClass(node, this.invalidHandleClasses[i]); 1.7966 + } 1.7967 + 1.7968 + 1.7969 + return valid; 1.7970 + 1.7971 + }, 1.7972 + 1.7973 + 1.7974 + setXTicks: function(iStartX, iTickSize) { 1.7975 + this.xTicks = []; 1.7976 + this.xTickSize = iTickSize; 1.7977 + 1.7978 + var tickMap = {}; 1.7979 + 1.7980 + for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) { 1.7981 + if (!tickMap[i]) { 1.7982 + this.xTicks[this.xTicks.length] = i; 1.7983 + tickMap[i] = true; 1.7984 + } 1.7985 + } 1.7986 + 1.7987 + for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) { 1.7988 + if (!tickMap[i]) { 1.7989 + this.xTicks[this.xTicks.length] = i; 1.7990 + tickMap[i] = true; 1.7991 + } 1.7992 + } 1.7993 + 1.7994 + this.xTicks.sort(this.DDM.numericSort) ; 1.7995 + }, 1.7996 + 1.7997 + 1.7998 + setYTicks: function(iStartY, iTickSize) { 1.7999 + this.yTicks = []; 1.8000 + this.yTickSize = iTickSize; 1.8001 + 1.8002 + var tickMap = {}; 1.8003 + 1.8004 + for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) { 1.8005 + if (!tickMap[i]) { 1.8006 + this.yTicks[this.yTicks.length] = i; 1.8007 + tickMap[i] = true; 1.8008 + } 1.8009 + } 1.8010 + 1.8011 + for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) { 1.8012 + if (!tickMap[i]) { 1.8013 + this.yTicks[this.yTicks.length] = i; 1.8014 + tickMap[i] = true; 1.8015 + } 1.8016 + } 1.8017 + 1.8018 + this.yTicks.sort(this.DDM.numericSort) ; 1.8019 + }, 1.8020 + 1.8021 + 1.8022 + setXConstraint: function(iLeft, iRight, iTickSize) { 1.8023 + this.leftConstraint = iLeft; 1.8024 + this.rightConstraint = iRight; 1.8025 + 1.8026 + this.minX = this.initPageX - iLeft; 1.8027 + this.maxX = this.initPageX + iRight; 1.8028 + if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); } 1.8029 + 1.8030 + this.constrainX = true; 1.8031 + }, 1.8032 + 1.8033 + 1.8034 + clearConstraints: function() { 1.8035 + this.constrainX = false; 1.8036 + this.constrainY = false; 1.8037 + this.clearTicks(); 1.8038 + }, 1.8039 + 1.8040 + 1.8041 + clearTicks: function() { 1.8042 + this.xTicks = null; 1.8043 + this.yTicks = null; 1.8044 + this.xTickSize = 0; 1.8045 + this.yTickSize = 0; 1.8046 + }, 1.8047 + 1.8048 + 1.8049 + setYConstraint: function(iUp, iDown, iTickSize) { 1.8050 + this.topConstraint = iUp; 1.8051 + this.bottomConstraint = iDown; 1.8052 + 1.8053 + this.minY = this.initPageY - iUp; 1.8054 + this.maxY = this.initPageY + iDown; 1.8055 + if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); } 1.8056 + 1.8057 + this.constrainY = true; 1.8058 + 1.8059 + }, 1.8060 + 1.8061 + 1.8062 + resetConstraints: function() { 1.8063 + 1.8064 + 1.8065 + 1.8066 + if (this.initPageX || this.initPageX === 0) { 1.8067 + 1.8068 + var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0; 1.8069 + var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0; 1.8070 + 1.8071 + this.setInitPosition(dx, dy); 1.8072 + 1.8073 + 1.8074 + } else { 1.8075 + this.setInitPosition(); 1.8076 + } 1.8077 + 1.8078 + if (this.constrainX) { 1.8079 + this.setXConstraint( this.leftConstraint, 1.8080 + this.rightConstraint, 1.8081 + this.xTickSize ); 1.8082 + } 1.8083 + 1.8084 + if (this.constrainY) { 1.8085 + this.setYConstraint( this.topConstraint, 1.8086 + this.bottomConstraint, 1.8087 + this.yTickSize ); 1.8088 + } 1.8089 + }, 1.8090 + 1.8091 + 1.8092 + getTick: function(val, tickArray) { 1.8093 + 1.8094 + if (!tickArray) { 1.8095 + 1.8096 + 1.8097 + return val; 1.8098 + } else if (tickArray[0] >= val) { 1.8099 + 1.8100 + 1.8101 + return tickArray[0]; 1.8102 + } else { 1.8103 + for (var i=0, len=tickArray.length; i<len; ++i) { 1.8104 + var next = i + 1; 1.8105 + if (tickArray[next] && tickArray[next] >= val) { 1.8106 + var diff1 = val - tickArray[i]; 1.8107 + var diff2 = tickArray[next] - val; 1.8108 + return (diff2 > diff1) ? tickArray[i] : tickArray[next]; 1.8109 + } 1.8110 + } 1.8111 + 1.8112 + 1.8113 + 1.8114 + return tickArray[tickArray.length - 1]; 1.8115 + } 1.8116 + }, 1.8117 + 1.8118 + 1.8119 + toString: function() { 1.8120 + return ("DragDrop " + this.id); 1.8121 + } 1.8122 + 1.8123 +}; 1.8124 + 1.8125 +})(); 1.8126 + 1.8127 + 1.8128 + 1.8129 + 1.8130 +if (!Ext.dd.DragDropMgr) { 1.8131 + 1.8132 + 1.8133 +Ext.dd.DragDropMgr = function() { 1.8134 + 1.8135 + var Event = Ext.EventManager; 1.8136 + 1.8137 + return { 1.8138 + 1.8139 + 1.8140 + ids: {}, 1.8141 + 1.8142 + 1.8143 + handleIds: {}, 1.8144 + 1.8145 + 1.8146 + dragCurrent: null, 1.8147 + 1.8148 + 1.8149 + dragOvers: {}, 1.8150 + 1.8151 + 1.8152 + deltaX: 0, 1.8153 + 1.8154 + 1.8155 + deltaY: 0, 1.8156 + 1.8157 + 1.8158 + preventDefault: true, 1.8159 + 1.8160 + 1.8161 + stopPropagation: true, 1.8162 + 1.8163 + 1.8164 + initialized: false, 1.8165 + 1.8166 + 1.8167 + locked: false, 1.8168 + 1.8169 + 1.8170 + init: function() { 1.8171 + this.initialized = true; 1.8172 + }, 1.8173 + 1.8174 + 1.8175 + POINT: 0, 1.8176 + 1.8177 + 1.8178 + INTERSECT: 1, 1.8179 + 1.8180 + 1.8181 + mode: 0, 1.8182 + 1.8183 + 1.8184 + _execOnAll: function(sMethod, args) { 1.8185 + for (var i in this.ids) { 1.8186 + for (var j in this.ids[i]) { 1.8187 + var oDD = this.ids[i][j]; 1.8188 + if (! this.isTypeOfDD(oDD)) { 1.8189 + continue; 1.8190 + } 1.8191 + oDD[sMethod].apply(oDD, args); 1.8192 + } 1.8193 + } 1.8194 + }, 1.8195 + 1.8196 + 1.8197 + _onLoad: function() { 1.8198 + 1.8199 + this.init(); 1.8200 + 1.8201 + 1.8202 + Event.on(document, "mouseup", this.handleMouseUp, this, true); 1.8203 + Event.on(document, "mousemove", this.handleMouseMove, this, true); 1.8204 + Event.on(window, "unload", this._onUnload, this, true); 1.8205 + Event.on(window, "resize", this._onResize, this, true); 1.8206 + 1.8207 + 1.8208 + }, 1.8209 + 1.8210 + 1.8211 + _onResize: function(e) { 1.8212 + this._execOnAll("resetConstraints", []); 1.8213 + }, 1.8214 + 1.8215 + 1.8216 + lock: function() { this.locked = true; }, 1.8217 + 1.8218 + 1.8219 + unlock: function() { this.locked = false; }, 1.8220 + 1.8221 + 1.8222 + isLocked: function() { return this.locked; }, 1.8223 + 1.8224 + 1.8225 + locationCache: {}, 1.8226 + 1.8227 + 1.8228 + useCache: true, 1.8229 + 1.8230 + 1.8231 + clickPixelThresh: 3, 1.8232 + 1.8233 + 1.8234 + clickTimeThresh: 350, 1.8235 + 1.8236 + 1.8237 + dragThreshMet: false, 1.8238 + 1.8239 + 1.8240 + clickTimeout: null, 1.8241 + 1.8242 + 1.8243 + startX: 0, 1.8244 + 1.8245 + 1.8246 + startY: 0, 1.8247 + 1.8248 + 1.8249 + regDragDrop: function(oDD, sGroup) { 1.8250 + if (!this.initialized) { this.init(); } 1.8251 + 1.8252 + if (!this.ids[sGroup]) { 1.8253 + this.ids[sGroup] = {}; 1.8254 + } 1.8255 + this.ids[sGroup][oDD.id] = oDD; 1.8256 + }, 1.8257 + 1.8258 + 1.8259 + removeDDFromGroup: function(oDD, sGroup) { 1.8260 + if (!this.ids[sGroup]) { 1.8261 + this.ids[sGroup] = {}; 1.8262 + } 1.8263 + 1.8264 + var obj = this.ids[sGroup]; 1.8265 + if (obj && obj[oDD.id]) { 1.8266 + delete obj[oDD.id]; 1.8267 + } 1.8268 + }, 1.8269 + 1.8270 + 1.8271 + _remove: function(oDD) { 1.8272 + for (var g in oDD.groups) { 1.8273 + if (g && this.ids[g][oDD.id]) { 1.8274 + delete this.ids[g][oDD.id]; 1.8275 + } 1.8276 + } 1.8277 + delete this.handleIds[oDD.id]; 1.8278 + }, 1.8279 + 1.8280 + 1.8281 + regHandle: function(sDDId, sHandleId) { 1.8282 + if (!this.handleIds[sDDId]) { 1.8283 + this.handleIds[sDDId] = {}; 1.8284 + } 1.8285 + this.handleIds[sDDId][sHandleId] = sHandleId; 1.8286 + }, 1.8287 + 1.8288 + 1.8289 + isDragDrop: function(id) { 1.8290 + return ( this.getDDById(id) ) ? true : false; 1.8291 + }, 1.8292 + 1.8293 + 1.8294 + getRelated: function(p_oDD, bTargetsOnly) { 1.8295 + var oDDs = []; 1.8296 + for (var i in p_oDD.groups) { 1.8297 + for (j in this.ids[i]) { 1.8298 + var dd = this.ids[i][j]; 1.8299 + if (! this.isTypeOfDD(dd)) { 1.8300 + continue; 1.8301 + } 1.8302 + if (!bTargetsOnly || dd.isTarget) { 1.8303 + oDDs[oDDs.length] = dd; 1.8304 + } 1.8305 + } 1.8306 + } 1.8307 + 1.8308 + return oDDs; 1.8309 + }, 1.8310 + 1.8311 + 1.8312 + isLegalTarget: function (oDD, oTargetDD) { 1.8313 + var targets = this.getRelated(oDD, true); 1.8314 + for (var i=0, len=targets.length;i<len;++i) { 1.8315 + if (targets[i].id == oTargetDD.id) { 1.8316 + return true; 1.8317 + } 1.8318 + } 1.8319 + 1.8320 + return false; 1.8321 + }, 1.8322 + 1.8323 + 1.8324 + isTypeOfDD: function (oDD) { 1.8325 + return (oDD && oDD.__ygDragDrop); 1.8326 + }, 1.8327 + 1.8328 + 1.8329 + isHandle: function(sDDId, sHandleId) { 1.8330 + return ( this.handleIds[sDDId] && 1.8331 + this.handleIds[sDDId][sHandleId] ); 1.8332 + }, 1.8333 + 1.8334 + 1.8335 + getDDById: function(id) { 1.8336 + for (var i in this.ids) { 1.8337 + if (this.ids[i][id]) { 1.8338 + return this.ids[i][id]; 1.8339 + } 1.8340 + } 1.8341 + return null; 1.8342 + }, 1.8343 + 1.8344 + 1.8345 + handleMouseDown: function(e, oDD) { 1.8346 + if(Ext.QuickTips){ 1.8347 + Ext.QuickTips.disable(); 1.8348 + } 1.8349 + this.currentTarget = e.getTarget(); 1.8350 + 1.8351 + this.dragCurrent = oDD; 1.8352 + 1.8353 + var el = oDD.getEl(); 1.8354 + 1.8355 + 1.8356 + this.startX = e.getPageX(); 1.8357 + this.startY = e.getPageY(); 1.8358 + 1.8359 + this.deltaX = this.startX - el.offsetLeft; 1.8360 + this.deltaY = this.startY - el.offsetTop; 1.8361 + 1.8362 + this.dragThreshMet = false; 1.8363 + 1.8364 + this.clickTimeout = setTimeout( 1.8365 + function() { 1.8366 + var DDM = Ext.dd.DDM; 1.8367 + DDM.startDrag(DDM.startX, DDM.startY); 1.8368 + }, 1.8369 + this.clickTimeThresh ); 1.8370 + }, 1.8371 + 1.8372 + 1.8373 + startDrag: function(x, y) { 1.8374 + clearTimeout(this.clickTimeout); 1.8375 + if (this.dragCurrent) { 1.8376 + this.dragCurrent.b4StartDrag(x, y); 1.8377 + this.dragCurrent.startDrag(x, y); 1.8378 + } 1.8379 + this.dragThreshMet = true; 1.8380 + }, 1.8381 + 1.8382 + 1.8383 + handleMouseUp: function(e) { 1.8384 + 1.8385 + if(Ext.QuickTips){ 1.8386 + Ext.QuickTips.enable(); 1.8387 + } 1.8388 + if (! this.dragCurrent) { 1.8389 + return; 1.8390 + } 1.8391 + 1.8392 + clearTimeout(this.clickTimeout); 1.8393 + 1.8394 + if (this.dragThreshMet) { 1.8395 + this.fireEvents(e, true); 1.8396 + } else { 1.8397 + } 1.8398 + 1.8399 + this.stopDrag(e); 1.8400 + 1.8401 + this.stopEvent(e); 1.8402 + }, 1.8403 + 1.8404 + 1.8405 + stopEvent: function(e){ 1.8406 + if(this.stopPropagation) { 1.8407 + e.stopPropagation(); 1.8408 + } 1.8409 + 1.8410 + if (this.preventDefault) { 1.8411 + e.preventDefault(); 1.8412 + } 1.8413 + }, 1.8414 + 1.8415 + 1.8416 + stopDrag: function(e) { 1.8417 + 1.8418 + if (this.dragCurrent) { 1.8419 + if (this.dragThreshMet) { 1.8420 + this.dragCurrent.b4EndDrag(e); 1.8421 + this.dragCurrent.endDrag(e); 1.8422 + } 1.8423 + 1.8424 + this.dragCurrent.onMouseUp(e); 1.8425 + } 1.8426 + 1.8427 + this.dragCurrent = null; 1.8428 + this.dragOvers = {}; 1.8429 + }, 1.8430 + 1.8431 + 1.8432 + handleMouseMove: function(e) { 1.8433 + if (! this.dragCurrent) { 1.8434 + return true; 1.8435 + } 1.8436 + 1.8437 + 1.8438 + 1.8439 + 1.8440 + if (Ext.isIE && (e.button !== 0 && e.button !== 1 && e.button !== 2)) { 1.8441 + this.stopEvent(e); 1.8442 + return this.handleMouseUp(e); 1.8443 + } 1.8444 + 1.8445 + if (!this.dragThreshMet) { 1.8446 + var diffX = Math.abs(this.startX - e.getPageX()); 1.8447 + var diffY = Math.abs(this.startY - e.getPageY()); 1.8448 + if (diffX > this.clickPixelThresh || 1.8449 + diffY > this.clickPixelThresh) { 1.8450 + this.startDrag(this.startX, this.startY); 1.8451 + } 1.8452 + } 1.8453 + 1.8454 + if (this.dragThreshMet) { 1.8455 + this.dragCurrent.b4Drag(e); 1.8456 + this.dragCurrent.onDrag(e); 1.8457 + if(!this.dragCurrent.moveOnly){ 1.8458 + this.fireEvents(e, false); 1.8459 + } 1.8460 + } 1.8461 + 1.8462 + this.stopEvent(e); 1.8463 + 1.8464 + return true; 1.8465 + }, 1.8466 + 1.8467 + 1.8468 + fireEvents: function(e, isDrop) { 1.8469 + var dc = this.dragCurrent; 1.8470 + 1.8471 + 1.8472 + 1.8473 + if (!dc || dc.isLocked()) { 1.8474 + return; 1.8475 + } 1.8476 + 1.8477 + var pt = e.getPoint(); 1.8478 + 1.8479 + 1.8480 + var oldOvers = []; 1.8481 + 1.8482 + var outEvts = []; 1.8483 + var overEvts = []; 1.8484 + var dropEvts = []; 1.8485 + var enterEvts = []; 1.8486 + 1.8487 + 1.8488 + 1.8489 + for (var i in this.dragOvers) { 1.8490 + 1.8491 + var ddo = this.dragOvers[i]; 1.8492 + 1.8493 + if (! this.isTypeOfDD(ddo)) { 1.8494 + continue; 1.8495 + } 1.8496 + 1.8497 + if (! this.isOverTarget(pt, ddo, this.mode)) { 1.8498 + outEvts.push( ddo ); 1.8499 + } 1.8500 + 1.8501 + oldOvers[i] = true; 1.8502 + delete this.dragOvers[i]; 1.8503 + } 1.8504 + 1.8505 + for (var sGroup in dc.groups) { 1.8506 + 1.8507 + if ("string" != typeof sGroup) { 1.8508 + continue; 1.8509 + } 1.8510 + 1.8511 + for (i in this.ids[sGroup]) { 1.8512 + var oDD = this.ids[sGroup][i]; 1.8513 + if (! this.isTypeOfDD(oDD)) { 1.8514 + continue; 1.8515 + } 1.8516 + 1.8517 + if (oDD.isTarget && !oDD.isLocked() && oDD != dc) { 1.8518 + if (this.isOverTarget(pt, oDD, this.mode)) { 1.8519 + 1.8520 + if (isDrop) { 1.8521 + dropEvts.push( oDD ); 1.8522 + 1.8523 + } else { 1.8524 + 1.8525 + 1.8526 + if (!oldOvers[oDD.id]) { 1.8527 + enterEvts.push( oDD ); 1.8528 + 1.8529 + } else { 1.8530 + overEvts.push( oDD ); 1.8531 + } 1.8532 + 1.8533 + this.dragOvers[oDD.id] = oDD; 1.8534 + } 1.8535 + } 1.8536 + } 1.8537 + } 1.8538 + } 1.8539 + 1.8540 + if (this.mode) { 1.8541 + if (outEvts.length) { 1.8542 + dc.b4DragOut(e, outEvts); 1.8543 + dc.onDragOut(e, outEvts); 1.8544 + } 1.8545 + 1.8546 + if (enterEvts.length) { 1.8547 + dc.onDragEnter(e, enterEvts); 1.8548 + } 1.8549 + 1.8550 + if (overEvts.length) { 1.8551 + dc.b4DragOver(e, overEvts); 1.8552 + dc.onDragOver(e, overEvts); 1.8553 + } 1.8554 + 1.8555 + if (dropEvts.length) { 1.8556 + dc.b4DragDrop(e, dropEvts); 1.8557 + dc.onDragDrop(e, dropEvts); 1.8558 + } 1.8559 + 1.8560 + } else { 1.8561 + 1.8562 + var len = 0; 1.8563 + for (i=0, len=outEvts.length; i<len; ++i) { 1.8564 + dc.b4DragOut(e, outEvts[i].id); 1.8565 + dc.onDragOut(e, outEvts[i].id); 1.8566 + } 1.8567 + 1.8568 + 1.8569 + for (i=0,len=enterEvts.length; i<len; ++i) { 1.8570 + 1.8571 + dc.onDragEnter(e, enterEvts[i].id); 1.8572 + } 1.8573 + 1.8574 + 1.8575 + for (i=0,len=overEvts.length; i<len; ++i) { 1.8576 + dc.b4DragOver(e, overEvts[i].id); 1.8577 + dc.onDragOver(e, overEvts[i].id); 1.8578 + } 1.8579 + 1.8580 + 1.8581 + for (i=0, len=dropEvts.length; i<len; ++i) { 1.8582 + dc.b4DragDrop(e, dropEvts[i].id); 1.8583 + dc.onDragDrop(e, dropEvts[i].id); 1.8584 + } 1.8585 + 1.8586 + } 1.8587 + 1.8588 + 1.8589 + if (isDrop && !dropEvts.length) { 1.8590 + dc.onInvalidDrop(e); 1.8591 + } 1.8592 + 1.8593 + }, 1.8594 + 1.8595 + 1.8596 + getBestMatch: function(dds) { 1.8597 + var winner = null; 1.8598 + 1.8599 + 1.8600 + 1.8601 + 1.8602 + 1.8603 + 1.8604 + var len = dds.length; 1.8605 + 1.8606 + if (len == 1) { 1.8607 + winner = dds[0]; 1.8608 + } else { 1.8609 + 1.8610 + for (var i=0; i<len; ++i) { 1.8611 + var dd = dds[i]; 1.8612 + 1.8613 + 1.8614 + 1.8615 + if (dd.cursorIsOver) { 1.8616 + winner = dd; 1.8617 + break; 1.8618 + 1.8619 + } else { 1.8620 + if (!winner || 1.8621 + winner.overlap.getArea() < dd.overlap.getArea()) { 1.8622 + winner = dd; 1.8623 + } 1.8624 + } 1.8625 + } 1.8626 + } 1.8627 + 1.8628 + return winner; 1.8629 + }, 1.8630 + 1.8631 + 1.8632 + refreshCache: function(groups) { 1.8633 + for (var sGroup in groups) { 1.8634 + if ("string" != typeof sGroup) { 1.8635 + continue; 1.8636 + } 1.8637 + for (var i in this.ids[sGroup]) { 1.8638 + var oDD = this.ids[sGroup][i]; 1.8639 + 1.8640 + if (this.isTypeOfDD(oDD)) { 1.8641 + 1.8642 + var loc = this.getLocation(oDD); 1.8643 + if (loc) { 1.8644 + this.locationCache[oDD.id] = loc; 1.8645 + } else { 1.8646 + delete this.locationCache[oDD.id]; 1.8647 + 1.8648 + 1.8649 + 1.8650 + } 1.8651 + } 1.8652 + } 1.8653 + } 1.8654 + }, 1.8655 + 1.8656 + 1.8657 + verifyEl: function(el) { 1.8658 + if (el) { 1.8659 + var parent; 1.8660 + if(Ext.isIE){ 1.8661 + try{ 1.8662 + parent = el.offsetParent; 1.8663 + }catch(e){} 1.8664 + }else{ 1.8665 + parent = el.offsetParent; 1.8666 + } 1.8667 + if (parent) { 1.8668 + return true; 1.8669 + } 1.8670 + } 1.8671 + 1.8672 + return false; 1.8673 + }, 1.8674 + 1.8675 + 1.8676 + getLocation: function(oDD) { 1.8677 + if (! this.isTypeOfDD(oDD)) { 1.8678 + return null; 1.8679 + } 1.8680 + 1.8681 + var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l; 1.8682 + 1.8683 + try { 1.8684 + pos= Ext.lib.Dom.getXY(el); 1.8685 + } catch (e) { } 1.8686 + 1.8687 + if (!pos) { 1.8688 + return null; 1.8689 + } 1.8690 + 1.8691 + x1 = pos[0]; 1.8692 + x2 = x1 + el.offsetWidth; 1.8693 + y1 = pos[1]; 1.8694 + y2 = y1 + el.offsetHeight; 1.8695 + 1.8696 + t = y1 - oDD.padding[0]; 1.8697 + r = x2 + oDD.padding[1]; 1.8698 + b = y2 + oDD.padding[2]; 1.8699 + l = x1 - oDD.padding[3]; 1.8700 + 1.8701 + return new Ext.lib.Region( t, r, b, l ); 1.8702 + }, 1.8703 + 1.8704 + 1.8705 + isOverTarget: function(pt, oTarget, intersect) { 1.8706 + 1.8707 + var loc = this.locationCache[oTarget.id]; 1.8708 + if (!loc || !this.useCache) { 1.8709 + loc = this.getLocation(oTarget); 1.8710 + this.locationCache[oTarget.id] = loc; 1.8711 + 1.8712 + } 1.8713 + 1.8714 + if (!loc) { 1.8715 + return false; 1.8716 + } 1.8717 + 1.8718 + oTarget.cursorIsOver = loc.contains( pt ); 1.8719 + 1.8720 + 1.8721 + 1.8722 + 1.8723 + 1.8724 + 1.8725 + var dc = this.dragCurrent; 1.8726 + if (!dc || !dc.getTargetCoord || 1.8727 + (!intersect && !dc.constrainX && !dc.constrainY)) { 1.8728 + return oTarget.cursorIsOver; 1.8729 + } 1.8730 + 1.8731 + oTarget.overlap = null; 1.8732 + 1.8733 + 1.8734 + 1.8735 + 1.8736 + 1.8737 + var pos = dc.getTargetCoord(pt.x, pt.y); 1.8738 + 1.8739 + var el = dc.getDragEl(); 1.8740 + var curRegion = new Ext.lib.Region( pos.y, 1.8741 + pos.x + el.offsetWidth, 1.8742 + pos.y + el.offsetHeight, 1.8743 + pos.x ); 1.8744 + 1.8745 + var overlap = curRegion.intersect(loc); 1.8746 + 1.8747 + if (overlap) { 1.8748 + oTarget.overlap = overlap; 1.8749 + return (intersect) ? true : oTarget.cursorIsOver; 1.8750 + } else { 1.8751 + return false; 1.8752 + } 1.8753 + }, 1.8754 + 1.8755 + 1.8756 + _onUnload: function(e, me) { 1.8757 + Ext.dd.DragDropMgr.unregAll(); 1.8758 + }, 1.8759 + 1.8760 + 1.8761 + unregAll: function() { 1.8762 + 1.8763 + if (this.dragCurrent) { 1.8764 + this.stopDrag(); 1.8765 + this.dragCurrent = null; 1.8766 + } 1.8767 + 1.8768 + this._execOnAll("unreg", []); 1.8769 + 1.8770 + for (var i in this.elementCache) { 1.8771 + delete this.elementCache[i]; 1.8772 + } 1.8773 + 1.8774 + this.elementCache = {}; 1.8775 + this.ids = {}; 1.8776 + }, 1.8777 + 1.8778 + 1.8779 + elementCache: {}, 1.8780 + 1.8781 + 1.8782 + getElWrapper: function(id) { 1.8783 + var oWrapper = this.elementCache[id]; 1.8784 + if (!oWrapper || !oWrapper.el) { 1.8785 + oWrapper = this.elementCache[id] = 1.8786 + new this.ElementWrapper(Ext.getDom(id)); 1.8787 + } 1.8788 + return oWrapper; 1.8789 + }, 1.8790 + 1.8791 + 1.8792 + getElement: function(id) { 1.8793 + return Ext.getDom(id); 1.8794 + }, 1.8795 + 1.8796 + 1.8797 + getCss: function(id) { 1.8798 + var el = Ext.getDom(id); 1.8799 + return (el) ? el.style : null; 1.8800 + }, 1.8801 + 1.8802 + 1.8803 + ElementWrapper: function(el) { 1.8804 + 1.8805 + this.el = el || null; 1.8806 + 1.8807 + this.id = this.el && el.id; 1.8808 + 1.8809 + this.css = this.el && el.style; 1.8810 + }, 1.8811 + 1.8812 + 1.8813 + getPosX: function(el) { 1.8814 + return Ext.lib.Dom.getX(el); 1.8815 + }, 1.8816 + 1.8817 + 1.8818 + getPosY: function(el) { 1.8819 + return Ext.lib.Dom.getY(el); 1.8820 + }, 1.8821 + 1.8822 + 1.8823 + swapNode: function(n1, n2) { 1.8824 + if (n1.swapNode) { 1.8825 + n1.swapNode(n2); 1.8826 + } else { 1.8827 + var p = n2.parentNode; 1.8828 + var s = n2.nextSibling; 1.8829 + 1.8830 + if (s == n1) { 1.8831 + p.insertBefore(n1, n2); 1.8832 + } else if (n2 == n1.nextSibling) { 1.8833 + p.insertBefore(n2, n1); 1.8834 + } else { 1.8835 + n1.parentNode.replaceChild(n2, n1); 1.8836 + p.insertBefore(n1, s); 1.8837 + } 1.8838 + } 1.8839 + }, 1.8840 + 1.8841 + 1.8842 + getScroll: function () { 1.8843 + var t, l, dde=document.documentElement, db=document.body; 1.8844 + if (dde && (dde.scrollTop || dde.scrollLeft)) { 1.8845 + t = dde.scrollTop; 1.8846 + l = dde.scrollLeft; 1.8847 + } else if (db) { 1.8848 + t = db.scrollTop; 1.8849 + l = db.scrollLeft; 1.8850 + } else { 1.8851 + 1.8852 + } 1.8853 + return { top: t, left: l }; 1.8854 + }, 1.8855 + 1.8856 + 1.8857 + getStyle: function(el, styleProp) { 1.8858 + return Ext.fly(el).getStyle(styleProp); 1.8859 + }, 1.8860 + 1.8861 + 1.8862 + getScrollTop: function () { return this.getScroll().top; }, 1.8863 + 1.8864 + 1.8865 + getScrollLeft: function () { return this.getScroll().left; }, 1.8866 + 1.8867 + 1.8868 + moveToEl: function (moveEl, targetEl) { 1.8869 + var aCoord = Ext.lib.Dom.getXY(targetEl); 1.8870 + Ext.lib.Dom.setXY(moveEl, aCoord); 1.8871 + }, 1.8872 + 1.8873 + 1.8874 + numericSort: function(a, b) { return (a - b); }, 1.8875 + 1.8876 + 1.8877 + _timeoutCount: 0, 1.8878 + 1.8879 + 1.8880 + _addListeners: function() { 1.8881 + var DDM = Ext.dd.DDM; 1.8882 + if ( Ext.lib.Event && document ) { 1.8883 + DDM._onLoad(); 1.8884 + } else { 1.8885 + if (DDM._timeoutCount > 2000) { 1.8886 + } else { 1.8887 + setTimeout(DDM._addListeners, 10); 1.8888 + if (document && document.body) { 1.8889 + DDM._timeoutCount += 1; 1.8890 + } 1.8891 + } 1.8892 + } 1.8893 + }, 1.8894 + 1.8895 + 1.8896 + handleWasClicked: function(node, id) { 1.8897 + if (this.isHandle(id, node.id)) { 1.8898 + return true; 1.8899 + } else { 1.8900 + 1.8901 + var p = node.parentNode; 1.8902 + 1.8903 + while (p) { 1.8904 + if (this.isHandle(id, p.id)) { 1.8905 + return true; 1.8906 + } else { 1.8907 + p = p.parentNode; 1.8908 + } 1.8909 + } 1.8910 + } 1.8911 + 1.8912 + return false; 1.8913 + } 1.8914 + 1.8915 + }; 1.8916 + 1.8917 +}(); 1.8918 + 1.8919 + 1.8920 +Ext.dd.DDM = Ext.dd.DragDropMgr; 1.8921 +Ext.dd.DDM._addListeners(); 1.8922 + 1.8923 +} 1.8924 + 1.8925 + 1.8926 +Ext.dd.DD = function(id, sGroup, config) { 1.8927 + if (id) { 1.8928 + this.init(id, sGroup, config); 1.8929 + } 1.8930 +}; 1.8931 + 1.8932 +Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { 1.8933 + 1.8934 + 1.8935 + scroll: true, 1.8936 + 1.8937 + 1.8938 + autoOffset: function(iPageX, iPageY) { 1.8939 + var x = iPageX - this.startPageX; 1.8940 + var y = iPageY - this.startPageY; 1.8941 + this.setDelta(x, y); 1.8942 + }, 1.8943 + 1.8944 + 1.8945 + setDelta: function(iDeltaX, iDeltaY) { 1.8946 + this.deltaX = iDeltaX; 1.8947 + this.deltaY = iDeltaY; 1.8948 + }, 1.8949 + 1.8950 + 1.8951 + setDragElPos: function(iPageX, iPageY) { 1.8952 + 1.8953 + 1.8954 + 1.8955 + var el = this.getDragEl(); 1.8956 + this.alignElWithMouse(el, iPageX, iPageY); 1.8957 + }, 1.8958 + 1.8959 + 1.8960 + alignElWithMouse: function(el, iPageX, iPageY) { 1.8961 + var oCoord = this.getTargetCoord(iPageX, iPageY); 1.8962 + var fly = el.dom ? el : Ext.fly(el, '_dd'); 1.8963 + if (!this.deltaSetXY) { 1.8964 + var aCoord = [oCoord.x, oCoord.y]; 1.8965 + fly.setXY(aCoord); 1.8966 + var newLeft = fly.getLeft(true); 1.8967 + var newTop = fly.getTop(true); 1.8968 + this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ]; 1.8969 + } else { 1.8970 + fly.setLeftTop(oCoord.x + this.deltaSetXY[0], oCoord.y + this.deltaSetXY[1]); 1.8971 + } 1.8972 + 1.8973 + this.cachePosition(oCoord.x, oCoord.y); 1.8974 + this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth); 1.8975 + return oCoord; 1.8976 + }, 1.8977 + 1.8978 + 1.8979 + cachePosition: function(iPageX, iPageY) { 1.8980 + if (iPageX) { 1.8981 + this.lastPageX = iPageX; 1.8982 + this.lastPageY = iPageY; 1.8983 + } else { 1.8984 + var aCoord = Ext.lib.Dom.getXY(this.getEl()); 1.8985 + this.lastPageX = aCoord[0]; 1.8986 + this.lastPageY = aCoord[1]; 1.8987 + } 1.8988 + }, 1.8989 + 1.8990 + 1.8991 + autoScroll: function(x, y, h, w) { 1.8992 + 1.8993 + if (this.scroll) { 1.8994 + 1.8995 + var clientH = Ext.lib.Dom.getViewHeight(); 1.8996 + 1.8997 + 1.8998 + var clientW = Ext.lib.Dom.getViewWidth(); 1.8999 + 1.9000 + 1.9001 + var st = this.DDM.getScrollTop(); 1.9002 + 1.9003 + 1.9004 + var sl = this.DDM.getScrollLeft(); 1.9005 + 1.9006 + 1.9007 + var bot = h + y; 1.9008 + 1.9009 + 1.9010 + var right = w + x; 1.9011 + 1.9012 + 1.9013 + 1.9014 + 1.9015 + var toBot = (clientH + st - y - this.deltaY); 1.9016 + 1.9017 + 1.9018 + var toRight = (clientW + sl - x - this.deltaX); 1.9019 + 1.9020 + 1.9021 + 1.9022 + 1.9023 + var thresh = 40; 1.9024 + 1.9025 + 1.9026 + 1.9027 + 1.9028 + var scrAmt = (document.all) ? 80 : 30; 1.9029 + 1.9030 + 1.9031 + 1.9032 + if ( bot > clientH && toBot < thresh ) { 1.9033 + window.scrollTo(sl, st + scrAmt); 1.9034 + } 1.9035 + 1.9036 + 1.9037 + 1.9038 + if ( y < st && st > 0 && y - st < thresh ) { 1.9039 + window.scrollTo(sl, st - scrAmt); 1.9040 + } 1.9041 + 1.9042 + 1.9043 + 1.9044 + if ( right > clientW && toRight < thresh ) { 1.9045 + window.scrollTo(sl + scrAmt, st); 1.9046 + } 1.9047 + 1.9048 + 1.9049 + 1.9050 + if ( x < sl && sl > 0 && x - sl < thresh ) { 1.9051 + window.scrollTo(sl - scrAmt, st); 1.9052 + } 1.9053 + } 1.9054 + }, 1.9055 + 1.9056 + 1.9057 + getTargetCoord: function(iPageX, iPageY) { 1.9058 + 1.9059 + 1.9060 + var x = iPageX - this.deltaX; 1.9061 + var y = iPageY - this.deltaY; 1.9062 + 1.9063 + if (this.constrainX) { 1.9064 + if (x < this.minX) { x = this.minX; } 1.9065 + if (x > this.maxX) { x = this.maxX; } 1.9066 + } 1.9067 + 1.9068 + if (this.constrainY) { 1.9069 + if (y < this.minY) { y = this.minY; } 1.9070 + if (y > this.maxY) { y = this.maxY; } 1.9071 + } 1.9072 + 1.9073 + x = this.getTick(x, this.xTicks); 1.9074 + y = this.getTick(y, this.yTicks); 1.9075 + 1.9076 + 1.9077 + return {x:x, y:y}; 1.9078 + }, 1.9079 + 1.9080 + 1.9081 + applyConfig: function() { 1.9082 + Ext.dd.DD.superclass.applyConfig.call(this); 1.9083 + this.scroll = (this.config.scroll !== false); 1.9084 + }, 1.9085 + 1.9086 + 1.9087 + b4MouseDown: function(e) { 1.9088 + 1.9089 + this.autoOffset(e.getPageX(), 1.9090 + e.getPageY()); 1.9091 + }, 1.9092 + 1.9093 + 1.9094 + b4Drag: function(e) { 1.9095 + this.setDragElPos(e.getPageX(), 1.9096 + e.getPageY()); 1.9097 + }, 1.9098 + 1.9099 + toString: function() { 1.9100 + return ("DD " + this.id); 1.9101 + } 1.9102 + 1.9103 + 1.9104 + 1.9105 + 1.9106 + 1.9107 + 1.9108 +}); 1.9109 + 1.9110 +Ext.dd.DDProxy = function(id, sGroup, config) { 1.9111 + if (id) { 1.9112 + this.init(id, sGroup, config); 1.9113 + this.initFrame(); 1.9114 + } 1.9115 +}; 1.9116 + 1.9117 + 1.9118 +Ext.dd.DDProxy.dragElId = "ygddfdiv"; 1.9119 + 1.9120 +Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, { 1.9121 + 1.9122 + 1.9123 + resizeFrame: true, 1.9124 + 1.9125 + 1.9126 + centerFrame: false, 1.9127 + 1.9128 + 1.9129 + createFrame: function() { 1.9130 + var self = this; 1.9131 + var body = document.body; 1.9132 + 1.9133 + if (!body || !body.firstChild) { 1.9134 + setTimeout( function() { self.createFrame(); }, 50 ); 1.9135 + return; 1.9136 + } 1.9137 + 1.9138 + var div = this.getDragEl(); 1.9139 + 1.9140 + if (!div) { 1.9141 + div = document.createElement("div"); 1.9142 + div.id = this.dragElId; 1.9143 + var s = div.style; 1.9144 + 1.9145 + s.position = "absolute"; 1.9146 + s.visibility = "hidden"; 1.9147 + s.cursor = "move"; 1.9148 + s.border = "2px solid #aaa"; 1.9149 + s.zIndex = 999; 1.9150 + 1.9151 + 1.9152 + 1.9153 + 1.9154 + body.insertBefore(div, body.firstChild); 1.9155 + } 1.9156 + }, 1.9157 + 1.9158 + 1.9159 + initFrame: function() { 1.9160 + this.createFrame(); 1.9161 + }, 1.9162 + 1.9163 + applyConfig: function() { 1.9164 + Ext.dd.DDProxy.superclass.applyConfig.call(this); 1.9165 + 1.9166 + this.resizeFrame = (this.config.resizeFrame !== false); 1.9167 + this.centerFrame = (this.config.centerFrame); 1.9168 + this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId); 1.9169 + }, 1.9170 + 1.9171 + 1.9172 + showFrame: function(iPageX, iPageY) { 1.9173 + var el = this.getEl(); 1.9174 + var dragEl = this.getDragEl(); 1.9175 + var s = dragEl.style; 1.9176 + 1.9177 + this._resizeProxy(); 1.9178 + 1.9179 + if (this.centerFrame) { 1.9180 + this.setDelta( Math.round(parseInt(s.width, 10)/2), 1.9181 + Math.round(parseInt(s.height, 10)/2) ); 1.9182 + } 1.9183 + 1.9184 + this.setDragElPos(iPageX, iPageY); 1.9185 + 1.9186 + Ext.fly(dragEl).show(); 1.9187 + }, 1.9188 + 1.9189 + 1.9190 + _resizeProxy: function() { 1.9191 + if (this.resizeFrame) { 1.9192 + var el = this.getEl(); 1.9193 + Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight); 1.9194 + } 1.9195 + }, 1.9196 + 1.9197 + 1.9198 + b4MouseDown: function(e) { 1.9199 + var x = e.getPageX(); 1.9200 + var y = e.getPageY(); 1.9201 + this.autoOffset(x, y); 1.9202 + this.setDragElPos(x, y); 1.9203 + }, 1.9204 + 1.9205 + 1.9206 + b4StartDrag: function(x, y) { 1.9207 + 1.9208 + this.showFrame(x, y); 1.9209 + }, 1.9210 + 1.9211 + 1.9212 + b4EndDrag: function(e) { 1.9213 + Ext.fly(this.getDragEl()).hide(); 1.9214 + }, 1.9215 + 1.9216 + 1.9217 + 1.9218 + 1.9219 + endDrag: function(e) { 1.9220 + 1.9221 + var lel = this.getEl(); 1.9222 + var del = this.getDragEl(); 1.9223 + 1.9224 + 1.9225 + del.style.visibility = ""; 1.9226 + 1.9227 + this.beforeMove(); 1.9228 + 1.9229 + 1.9230 + lel.style.visibility = "hidden"; 1.9231 + Ext.dd.DDM.moveToEl(lel, del); 1.9232 + del.style.visibility = "hidden"; 1.9233 + lel.style.visibility = ""; 1.9234 + 1.9235 + this.afterDrag(); 1.9236 + }, 1.9237 + 1.9238 + beforeMove : function(){ 1.9239 + 1.9240 + }, 1.9241 + 1.9242 + afterDrag : function(){ 1.9243 + 1.9244 + }, 1.9245 + 1.9246 + toString: function() { 1.9247 + return ("DDProxy " + this.id); 1.9248 + } 1.9249 + 1.9250 +}); 1.9251 + 1.9252 +Ext.dd.DDTarget = function(id, sGroup, config) { 1.9253 + if (id) { 1.9254 + this.initTarget(id, sGroup, config); 1.9255 + } 1.9256 +}; 1.9257 + 1.9258 + 1.9259 +Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, { 1.9260 + toString: function() { 1.9261 + return ("DDTarget " + this.id); 1.9262 + } 1.9263 +}); 1.9264 + 1.9265 +Ext.dd.DragTracker = function(config){ 1.9266 + Ext.apply(this, config); 1.9267 + this.addEvents( 1.9268 + 'mousedown', 1.9269 + 'mouseup', 1.9270 + 'mousemove', 1.9271 + 'dragstart', 1.9272 + 'dragend', 1.9273 + 'drag' 1.9274 + ); 1.9275 + 1.9276 + this.dragRegion = new Ext.lib.Region(0,0,0,0); 1.9277 + 1.9278 + if(this.el){ 1.9279 + this.initEl(this.el); 1.9280 + } 1.9281 +} 1.9282 + 1.9283 +Ext.extend(Ext.dd.DragTracker, Ext.util.Observable, { 1.9284 + active: false, 1.9285 + tolerance: 5, 1.9286 + autoStart: false, 1.9287 + 1.9288 + initEl: function(el){ 1.9289 + this.el = Ext.get(el); 1.9290 + el.on('mousedown', this.onMouseDown, this, 1.9291 + this.delegate ? {delegate: this.delegate} : undefined); 1.9292 + }, 1.9293 + 1.9294 + destroy : function(){ 1.9295 + this.el.un('mousedown', this.onMouseDown, this); 1.9296 + }, 1.9297 + 1.9298 + onMouseDown: function(e, target){ 1.9299 + if(this.fireEvent('mousedown', this, e) !== false && this.onBeforeStart(e) !== false){ 1.9300 + this.startXY = this.lastXY = e.getXY(); 1.9301 + this.dragTarget = this.delegate ? target : this.el.dom; 1.9302 + e.preventDefault(); 1.9303 + var doc = Ext.getDoc(); 1.9304 + doc.on('mouseup', this.onMouseUp, this); 1.9305 + doc.on('mousemove', this.onMouseMove, this); 1.9306 + doc.on('selectstart', this.stopSelect, this); 1.9307 + if(this.autoStart){ 1.9308 + this.timer = this.triggerStart.defer(this.autoStart === true ? 1000 : this.autoStart, this); 1.9309 + } 1.9310 + } 1.9311 + }, 1.9312 + 1.9313 + onMouseMove: function(e, target){ 1.9314 + e.preventDefault(); 1.9315 + var xy = e.getXY(), s = this.startXY; 1.9316 + this.lastXY = xy; 1.9317 + if(!this.active){ 1.9318 + if(Math.abs(s[0]-xy[0]) > this.tolerance || Math.abs(s[1]-xy[1]) > this.tolerance){ 1.9319 + this.triggerStart(); 1.9320 + }else{ 1.9321 + return; 1.9322 + } 1.9323 + } 1.9324 + this.fireEvent('mousemove', this, e); 1.9325 + this.onDrag(e); 1.9326 + this.fireEvent('drag', this, e); 1.9327 + }, 1.9328 + 1.9329 + onMouseUp: function(e){ 1.9330 + var doc = Ext.getDoc(); 1.9331 + doc.un('mousemove', this.onMouseMove, this); 1.9332 + doc.un('mouseup', this.onMouseUp, this); 1.9333 + doc.un('selectstart', this.stopSelect, this); 1.9334 + e.preventDefault(); 1.9335 + this.clearStart(); 1.9336 + this.active = false; 1.9337 + delete this.elRegion; 1.9338 + this.fireEvent('mouseup', this, e); 1.9339 + this.onEnd(e); 1.9340 + this.fireEvent('dragend', this, e); 1.9341 + }, 1.9342 + 1.9343 + triggerStart: function(isTimer){ 1.9344 + this.clearStart(); 1.9345 + this.active = true; 1.9346 + this.onStart(this.startXY); 1.9347 + this.fireEvent('dragstart', this, this.startXY); 1.9348 + }, 1.9349 + 1.9350 + clearStart : function(){ 1.9351 + if(this.timer){ 1.9352 + clearTimeout(this.timer); 1.9353 + delete this.timer; 1.9354 + } 1.9355 + }, 1.9356 + 1.9357 + stopSelect : function(e){ 1.9358 + e.stopEvent(); 1.9359 + return false; 1.9360 + }, 1.9361 + 1.9362 + onBeforeStart : function(e){ 1.9363 + 1.9364 + }, 1.9365 + 1.9366 + onStart : function(xy){ 1.9367 + 1.9368 + }, 1.9369 + 1.9370 + onDrag : function(e){ 1.9371 + 1.9372 + }, 1.9373 + 1.9374 + onEnd : function(e){ 1.9375 + 1.9376 + }, 1.9377 + 1.9378 + getDragTarget : function(){ 1.9379 + return this.dragTarget; 1.9380 + }, 1.9381 + 1.9382 + getDragCt : function(){ 1.9383 + return this.el; 1.9384 + }, 1.9385 + 1.9386 + getXY : function(constrain){ 1.9387 + return constrain ? 1.9388 + this.constrainModes[constrain].call(this, this.lastXY) : this.lastXY; 1.9389 + }, 1.9390 + 1.9391 + getOffset : function(constrain){ 1.9392 + var xy = this.getXY(constrain); 1.9393 + var s = this.startXY; 1.9394 + return [s[0]-xy[0], s[1]-xy[1]]; 1.9395 + }, 1.9396 + 1.9397 + constrainModes: { 1.9398 + 'point' : function(xy){ 1.9399 + 1.9400 + if(!this.elRegion){ 1.9401 + this.elRegion = this.getDragCt().getRegion(); 1.9402 + } 1.9403 + 1.9404 + var dr = this.dragRegion; 1.9405 + 1.9406 + dr.left = xy[0]; 1.9407 + dr.top = xy[1]; 1.9408 + dr.right = xy[0]; 1.9409 + dr.bottom = xy[1]; 1.9410 + 1.9411 + dr.constrainTo(this.elRegion); 1.9412 + 1.9413 + return [dr.left, dr.top]; 1.9414 + } 1.9415 + } 1.9416 +}); 1.9417 + 1.9418 +Ext.dd.ScrollManager = function(){ 1.9419 + var ddm = Ext.dd.DragDropMgr; 1.9420 + var els = {}; 1.9421 + var dragEl = null; 1.9422 + var proc = {}; 1.9423 + 1.9424 + var onStop = function(e){ 1.9425 + dragEl = null; 1.9426 + clearProc(); 1.9427 + }; 1.9428 + 1.9429 + var triggerRefresh = function(){ 1.9430 + if(ddm.dragCurrent){ 1.9431 + ddm.refreshCache(ddm.dragCurrent.groups); 1.9432 + } 1.9433 + }; 1.9434 + 1.9435 + var doScroll = function(){ 1.9436 + if(ddm.dragCurrent){ 1.9437 + var dds = Ext.dd.ScrollManager; 1.9438 + var inc = proc.el.ddScrollConfig ? 1.9439 + proc.el.ddScrollConfig.increment : dds.increment; 1.9440 + if(!dds.animate){ 1.9441 + if(proc.el.scroll(proc.dir, inc)){ 1.9442 + triggerRefresh(); 1.9443 + } 1.9444 + }else{ 1.9445 + proc.el.scroll(proc.dir, inc, true, dds.animDuration, triggerRefresh); 1.9446 + } 1.9447 + } 1.9448 + }; 1.9449 + 1.9450 + var clearProc = function(){ 1.9451 + if(proc.id){ 1.9452 + clearInterval(proc.id); 1.9453 + } 1.9454 + proc.id = 0; 1.9455 + proc.el = null; 1.9456 + proc.dir = ""; 1.9457 + }; 1.9458 + 1.9459 + var startProc = function(el, dir){ 1.9460 + clearProc(); 1.9461 + proc.el = el; 1.9462 + proc.dir = dir; 1.9463 + proc.id = setInterval(doScroll, Ext.dd.ScrollManager.frequency); 1.9464 + }; 1.9465 + 1.9466 + var onFire = function(e, isDrop){ 1.9467 + if(isDrop || !ddm.dragCurrent){ return; } 1.9468 + var dds = Ext.dd.ScrollManager; 1.9469 + if(!dragEl || dragEl != ddm.dragCurrent){ 1.9470 + dragEl = ddm.dragCurrent; 1.9471 + 1.9472 + dds.refreshCache(); 1.9473 + } 1.9474 + 1.9475 + var xy = Ext.lib.Event.getXY(e); 1.9476 + var pt = new Ext.lib.Point(xy[0], xy[1]); 1.9477 + for(var id in els){ 1.9478 + var el = els[id], r = el._region; 1.9479 + var c = el.ddScrollConfig ? el.ddScrollConfig : dds; 1.9480 + if(r && r.contains(pt) && el.isScrollable()){ 1.9481 + if(r.bottom - pt.y <= c.vthresh){ 1.9482 + if(proc.el != el){ 1.9483 + startProc(el, "down"); 1.9484 + } 1.9485 + return; 1.9486 + }else if(r.right - pt.x <= c.hthresh){ 1.9487 + if(proc.el != el){ 1.9488 + startProc(el, "left"); 1.9489 + } 1.9490 + return; 1.9491 + }else if(pt.y - r.top <= c.vthresh){ 1.9492 + if(proc.el != el){ 1.9493 + startProc(el, "up"); 1.9494 + } 1.9495 + return; 1.9496 + }else if(pt.x - r.left <= c.hthresh){ 1.9497 + if(proc.el != el){ 1.9498 + startProc(el, "right"); 1.9499 + } 1.9500 + return; 1.9501 + } 1.9502 + } 1.9503 + } 1.9504 + clearProc(); 1.9505 + }; 1.9506 + 1.9507 + ddm.fireEvents = ddm.fireEvents.createSequence(onFire, ddm); 1.9508 + ddm.stopDrag = ddm.stopDrag.createSequence(onStop, ddm); 1.9509 + 1.9510 + return { 1.9511 + 1.9512 + register : function(el){ 1.9513 + if(Ext.isArray(el)){ 1.9514 + for(var i = 0, len = el.length; i < len; i++) { 1.9515 + this.register(el[i]); 1.9516 + } 1.9517 + }else{ 1.9518 + el = Ext.get(el); 1.9519 + els[el.id] = el; 1.9520 + } 1.9521 + }, 1.9522 + 1.9523 + 1.9524 + unregister : function(el){ 1.9525 + if(Ext.isArray(el)){ 1.9526 + for(var i = 0, len = el.length; i < len; i++) { 1.9527 + this.unregister(el[i]); 1.9528 + } 1.9529 + }else{ 1.9530 + el = Ext.get(el); 1.9531 + delete els[el.id]; 1.9532 + } 1.9533 + }, 1.9534 + 1.9535 + 1.9536 + vthresh : 25, 1.9537 + 1.9538 + hthresh : 25, 1.9539 + 1.9540 + 1.9541 + increment : 100, 1.9542 + 1.9543 + 1.9544 + frequency : 500, 1.9545 + 1.9546 + 1.9547 + animate: true, 1.9548 + 1.9549 + 1.9550 + animDuration: .4, 1.9551 + 1.9552 + 1.9553 + refreshCache : function(){ 1.9554 + for(var id in els){ 1.9555 + if(typeof els[id] == 'object'){ 1.9556 + els[id]._region = els[id].getRegion(); 1.9557 + } 1.9558 + } 1.9559 + } 1.9560 + }; 1.9561 +}(); 1.9562 + 1.9563 +Ext.dd.Registry = function(){ 1.9564 + var elements = {}; 1.9565 + var handles = {}; 1.9566 + var autoIdSeed = 0; 1.9567 + 1.9568 + var getId = function(el, autogen){ 1.9569 + if(typeof el == "string"){ 1.9570 + return el; 1.9571 + } 1.9572 + var id = el.id; 1.9573 + if(!id && autogen !== false){ 1.9574 + id = "extdd-" + (++autoIdSeed); 1.9575 + el.id = id; 1.9576 + } 1.9577 + return id; 1.9578 + }; 1.9579 + 1.9580 + return { 1.9581 + 1.9582 + register : function(el, data){ 1.9583 + data = data || {}; 1.9584 + if(typeof el == "string"){ 1.9585 + el = document.getElementById(el); 1.9586 + } 1.9587 + data.ddel = el; 1.9588 + elements[getId(el)] = data; 1.9589 + if(data.isHandle !== false){ 1.9590 + handles[data.ddel.id] = data; 1.9591 + } 1.9592 + if(data.handles){ 1.9593 + var hs = data.handles; 1.9594 + for(var i = 0, len = hs.length; i < len; i++){ 1.9595 + handles[getId(hs[i])] = data; 1.9596 + } 1.9597 + } 1.9598 + }, 1.9599 + 1.9600 + 1.9601 + unregister : function(el){ 1.9602 + var id = getId(el, false); 1.9603 + var data = elements[id]; 1.9604 + if(data){ 1.9605 + delete elements[id]; 1.9606 + if(data.handles){ 1.9607 + var hs = data.handles; 1.9608 + for(var i = 0, len = hs.length; i < len; i++){ 1.9609 + delete handles[getId(hs[i], false)]; 1.9610 + } 1.9611 + } 1.9612 + } 1.9613 + }, 1.9614 + 1.9615 + 1.9616 + getHandle : function(id){ 1.9617 + if(typeof id != "string"){ 1.9618 + id = id.id; 1.9619 + } 1.9620 + return handles[id]; 1.9621 + }, 1.9622 + 1.9623 + 1.9624 + getHandleFromEvent : function(e){ 1.9625 + var t = Ext.lib.Event.getTarget(e); 1.9626 + return t ? handles[t.id] : null; 1.9627 + }, 1.9628 + 1.9629 + 1.9630 + getTarget : function(id){ 1.9631 + if(typeof id != "string"){ 1.9632 + id = id.id; 1.9633 + } 1.9634 + return elements[id]; 1.9635 + }, 1.9636 + 1.9637 + 1.9638 + getTargetFromEvent : function(e){ 1.9639 + var t = Ext.lib.Event.getTarget(e); 1.9640 + return t ? elements[t.id] || handles[t.id] : null; 1.9641 + } 1.9642 + }; 1.9643 +}(); 1.9644 + 1.9645 +Ext.dd.StatusProxy = function(config){ 1.9646 + Ext.apply(this, config); 1.9647 + this.id = this.id || Ext.id(); 1.9648 + this.el = new Ext.Layer({ 1.9649 + dh: { 1.9650 + id: this.id, tag: "div", cls: "x-dd-drag-proxy "+this.dropNotAllowed, children: [ 1.9651 + {tag: "div", cls: "x-dd-drop-icon"}, 1.9652 + {tag: "div", cls: "x-dd-drag-ghost"} 1.9653 + ] 1.9654 + }, 1.9655 + shadow: !config || config.shadow !== false 1.9656 + }); 1.9657 + this.ghost = Ext.get(this.el.dom.childNodes[1]); 1.9658 + this.dropStatus = this.dropNotAllowed; 1.9659 +}; 1.9660 + 1.9661 +Ext.dd.StatusProxy.prototype = { 1.9662 + 1.9663 + dropAllowed : "x-dd-drop-ok", 1.9664 + 1.9665 + dropNotAllowed : "x-dd-drop-nodrop", 1.9666 + 1.9667 + 1.9668 + setStatus : function(cssClass){ 1.9669 + cssClass = cssClass || this.dropNotAllowed; 1.9670 + if(this.dropStatus != cssClass){ 1.9671 + this.el.replaceClass(this.dropStatus, cssClass); 1.9672 + this.dropStatus = cssClass; 1.9673 + } 1.9674 + }, 1.9675 + 1.9676 + 1.9677 + reset : function(clearGhost){ 1.9678 + this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed; 1.9679 + this.dropStatus = this.dropNotAllowed; 1.9680 + if(clearGhost){ 1.9681 + this.ghost.update(""); 1.9682 + } 1.9683 + }, 1.9684 + 1.9685 + 1.9686 + update : function(html){ 1.9687 + if(typeof html == "string"){ 1.9688 + this.ghost.update(html); 1.9689 + }else{ 1.9690 + this.ghost.update(""); 1.9691 + html.style.margin = "0"; 1.9692 + this.ghost.dom.appendChild(html); 1.9693 + } 1.9694 + }, 1.9695 + 1.9696 + 1.9697 + getEl : function(){ 1.9698 + return this.el; 1.9699 + }, 1.9700 + 1.9701 + 1.9702 + getGhost : function(){ 1.9703 + return this.ghost; 1.9704 + }, 1.9705 + 1.9706 + 1.9707 + hide : function(clear){ 1.9708 + this.el.hide(); 1.9709 + if(clear){ 1.9710 + this.reset(true); 1.9711 + } 1.9712 + }, 1.9713 + 1.9714 + 1.9715 + stop : function(){ 1.9716 + if(this.anim && this.anim.isAnimated && this.anim.isAnimated()){ 1.9717 + this.anim.stop(); 1.9718 + } 1.9719 + }, 1.9720 + 1.9721 + 1.9722 + show : function(){ 1.9723 + this.el.show(); 1.9724 + }, 1.9725 + 1.9726 + 1.9727 + sync : function(){ 1.9728 + this.el.sync(); 1.9729 + }, 1.9730 + 1.9731 + 1.9732 + repair : function(xy, callback, scope){ 1.9733 + this.callback = callback; 1.9734 + this.scope = scope; 1.9735 + if(xy && this.animRepair !== false){ 1.9736 + this.el.addClass("x-dd-drag-repair"); 1.9737 + this.el.hideUnders(true); 1.9738 + this.anim = this.el.shift({ 1.9739 + duration: this.repairDuration || .5, 1.9740 + easing: 'easeOut', 1.9741 + xy: xy, 1.9742 + stopFx: true, 1.9743 + callback: this.afterRepair, 1.9744 + scope: this 1.9745 + }); 1.9746 + }else{ 1.9747 + this.afterRepair(); 1.9748 + } 1.9749 + }, 1.9750 + 1.9751 + 1.9752 + afterRepair : function(){ 1.9753 + this.hide(true); 1.9754 + if(typeof this.callback == "function"){ 1.9755 + this.callback.call(this.scope || this); 1.9756 + } 1.9757 + this.callback = null; 1.9758 + this.scope = null; 1.9759 + } 1.9760 +}; 1.9761 + 1.9762 +Ext.dd.DragSource = function(el, config){ 1.9763 + this.el = Ext.get(el); 1.9764 + if(!this.dragData){ 1.9765 + this.dragData = {}; 1.9766 + } 1.9767 + 1.9768 + Ext.apply(this, config); 1.9769 + 1.9770 + if(!this.proxy){ 1.9771 + this.proxy = new Ext.dd.StatusProxy(); 1.9772 + } 1.9773 + Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, 1.9774 + {dragElId : this.proxy.id, resizeFrame: false, isTarget: false, scroll: this.scroll === true}); 1.9775 + 1.9776 + this.dragging = false; 1.9777 +}; 1.9778 + 1.9779 +Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { 1.9780 + 1.9781 + 1.9782 + dropAllowed : "x-dd-drop-ok", 1.9783 + 1.9784 + dropNotAllowed : "x-dd-drop-nodrop", 1.9785 + 1.9786 + 1.9787 + getDragData : function(e){ 1.9788 + return this.dragData; 1.9789 + }, 1.9790 + 1.9791 + 1.9792 + onDragEnter : function(e, id){ 1.9793 + var target = Ext.dd.DragDropMgr.getDDById(id); 1.9794 + this.cachedTarget = target; 1.9795 + if(this.beforeDragEnter(target, e, id) !== false){ 1.9796 + if(target.isNotifyTarget){ 1.9797 + var status = target.notifyEnter(this, e, this.dragData); 1.9798 + this.proxy.setStatus(status); 1.9799 + }else{ 1.9800 + this.proxy.setStatus(this.dropAllowed); 1.9801 + } 1.9802 + 1.9803 + if(this.afterDragEnter){ 1.9804 + 1.9805 + this.afterDragEnter(target, e, id); 1.9806 + } 1.9807 + } 1.9808 + }, 1.9809 + 1.9810 + 1.9811 + beforeDragEnter : function(target, e, id){ 1.9812 + return true; 1.9813 + }, 1.9814 + 1.9815 + 1.9816 + alignElWithMouse: function() { 1.9817 + Ext.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments); 1.9818 + this.proxy.sync(); 1.9819 + }, 1.9820 + 1.9821 + 1.9822 + onDragOver : function(e, id){ 1.9823 + var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); 1.9824 + if(this.beforeDragOver(target, e, id) !== false){ 1.9825 + if(target.isNotifyTarget){ 1.9826 + var status = target.notifyOver(this, e, this.dragData); 1.9827 + this.proxy.setStatus(status); 1.9828 + } 1.9829 + 1.9830 + if(this.afterDragOver){ 1.9831 + 1.9832 + this.afterDragOver(target, e, id); 1.9833 + } 1.9834 + } 1.9835 + }, 1.9836 + 1.9837 + 1.9838 + beforeDragOver : function(target, e, id){ 1.9839 + return true; 1.9840 + }, 1.9841 + 1.9842 + 1.9843 + onDragOut : function(e, id){ 1.9844 + var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); 1.9845 + if(this.beforeDragOut(target, e, id) !== false){ 1.9846 + if(target.isNotifyTarget){ 1.9847 + target.notifyOut(this, e, this.dragData); 1.9848 + } 1.9849 + this.proxy.reset(); 1.9850 + if(this.afterDragOut){ 1.9851 + 1.9852 + this.afterDragOut(target, e, id); 1.9853 + } 1.9854 + } 1.9855 + this.cachedTarget = null; 1.9856 + }, 1.9857 + 1.9858 + 1.9859 + beforeDragOut : function(target, e, id){ 1.9860 + return true; 1.9861 + }, 1.9862 + 1.9863 + 1.9864 + onDragDrop : function(e, id){ 1.9865 + var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id); 1.9866 + if(this.beforeDragDrop(target, e, id) !== false){ 1.9867 + if(target.isNotifyTarget){ 1.9868 + if(target.notifyDrop(this, e, this.dragData)){ 1.9869 + this.onValidDrop(target, e, id); 1.9870 + }else{ 1.9871 + this.onInvalidDrop(target, e, id); 1.9872 + } 1.9873 + }else{ 1.9874 + this.onValidDrop(target, e, id); 1.9875 + } 1.9876 + 1.9877 + if(this.afterDragDrop){ 1.9878 + 1.9879 + this.afterDragDrop(target, e, id); 1.9880 + } 1.9881 + } 1.9882 + delete this.cachedTarget; 1.9883 + }, 1.9884 + 1.9885 + 1.9886 + beforeDragDrop : function(target, e, id){ 1.9887 + return true; 1.9888 + }, 1.9889 + 1.9890 + 1.9891 + onValidDrop : function(target, e, id){ 1.9892 + this.hideProxy(); 1.9893 + if(this.afterValidDrop){ 1.9894 + 1.9895 + this.afterValidDrop(target, e, id); 1.9896 + } 1.9897 + }, 1.9898 + 1.9899 + 1.9900 + getRepairXY : function(e, data){ 1.9901 + return this.el.getXY(); 1.9902 + }, 1.9903 + 1.9904 + 1.9905 + onInvalidDrop : function(target, e, id){ 1.9906 + this.beforeInvalidDrop(target, e, id); 1.9907 + if(this.cachedTarget){ 1.9908 + if(this.cachedTarget.isNotifyTarget){ 1.9909 + this.cachedTarget.notifyOut(this, e, this.dragData); 1.9910 + } 1.9911 + this.cacheTarget = null; 1.9912 + } 1.9913 + this.proxy.repair(this.getRepairXY(e, this.dragData), this.afterRepair, this); 1.9914 + 1.9915 + if(this.afterInvalidDrop){ 1.9916 + 1.9917 + this.afterInvalidDrop(e, id); 1.9918 + } 1.9919 + }, 1.9920 + 1.9921 + 1.9922 + afterRepair : function(){ 1.9923 + if(Ext.enableFx){ 1.9924 + this.el.highlight(this.hlColor || "c3daf9"); 1.9925 + } 1.9926 + this.dragging = false; 1.9927 + }, 1.9928 + 1.9929 + 1.9930 + beforeInvalidDrop : function(target, e, id){ 1.9931 + return true; 1.9932 + }, 1.9933 + 1.9934 + 1.9935 + handleMouseDown : function(e){ 1.9936 + if(this.dragging) { 1.9937 + return; 1.9938 + } 1.9939 + var data = this.getDragData(e); 1.9940 + if(data && this.onBeforeDrag(data, e) !== false){ 1.9941 + this.dragData = data; 1.9942 + this.proxy.stop(); 1.9943 + Ext.dd.DragSource.superclass.handleMouseDown.apply(this, arguments); 1.9944 + } 1.9945 + }, 1.9946 + 1.9947 + 1.9948 + onBeforeDrag : function(data, e){ 1.9949 + return true; 1.9950 + }, 1.9951 + 1.9952 + 1.9953 + onStartDrag : Ext.emptyFn, 1.9954 + 1.9955 + 1.9956 + startDrag : function(x, y){ 1.9957 + this.proxy.reset(); 1.9958 + this.dragging = true; 1.9959 + this.proxy.update(""); 1.9960 + this.onInitDrag(x, y); 1.9961 + this.proxy.show(); 1.9962 + }, 1.9963 + 1.9964 + 1.9965 + onInitDrag : function(x, y){ 1.9966 + var clone = this.el.dom.cloneNode(true); 1.9967 + clone.id = Ext.id(); 1.9968 + this.proxy.update(clone); 1.9969 + this.onStartDrag(x, y); 1.9970 + return true; 1.9971 + }, 1.9972 + 1.9973 + 1.9974 + getProxy : function(){ 1.9975 + return this.proxy; 1.9976 + }, 1.9977 + 1.9978 + 1.9979 + hideProxy : function(){ 1.9980 + this.proxy.hide(); 1.9981 + this.proxy.reset(true); 1.9982 + this.dragging = false; 1.9983 + }, 1.9984 + 1.9985 + 1.9986 + triggerCacheRefresh : function(){ 1.9987 + Ext.dd.DDM.refreshCache(this.groups); 1.9988 + }, 1.9989 + 1.9990 + 1.9991 + b4EndDrag: function(e) { 1.9992 + }, 1.9993 + 1.9994 + 1.9995 + endDrag : function(e){ 1.9996 + this.onEndDrag(this.dragData, e); 1.9997 + }, 1.9998 + 1.9999 + 1.10000 + onEndDrag : function(data, e){ 1.10001 + }, 1.10002 + 1.10003 + 1.10004 + autoOffset : function(x, y) { 1.10005 + this.setDelta(-12, -20); 1.10006 + } 1.10007 +}); 1.10008 + 1.10009 +Ext.dd.DropTarget = function(el, config){ 1.10010 + this.el = Ext.get(el); 1.10011 + 1.10012 + Ext.apply(this, config); 1.10013 + 1.10014 + if(this.containerScroll){ 1.10015 + Ext.dd.ScrollManager.register(this.el); 1.10016 + } 1.10017 + 1.10018 + Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, 1.10019 + {isTarget: true}); 1.10020 + 1.10021 +}; 1.10022 + 1.10023 +Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, { 1.10024 + 1.10025 + 1.10026 + 1.10027 + dropAllowed : "x-dd-drop-ok", 1.10028 + 1.10029 + dropNotAllowed : "x-dd-drop-nodrop", 1.10030 + 1.10031 + 1.10032 + isTarget : true, 1.10033 + 1.10034 + 1.10035 + isNotifyTarget : true, 1.10036 + 1.10037 + 1.10038 + notifyEnter : function(dd, e, data){ 1.10039 + if(this.overClass){ 1.10040 + this.el.addClass(this.overClass); 1.10041 + } 1.10042 + return this.dropAllowed; 1.10043 + }, 1.10044 + 1.10045 + 1.10046 + notifyOver : function(dd, e, data){ 1.10047 + return this.dropAllowed; 1.10048 + }, 1.10049 + 1.10050 + 1.10051 + notifyOut : function(dd, e, data){ 1.10052 + if(this.overClass){ 1.10053 + this.el.removeClass(this.overClass); 1.10054 + } 1.10055 + }, 1.10056 + 1.10057 + 1.10058 + notifyDrop : function(dd, e, data){ 1.10059 + return false; 1.10060 + } 1.10061 +}); 1.10062 + 1.10063 +Ext.dd.DragZone = function(el, config){ 1.10064 + Ext.dd.DragZone.superclass.constructor.call(this, el, config); 1.10065 + if(this.containerScroll){ 1.10066 + Ext.dd.ScrollManager.register(this.el); 1.10067 + } 1.10068 +}; 1.10069 + 1.10070 +Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, { 1.10071 + 1.10072 + 1.10073 + 1.10074 + 1.10075 + getDragData : function(e){ 1.10076 + return Ext.dd.Registry.getHandleFromEvent(e); 1.10077 + }, 1.10078 + 1.10079 + 1.10080 + onInitDrag : function(x, y){ 1.10081 + this.proxy.update(this.dragData.ddel.cloneNode(true)); 1.10082 + this.onStartDrag(x, y); 1.10083 + return true; 1.10084 + }, 1.10085 + 1.10086 + 1.10087 + afterRepair : function(){ 1.10088 + if(Ext.enableFx){ 1.10089 + Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9"); 1.10090 + } 1.10091 + this.dragging = false; 1.10092 + }, 1.10093 + 1.10094 + 1.10095 + getRepairXY : function(e){ 1.10096 + return Ext.Element.fly(this.dragData.ddel).getXY(); 1.10097 + } 1.10098 +}); 1.10099 + 1.10100 +Ext.dd.DropZone = function(el, config){ 1.10101 + Ext.dd.DropZone.superclass.constructor.call(this, el, config); 1.10102 +}; 1.10103 + 1.10104 +Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, { 1.10105 + 1.10106 + getTargetFromEvent : function(e){ 1.10107 + return Ext.dd.Registry.getTargetFromEvent(e); 1.10108 + }, 1.10109 + 1.10110 + 1.10111 + onNodeEnter : function(n, dd, e, data){ 1.10112 + 1.10113 + }, 1.10114 + 1.10115 + 1.10116 + onNodeOver : function(n, dd, e, data){ 1.10117 + return this.dropAllowed; 1.10118 + }, 1.10119 + 1.10120 + 1.10121 + onNodeOut : function(n, dd, e, data){ 1.10122 + 1.10123 + }, 1.10124 + 1.10125 + 1.10126 + onNodeDrop : function(n, dd, e, data){ 1.10127 + return false; 1.10128 + }, 1.10129 + 1.10130 + 1.10131 + onContainerOver : function(dd, e, data){ 1.10132 + return this.dropNotAllowed; 1.10133 + }, 1.10134 + 1.10135 + 1.10136 + onContainerDrop : function(dd, e, data){ 1.10137 + return false; 1.10138 + }, 1.10139 + 1.10140 + 1.10141 + notifyEnter : function(dd, e, data){ 1.10142 + return this.dropNotAllowed; 1.10143 + }, 1.10144 + 1.10145 + 1.10146 + notifyOver : function(dd, e, data){ 1.10147 + var n = this.getTargetFromEvent(e); 1.10148 + if(!n){ 1.10149 + if(this.lastOverNode){ 1.10150 + this.onNodeOut(this.lastOverNode, dd, e, data); 1.10151 + this.lastOverNode = null; 1.10152 + } 1.10153 + return this.onContainerOver(dd, e, data); 1.10154 + } 1.10155 + if(this.lastOverNode != n){ 1.10156 + if(this.lastOverNode){ 1.10157 + this.onNodeOut(this.lastOverNode, dd, e, data); 1.10158 + } 1.10159 + this.onNodeEnter(n, dd, e, data); 1.10160 + this.lastOverNode = n; 1.10161 + } 1.10162 + return this.onNodeOver(n, dd, e, data); 1.10163 + }, 1.10164 + 1.10165 + 1.10166 + notifyOut : function(dd, e, data){ 1.10167 + if(this.lastOverNode){ 1.10168 + this.onNodeOut(this.lastOverNode, dd, e, data); 1.10169 + this.lastOverNode = null; 1.10170 + } 1.10171 + }, 1.10172 + 1.10173 + 1.10174 + notifyDrop : function(dd, e, data){ 1.10175 + if(this.lastOverNode){ 1.10176 + this.onNodeOut(this.lastOverNode, dd, e, data); 1.10177 + this.lastOverNode = null; 1.10178 + } 1.10179 + var n = this.getTargetFromEvent(e); 1.10180 + return n ? 1.10181 + this.onNodeDrop(n, dd, e, data) : 1.10182 + this.onContainerDrop(dd, e, data); 1.10183 + }, 1.10184 + 1.10185 + 1.10186 + triggerCacheRefresh : function(){ 1.10187 + Ext.dd.DDM.refreshCache(this.groups); 1.10188 + } 1.10189 +}); 1.10190 + 1.10191 + 1.10192 +Ext.data.SortTypes = { 1.10193 + 1.10194 + none : function(s){ 1.10195 + return s; 1.10196 + }, 1.10197 + 1.10198 + 1.10199 + stripTagsRE : /<\/?[^>]+>/gi, 1.10200 + 1.10201 + 1.10202 + asText : function(s){ 1.10203 + return String(s).replace(this.stripTagsRE, ""); 1.10204 + }, 1.10205 + 1.10206 + 1.10207 + asUCText : function(s){ 1.10208 + return String(s).toUpperCase().replace(this.stripTagsRE, ""); 1.10209 + }, 1.10210 + 1.10211 + 1.10212 + asUCString : function(s) { 1.10213 + return String(s).toUpperCase(); 1.10214 + }, 1.10215 + 1.10216 + 1.10217 + asDate : function(s) { 1.10218 + if(!s){ 1.10219 + return 0; 1.10220 + } 1.10221 + if(Ext.isDate(s)){ 1.10222 + return s.getTime(); 1.10223 + } 1.10224 + return Date.parse(String(s)); 1.10225 + }, 1.10226 + 1.10227 + 1.10228 + asFloat : function(s) { 1.10229 + var val = parseFloat(String(s).replace(/,/g, "")); 1.10230 + if(isNaN(val)) val = 0; 1.10231 + return val; 1.10232 + }, 1.10233 + 1.10234 + 1.10235 + asInt : function(s) { 1.10236 + var val = parseInt(String(s).replace(/,/g, "")); 1.10237 + if(isNaN(val)) val = 0; 1.10238 + return val; 1.10239 + } 1.10240 +}; 1.10241 + 1.10242 +Ext.data.Record = function(data, id){ 1.10243 + this.id = (id || id === 0) ? id : ++Ext.data.Record.AUTO_ID; 1.10244 + this.data = data; 1.10245 +}; 1.10246 + 1.10247 + 1.10248 +Ext.data.Record.create = function(o){ 1.10249 + var f = Ext.extend(Ext.data.Record, {}); 1.10250 + var p = f.prototype; 1.10251 + p.fields = new Ext.util.MixedCollection(false, function(field){ 1.10252 + return field.name; 1.10253 + }); 1.10254 + for(var i = 0, len = o.length; i < len; i++){ 1.10255 + p.fields.add(new Ext.data.Field(o[i])); 1.10256 + } 1.10257 + f.getField = function(name){ 1.10258 + return p.fields.get(name); 1.10259 + }; 1.10260 + return f; 1.10261 +}; 1.10262 + 1.10263 +Ext.data.Record.AUTO_ID = 1000; 1.10264 +Ext.data.Record.EDIT = 'edit'; 1.10265 +Ext.data.Record.REJECT = 'reject'; 1.10266 +Ext.data.Record.COMMIT = 'commit'; 1.10267 + 1.10268 +Ext.data.Record.prototype = { 1.10269 + 1.10270 + 1.10271 + 1.10272 + dirty : false, 1.10273 + editing : false, 1.10274 + error: null, 1.10275 + 1.10276 + modified: null, 1.10277 + 1.10278 + join : function(store){ 1.10279 + this.store = store; 1.10280 + }, 1.10281 + 1.10282 + 1.10283 + set : function(name, value){ 1.10284 + if(String(this.data[name]) == String(value)){ 1.10285 + return; 1.10286 + } 1.10287 + this.dirty = true; 1.10288 + if(!this.modified){ 1.10289 + this.modified = {}; 1.10290 + } 1.10291 + if(typeof this.modified[name] == 'undefined'){ 1.10292 + this.modified[name] = this.data[name]; 1.10293 + } 1.10294 + this.data[name] = value; 1.10295 + if(!this.editing && this.store){ 1.10296 + this.store.afterEdit(this); 1.10297 + } 1.10298 + }, 1.10299 + 1.10300 + 1.10301 + get : function(name){ 1.10302 + return this.data[name]; 1.10303 + }, 1.10304 + 1.10305 + 1.10306 + beginEdit : function(){ 1.10307 + this.editing = true; 1.10308 + this.modified = {}; 1.10309 + }, 1.10310 + 1.10311 + 1.10312 + cancelEdit : function(){ 1.10313 + this.editing = false; 1.10314 + delete this.modified; 1.10315 + }, 1.10316 + 1.10317 + 1.10318 + endEdit : function(){ 1.10319 + this.editing = false; 1.10320 + if(this.dirty && this.store){ 1.10321 + this.store.afterEdit(this); 1.10322 + } 1.10323 + }, 1.10324 + 1.10325 + 1.10326 + reject : function(silent){ 1.10327 + var m = this.modified; 1.10328 + for(var n in m){ 1.10329 + if(typeof m[n] != "function"){ 1.10330 + this.data[n] = m[n]; 1.10331 + } 1.10332 + } 1.10333 + this.dirty = false; 1.10334 + delete this.modified; 1.10335 + this.editing = false; 1.10336 + if(this.store && silent !== true){ 1.10337 + this.store.afterReject(this); 1.10338 + } 1.10339 + }, 1.10340 + 1.10341 + 1.10342 + commit : function(silent){ 1.10343 + this.dirty = false; 1.10344 + delete this.modified; 1.10345 + this.editing = false; 1.10346 + if(this.store && silent !== true){ 1.10347 + this.store.afterCommit(this); 1.10348 + } 1.10349 + }, 1.10350 + 1.10351 + 1.10352 + getChanges : function(){ 1.10353 + var m = this.modified, cs = {}; 1.10354 + for(var n in m){ 1.10355 + if(m.hasOwnProperty(n)){ 1.10356 + cs[n] = this.data[n]; 1.10357 + } 1.10358 + } 1.10359 + return cs; 1.10360 + }, 1.10361 + 1.10362 + hasError : function(){ 1.10363 + return this.error != null; 1.10364 + }, 1.10365 + 1.10366 + clearError : function(){ 1.10367 + this.error = null; 1.10368 + }, 1.10369 + 1.10370 + 1.10371 + copy : function(newId) { 1.10372 + return new this.constructor(Ext.apply({}, this.data), newId || this.id); 1.10373 + }, 1.10374 + 1.10375 + 1.10376 + isModified : function(fieldName){ 1.10377 + return this.modified && this.modified.hasOwnProperty(fieldName); 1.10378 + } 1.10379 +}; 1.10380 + 1.10381 +Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), { 1.10382 + 1.10383 + 1.10384 + 1.10385 + register : function(){ 1.10386 + for(var i = 0, s; s = arguments[i]; i++){ 1.10387 + this.add(s); 1.10388 + } 1.10389 + }, 1.10390 + 1.10391 + 1.10392 + unregister : function(){ 1.10393 + for(var i = 0, s; s = arguments[i]; i++){ 1.10394 + this.remove(this.lookup(s)); 1.10395 + } 1.10396 + }, 1.10397 + 1.10398 + 1.10399 + lookup : function(id){ 1.10400 + return typeof id == "object" ? id : this.get(id); 1.10401 + }, 1.10402 + 1.10403 + getKey : function(o){ 1.10404 + return o.storeId || o.id; 1.10405 + } 1.10406 +}); 1.10407 + 1.10408 +Ext.data.Store = function(config){ 1.10409 + this.data = new Ext.util.MixedCollection(false); 1.10410 + this.data.getKey = function(o){ 1.10411 + return o.id; 1.10412 + }; 1.10413 + 1.10414 + this.baseParams = {}; 1.10415 + this.paramNames = { 1.10416 + "start" : "start", 1.10417 + "limit" : "limit", 1.10418 + "sort" : "sort", 1.10419 + "dir" : "dir" 1.10420 + }; 1.10421 + 1.10422 + if(config && config.data){ 1.10423 + this.inlineData = config.data; 1.10424 + delete config.data; 1.10425 + } 1.10426 + 1.10427 + Ext.apply(this, config); 1.10428 + 1.10429 + if(this.url && !this.proxy){ 1.10430 + this.proxy = new Ext.data.HttpProxy({url: this.url}); 1.10431 + } 1.10432 + 1.10433 + if(this.reader){ if(!this.recordType){ 1.10434 + this.recordType = this.reader.recordType; 1.10435 + } 1.10436 + if(this.reader.onMetaChange){ 1.10437 + this.reader.onMetaChange = this.onMetaChange.createDelegate(this); 1.10438 + } 1.10439 + } 1.10440 + 1.10441 + if(this.recordType){ 1.10442 + this.fields = this.recordType.prototype.fields; 1.10443 + } 1.10444 + this.modified = []; 1.10445 + 1.10446 + this.addEvents( 1.10447 + 1.10448 + 'datachanged', 1.10449 + 1.10450 + 'metachange', 1.10451 + 1.10452 + 'add', 1.10453 + 1.10454 + 'remove', 1.10455 + 1.10456 + 'update', 1.10457 + 1.10458 + 'clear', 1.10459 + 1.10460 + 'beforeload', 1.10461 + 1.10462 + 'load', 1.10463 + 1.10464 + 'loadexception' 1.10465 + ); 1.10466 + 1.10467 + if(this.proxy){ 1.10468 + this.relayEvents(this.proxy, ["loadexception"]); 1.10469 + } 1.10470 + 1.10471 + this.sortToggle = {}; 1.10472 + if(this.sortInfo){ 1.10473 + this.setDefaultSort(this.sortInfo.field, this.sortInfo.direction); 1.10474 + } 1.10475 + 1.10476 + Ext.data.Store.superclass.constructor.call(this); 1.10477 + 1.10478 + if(this.storeId || this.id){ 1.10479 + Ext.StoreMgr.register(this); 1.10480 + } 1.10481 + if(this.inlineData){ 1.10482 + this.loadData(this.inlineData); 1.10483 + delete this.inlineData; 1.10484 + }else if(this.autoLoad){ 1.10485 + this.load.defer(10, this, [ 1.10486 + typeof this.autoLoad == 'object' ? 1.10487 + this.autoLoad : undefined]); 1.10488 + } 1.10489 +}; 1.10490 +Ext.extend(Ext.data.Store, Ext.util.Observable, { 1.10491 + 1.10492 + 1.10493 + 1.10494 + 1.10495 + 1.10496 + 1.10497 + 1.10498 + 1.10499 + 1.10500 + remoteSort : false, 1.10501 + 1.10502 + 1.10503 + pruneModifiedRecords : false, 1.10504 + 1.10505 + 1.10506 + lastOptions : null, 1.10507 + 1.10508 + destroy : function(){ 1.10509 + if(this.id){ 1.10510 + Ext.StoreMgr.unregister(this); 1.10511 + } 1.10512 + this.data = null; 1.10513 + this.purgeListeners(); 1.10514 + }, 1.10515 + 1.10516 + 1.10517 + add : function(records){ 1.10518 + records = [].concat(records); 1.10519 + if(records.length < 1){ 1.10520 + return; 1.10521 + } 1.10522 + for(var i = 0, len = records.length; i < len; i++){ 1.10523 + records[i].join(this); 1.10524 + } 1.10525 + var index = this.data.length; 1.10526 + this.data.addAll(records); 1.10527 + if(this.snapshot){ 1.10528 + this.snapshot.addAll(records); 1.10529 + } 1.10530 + this.fireEvent("add", this, records, index); 1.10531 + }, 1.10532 + 1.10533 + 1.10534 + addSorted : function(record){ 1.10535 + var index = this.findInsertIndex(record); 1.10536 + this.insert(index, record); 1.10537 + }, 1.10538 + 1.10539 + 1.10540 + remove : function(record){ 1.10541 + var index = this.data.indexOf(record); 1.10542 + this.data.removeAt(index); 1.10543 + if(this.pruneModifiedRecords){ 1.10544 + this.modified.remove(record); 1.10545 + } 1.10546 + if(this.snapshot){ 1.10547 + this.snapshot.remove(record); 1.10548 + } 1.10549 + this.fireEvent("remove", this, record, index); 1.10550 + }, 1.10551 + 1.10552 + 1.10553 + removeAll : function(){ 1.10554 + this.data.clear(); 1.10555 + if(this.snapshot){ 1.10556 + this.snapshot.clear(); 1.10557 + } 1.10558 + if(this.pruneModifiedRecords){ 1.10559 + this.modified = []; 1.10560 + } 1.10561 + this.fireEvent("clear", this); 1.10562 + }, 1.10563 + 1.10564 + 1.10565 + insert : function(index, records){ 1.10566 + records = [].concat(records); 1.10567 + for(var i = 0, len = records.length; i < len; i++){ 1.10568 + this.data.insert(index, records[i]); 1.10569 + records[i].join(this); 1.10570 + } 1.10571 + this.fireEvent("add", this, records, index); 1.10572 + }, 1.10573 + 1.10574 + 1.10575 + indexOf : function(record){ 1.10576 + return this.data.indexOf(record); 1.10577 + }, 1.10578 + 1.10579 + 1.10580 + indexOfId : function(id){ 1.10581 + return this.data.indexOfKey(id); 1.10582 + }, 1.10583 + 1.10584 + 1.10585 + getById : function(id){ 1.10586 + return this.data.key(id); 1.10587 + }, 1.10588 + 1.10589 + 1.10590 + getAt : function(index){ 1.10591 + return this.data.itemAt(index); 1.10592 + }, 1.10593 + 1.10594 + 1.10595 + getRange : function(start, end){ 1.10596 + return this.data.getRange(start, end); 1.10597 + }, 1.10598 + 1.10599 + storeOptions : function(o){ 1.10600 + o = Ext.apply({}, o); 1.10601 + delete o.callback; 1.10602 + delete o.scope; 1.10603 + this.lastOptions = o; 1.10604 + }, 1.10605 + 1.10606 + 1.10607 + load : function(options){ 1.10608 + options = options || {}; 1.10609 + if(this.fireEvent("beforeload", this, options) !== false){ 1.10610 + this.storeOptions(options); 1.10611 + var p = Ext.apply(options.params || {}, this.baseParams); 1.10612 + if(this.sortInfo && this.remoteSort){ 1.10613 + var pn = this.paramNames; 1.10614 + p[pn["sort"]] = this.sortInfo.field; 1.10615 + p[pn["dir"]] = this.sortInfo.direction; 1.10616 + } 1.10617 + this.proxy.load(p, this.reader, this.loadRecords, this, options); 1.10618 + return true; 1.10619 + } else { 1.10620 + return false; 1.10621 + } 1.10622 + }, 1.10623 + 1.10624 + 1.10625 + reload : function(options){ 1.10626 + this.load(Ext.applyIf(options||{}, this.lastOptions)); 1.10627 + }, 1.10628 + 1.10629 + loadRecords : function(o, options, success){ 1.10630 + if(!o || success === false){ 1.10631 + if(success !== false){ 1.10632 + this.fireEvent("load", this, [], options); 1.10633 + } 1.10634 + if(options.callback){ 1.10635 + options.callback.call(options.scope || this, [], options, false); 1.10636 + } 1.10637 + return; 1.10638 + } 1.10639 + var r = o.records, t = o.totalRecords || r.length; 1.10640 + if(!options || options.add !== true){ 1.10641 + if(this.pruneModifiedRecords){ 1.10642 + this.modified = []; 1.10643 + } 1.10644 + for(var i = 0, len = r.length; i < len; i++){ 1.10645 + r[i].join(this); 1.10646 + } 1.10647 + if(this.snapshot){ 1.10648 + this.data = this.snapshot; 1.10649 + delete this.snapshot; 1.10650 + } 1.10651 + this.data.clear(); 1.10652 + this.data.addAll(r); 1.10653 + this.totalLength = t; 1.10654 + this.applySort(); 1.10655 + this.fireEvent("datachanged", this); 1.10656 + }else{ 1.10657 + this.totalLength = Math.max(t, this.data.length+r.length); 1.10658 + this.add(r); 1.10659 + } 1.10660 + this.fireEvent("load", this, r, options); 1.10661 + if(options.callback){ 1.10662 + options.callback.call(options.scope || this, r, options, true); 1.10663 + } 1.10664 + }, 1.10665 + 1.10666 + 1.10667 + loadData : function(o, append){ 1.10668 + var r = this.reader.readRecords(o); 1.10669 + this.loadRecords(r, {add: append}, true); 1.10670 + }, 1.10671 + 1.10672 + 1.10673 + getCount : function(){ 1.10674 + return this.data.length || 0; 1.10675 + }, 1.10676 + 1.10677 + 1.10678 + getTotalCount : function(){ 1.10679 + return this.totalLength || 0; 1.10680 + }, 1.10681 + 1.10682 + 1.10683 + getSortState : function(){ 1.10684 + return this.sortInfo; 1.10685 + }, 1.10686 + 1.10687 + applySort : function(){ 1.10688 + if(this.sortInfo && !this.remoteSort){ 1.10689 + var s = this.sortInfo, f = s.field; 1.10690 + this.sortData(f, s.direction); 1.10691 + } 1.10692 + }, 1.10693 + 1.10694 + sortData : function(f, direction){ 1.10695 + direction = direction || 'ASC'; 1.10696 + var st = this.fields.get(f).sortType; 1.10697 + var fn = function(r1, r2){ 1.10698 + var v1 = st(r1.data[f]), v2 = st(r2.data[f]); 1.10699 + return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0); 1.10700 + }; 1.10701 + this.data.sort(direction, fn); 1.10702 + if(this.snapshot && this.snapshot != this.data){ 1.10703 + this.snapshot.sort(direction, fn); 1.10704 + } 1.10705 + }, 1.10706 + 1.10707 + 1.10708 + setDefaultSort : function(field, dir){ 1.10709 + dir = dir ? dir.toUpperCase() : "ASC"; 1.10710 + this.sortInfo = {field: field, direction: dir}; 1.10711 + this.sortToggle[field] = dir; 1.10712 + }, 1.10713 + 1.10714 + 1.10715 + sort : function(fieldName, dir){ 1.10716 + var f = this.fields.get(fieldName); 1.10717 + if(!f){ 1.10718 + return false; 1.10719 + } 1.10720 + if(!dir){ 1.10721 + if(this.sortInfo && this.sortInfo.field == f.name){ dir = (this.sortToggle[f.name] || "ASC").toggle("ASC", "DESC"); 1.10722 + }else{ 1.10723 + dir = f.sortDir; 1.10724 + } 1.10725 + } 1.10726 + var st = (this.sortToggle) ? this.sortToggle[f.name] : null; 1.10727 + var si = (this.sortInfo) ? this.sortInfo : null; 1.10728 + 1.10729 + this.sortToggle[f.name] = dir; 1.10730 + this.sortInfo = {field: f.name, direction: dir}; 1.10731 + if(!this.remoteSort){ 1.10732 + this.applySort(); 1.10733 + this.fireEvent("datachanged", this); 1.10734 + }else{ 1.10735 + if (!this.load(this.lastOptions)) { 1.10736 + if (st) { 1.10737 + this.sortToggle[f.name] = st; 1.10738 + } 1.10739 + if (si) { 1.10740 + this.sortInfo = si; 1.10741 + } 1.10742 + } 1.10743 + } 1.10744 + }, 1.10745 + 1.10746 + 1.10747 + each : function(fn, scope){ 1.10748 + this.data.each(fn, scope); 1.10749 + }, 1.10750 + 1.10751 + 1.10752 + getModifiedRecords : function(){ 1.10753 + return this.modified; 1.10754 + }, 1.10755 + 1.10756 + createFilterFn : function(property, value, anyMatch, caseSensitive){ 1.10757 + if(Ext.isEmpty(value, false)){ 1.10758 + return false; 1.10759 + } 1.10760 + value = this.data.createValueMatcher(value, anyMatch, caseSensitive); 1.10761 + return function(r){ 1.10762 + return value.test(r.data[property]); 1.10763 + }; 1.10764 + }, 1.10765 + 1.10766 + 1.10767 + sum : function(property, start, end){ 1.10768 + var rs = this.data.items, v = 0; 1.10769 + start = start || 0; 1.10770 + end = (end || end === 0) ? end : rs.length-1; 1.10771 + 1.10772 + for(var i = start; i <= end; i++){ 1.10773 + v += (rs[i].data[property] || 0); 1.10774 + } 1.10775 + return v; 1.10776 + }, 1.10777 + 1.10778 + 1.10779 + filter : function(property, value, anyMatch, caseSensitive){ 1.10780 + var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); 1.10781 + return fn ? this.filterBy(fn) : this.clearFilter(); 1.10782 + }, 1.10783 + 1.10784 + 1.10785 + filterBy : function(fn, scope){ 1.10786 + this.snapshot = this.snapshot || this.data; 1.10787 + this.data = this.queryBy(fn, scope||this); 1.10788 + this.fireEvent("datachanged", this); 1.10789 + }, 1.10790 + 1.10791 + 1.10792 + query : function(property, value, anyMatch, caseSensitive){ 1.10793 + var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); 1.10794 + return fn ? this.queryBy(fn) : this.data.clone(); 1.10795 + }, 1.10796 + 1.10797 + 1.10798 + queryBy : function(fn, scope){ 1.10799 + var data = this.snapshot || this.data; 1.10800 + return data.filterBy(fn, scope||this); 1.10801 + }, 1.10802 + 1.10803 + 1.10804 + find : function(property, value, start, anyMatch, caseSensitive){ 1.10805 + var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); 1.10806 + return fn ? this.data.findIndexBy(fn, null, start) : -1; 1.10807 + }, 1.10808 + 1.10809 + 1.10810 + findBy : function(fn, scope, start){ 1.10811 + return this.data.findIndexBy(fn, scope, start); 1.10812 + }, 1.10813 + 1.10814 + 1.10815 + collect : function(dataIndex, allowNull, bypassFilter){ 1.10816 + var d = (bypassFilter === true && this.snapshot) ? 1.10817 + this.snapshot.items : this.data.items; 1.10818 + var v, sv, r = [], l = {}; 1.10819 + for(var i = 0, len = d.length; i < len; i++){ 1.10820 + v = d[i].data[dataIndex]; 1.10821 + sv = String(v); 1.10822 + if((allowNull || !Ext.isEmpty(v)) && !l[sv]){ 1.10823 + l[sv] = true; 1.10824 + r[r.length] = v; 1.10825 + } 1.10826 + } 1.10827 + return r; 1.10828 + }, 1.10829 + 1.10830 + 1.10831 + clearFilter : function(suppressEvent){ 1.10832 + if(this.isFiltered()){ 1.10833 + this.data = this.snapshot; 1.10834 + delete this.snapshot; 1.10835 + if(suppressEvent !== true){ 1.10836 + this.fireEvent("datachanged", this); 1.10837 + } 1.10838 + } 1.10839 + }, 1.10840 + 1.10841 + 1.10842 + isFiltered : function(){ 1.10843 + return this.snapshot && this.snapshot != this.data; 1.10844 + }, 1.10845 + 1.10846 + afterEdit : function(record){ 1.10847 + if(this.modified.indexOf(record) == -1){ 1.10848 + this.modified.push(record); 1.10849 + } 1.10850 + this.fireEvent("update", this, record, Ext.data.Record.EDIT); 1.10851 + }, 1.10852 + 1.10853 + afterReject : function(record){ 1.10854 + this.modified.remove(record); 1.10855 + this.fireEvent("update", this, record, Ext.data.Record.REJECT); 1.10856 + }, 1.10857 + 1.10858 + afterCommit : function(record){ 1.10859 + this.modified.remove(record); 1.10860 + this.fireEvent("update", this, record, Ext.data.Record.COMMIT); 1.10861 + }, 1.10862 + 1.10863 + 1.10864 + commitChanges : function(){ 1.10865 + var m = this.modified.slice(0); 1.10866 + this.modified = []; 1.10867 + for(var i = 0, len = m.length; i < len; i++){ 1.10868 + m[i].commit(); 1.10869 + } 1.10870 + }, 1.10871 + 1.10872 + 1.10873 + rejectChanges : function(){ 1.10874 + var m = this.modified.slice(0); 1.10875 + this.modified = []; 1.10876 + for(var i = 0, len = m.length; i < len; i++){ 1.10877 + m[i].reject(); 1.10878 + } 1.10879 + }, 1.10880 + 1.10881 + onMetaChange : function(meta, rtype, o){ 1.10882 + this.recordType = rtype; 1.10883 + this.fields = rtype.prototype.fields; 1.10884 + delete this.snapshot; 1.10885 + this.sortInfo = meta.sortInfo; 1.10886 + this.modified = []; 1.10887 + this.fireEvent('metachange', this, this.reader.meta); 1.10888 + }, 1.10889 + 1.10890 + findInsertIndex : function(record){ 1.10891 + this.suspendEvents(); 1.10892 + var data = this.data.clone(); 1.10893 + this.data.add(record); 1.10894 + this.applySort(); 1.10895 + var index = this.data.indexOf(record); 1.10896 + this.data = data; 1.10897 + this.resumeEvents(); 1.10898 + return index; 1.10899 + } 1.10900 +}); 1.10901 + 1.10902 +Ext.data.SimpleStore = function(config){ 1.10903 + Ext.data.SimpleStore.superclass.constructor.call(this, Ext.apply(config, { 1.10904 + reader: new Ext.data.ArrayReader({ 1.10905 + id: config.id 1.10906 + }, 1.10907 + Ext.data.Record.create(config.fields) 1.10908 + ) 1.10909 + })); 1.10910 +}; 1.10911 +Ext.extend(Ext.data.SimpleStore, Ext.data.Store, { 1.10912 + loadData : function(data, append){ 1.10913 + if(this.expandData === true){ 1.10914 + var r = []; 1.10915 + for(var i = 0, len = data.length; i < len; i++){ 1.10916 + r[r.length] = [data[i]]; 1.10917 + } 1.10918 + data = r; 1.10919 + } 1.10920 + Ext.data.SimpleStore.superclass.loadData.call(this, data, append); 1.10921 + } 1.10922 +}); 1.10923 + 1.10924 +Ext.data.JsonStore = function(c){ 1.10925 + Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(c, { 1.10926 + proxy: !c.data ? new Ext.data.HttpProxy({url: c.url}) : undefined, 1.10927 + reader: new Ext.data.JsonReader(c, c.fields) 1.10928 + })); 1.10929 +}; 1.10930 +Ext.extend(Ext.data.JsonStore, Ext.data.Store); 1.10931 + 1.10932 + 1.10933 + 1.10934 +Ext.data.Field = function(config){ 1.10935 + if(typeof config == "string"){ 1.10936 + config = {name: config}; 1.10937 + } 1.10938 + Ext.apply(this, config); 1.10939 + 1.10940 + if(!this.type){ 1.10941 + this.type = "auto"; 1.10942 + } 1.10943 + 1.10944 + var st = Ext.data.SortTypes; 1.10945 + 1.10946 + if(typeof this.sortType == "string"){ 1.10947 + this.sortType = st[this.sortType]; 1.10948 + } 1.10949 + 1.10950 + 1.10951 + if(!this.sortType){ 1.10952 + switch(this.type){ 1.10953 + case "string": 1.10954 + this.sortType = st.asUCString; 1.10955 + break; 1.10956 + case "date": 1.10957 + this.sortType = st.asDate; 1.10958 + break; 1.10959 + default: 1.10960 + this.sortType = st.none; 1.10961 + } 1.10962 + } 1.10963 + 1.10964 + 1.10965 + var stripRe = /[\$,%]/g; 1.10966 + 1.10967 + 1.10968 + 1.10969 + if(!this.convert){ 1.10970 + var cv, dateFormat = this.dateFormat; 1.10971 + switch(this.type){ 1.10972 + case "": 1.10973 + case "auto": 1.10974 + case undefined: 1.10975 + cv = function(v){ return v; }; 1.10976 + break; 1.10977 + case "string": 1.10978 + cv = function(v){ return (v === undefined || v === null) ? '' : String(v); }; 1.10979 + break; 1.10980 + case "int": 1.10981 + cv = function(v){ 1.10982 + return v !== undefined && v !== null && v !== '' ? 1.10983 + parseInt(String(v).replace(stripRe, ""), 10) : ''; 1.10984 + }; 1.10985 + break; 1.10986 + case "float": 1.10987 + cv = function(v){ 1.10988 + return v !== undefined && v !== null && v !== '' ? 1.10989 + parseFloat(String(v).replace(stripRe, ""), 10) : ''; 1.10990 + }; 1.10991 + break; 1.10992 + case "bool": 1.10993 + case "boolean": 1.10994 + cv = function(v){ return v === true || v === "true" || v == 1; }; 1.10995 + break; 1.10996 + case "date": 1.10997 + cv = function(v){ 1.10998 + if(!v){ 1.10999 + return ''; 1.11000 + } 1.11001 + if(Ext.isDate(v)){ 1.11002 + return v; 1.11003 + } 1.11004 + if(dateFormat){ 1.11005 + if(dateFormat == "timestamp"){ 1.11006 + return new Date(v*1000); 1.11007 + } 1.11008 + if(dateFormat == "time"){ 1.11009 + return new Date(parseInt(v, 10)); 1.11010 + } 1.11011 + return Date.parseDate(v, dateFormat); 1.11012 + } 1.11013 + var parsed = Date.parse(v); 1.11014 + return parsed ? new Date(parsed) : null; 1.11015 + }; 1.11016 + break; 1.11017 + 1.11018 + } 1.11019 + this.convert = cv; 1.11020 + } 1.11021 +}; 1.11022 + 1.11023 +Ext.data.Field.prototype = { 1.11024 + dateFormat: null, 1.11025 + defaultValue: "", 1.11026 + mapping: null, 1.11027 + sortType : null, 1.11028 + sortDir : "ASC" 1.11029 +}; 1.11030 + 1.11031 +Ext.data.DataReader = function(meta, recordType){ 1.11032 + 1.11033 + this.meta = meta; 1.11034 + this.recordType = Ext.isArray(recordType) ? 1.11035 + Ext.data.Record.create(recordType) : recordType; 1.11036 +}; 1.11037 + 1.11038 +Ext.data.DataReader.prototype = { 1.11039 + 1.11040 +}; 1.11041 + 1.11042 +Ext.data.DataProxy = function(){ 1.11043 + this.addEvents( 1.11044 + 1.11045 + 'beforeload', 1.11046 + 1.11047 + 'load' 1.11048 + ); 1.11049 + Ext.data.DataProxy.superclass.constructor.call(this); 1.11050 +}; 1.11051 + 1.11052 +Ext.extend(Ext.data.DataProxy, Ext.util.Observable); 1.11053 + 1.11054 +Ext.data.MemoryProxy = function(data){ 1.11055 + Ext.data.MemoryProxy.superclass.constructor.call(this); 1.11056 + this.data = data; 1.11057 +}; 1.11058 + 1.11059 +Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, { 1.11060 + 1.11061 + 1.11062 + 1.11063 + load : function(params, reader, callback, scope, arg){ 1.11064 + params = params || {}; 1.11065 + var result; 1.11066 + try { 1.11067 + result = reader.readRecords(this.data); 1.11068 + }catch(e){ 1.11069 + this.fireEvent("loadexception", this, arg, null, e); 1.11070 + callback.call(scope, null, arg, false); 1.11071 + return; 1.11072 + } 1.11073 + callback.call(scope, result, arg, true); 1.11074 + }, 1.11075 + 1.11076 + 1.11077 + update : function(params, records){ 1.11078 + 1.11079 + } 1.11080 +}); 1.11081 + 1.11082 +Ext.data.HttpProxy = function(conn){ 1.11083 + Ext.data.HttpProxy.superclass.constructor.call(this); 1.11084 + 1.11085 + this.conn = conn; 1.11086 + this.useAjax = !conn || !conn.events; 1.11087 + 1.11088 + 1.11089 +}; 1.11090 + 1.11091 +Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { 1.11092 + 1.11093 + getConnection : function(){ 1.11094 + return this.useAjax ? Ext.Ajax : this.conn; 1.11095 + }, 1.11096 + 1.11097 + 1.11098 + load : function(params, reader, callback, scope, arg){ 1.11099 + if(this.fireEvent("beforeload", this, params) !== false){ 1.11100 + var o = { 1.11101 + params : params || {}, 1.11102 + request: { 1.11103 + callback : callback, 1.11104 + scope : scope, 1.11105 + arg : arg 1.11106 + }, 1.11107 + reader: reader, 1.11108 + callback : this.loadResponse, 1.11109 + scope: this 1.11110 + }; 1.11111 + if(this.useAjax){ 1.11112 + Ext.applyIf(o, this.conn); 1.11113 + if(this.activeRequest){ 1.11114 + Ext.Ajax.abort(this.activeRequest); 1.11115 + } 1.11116 + this.activeRequest = Ext.Ajax.request(o); 1.11117 + }else{ 1.11118 + this.conn.request(o); 1.11119 + } 1.11120 + }else{ 1.11121 + callback.call(scope||this, null, arg, false); 1.11122 + } 1.11123 + }, 1.11124 + 1.11125 + 1.11126 + loadResponse : function(o, success, response){ 1.11127 + delete this.activeRequest; 1.11128 + if(!success){ 1.11129 + this.fireEvent("loadexception", this, o, response); 1.11130 + o.request.callback.call(o.request.scope, null, o.request.arg, false); 1.11131 + return; 1.11132 + } 1.11133 + var result; 1.11134 + try { 1.11135 + result = o.reader.read(response); 1.11136 + }catch(e){ 1.11137 + this.fireEvent("loadexception", this, o, response, e); 1.11138 + o.request.callback.call(o.request.scope, null, o.request.arg, false); 1.11139 + return; 1.11140 + } 1.11141 + this.fireEvent("load", this, o, o.request.arg); 1.11142 + o.request.callback.call(o.request.scope, result, o.request.arg, true); 1.11143 + }, 1.11144 + 1.11145 + 1.11146 + update : function(dataSet){ 1.11147 + 1.11148 + }, 1.11149 + 1.11150 + 1.11151 + updateResponse : function(dataSet){ 1.11152 + 1.11153 + } 1.11154 +}); 1.11155 + 1.11156 +Ext.data.ScriptTagProxy = function(config){ 1.11157 + Ext.data.ScriptTagProxy.superclass.constructor.call(this); 1.11158 + Ext.apply(this, config); 1.11159 + this.head = document.getElementsByTagName("head")[0]; 1.11160 + 1.11161 + 1.11162 +}; 1.11163 + 1.11164 +Ext.data.ScriptTagProxy.TRANS_ID = 1000; 1.11165 + 1.11166 +Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { 1.11167 + 1.11168 + 1.11169 + timeout : 30000, 1.11170 + 1.11171 + callbackParam : "callback", 1.11172 + 1.11173 + nocache : true, 1.11174 + 1.11175 + 1.11176 + load : function(params, reader, callback, scope, arg){ 1.11177 + if(this.fireEvent("beforeload", this, params) !== false){ 1.11178 + 1.11179 + var p = Ext.urlEncode(Ext.apply(params, this.extraParams)); 1.11180 + 1.11181 + var url = this.url; 1.11182 + url += (url.indexOf("?") != -1 ? "&" : "?") + p; 1.11183 + if(this.nocache){ 1.11184 + url += "&_dc=" + (new Date().getTime()); 1.11185 + } 1.11186 + var transId = ++Ext.data.ScriptTagProxy.TRANS_ID; 1.11187 + var trans = { 1.11188 + id : transId, 1.11189 + cb : "stcCallback"+transId, 1.11190 + scriptId : "stcScript"+transId, 1.11191 + params : params, 1.11192 + arg : arg, 1.11193 + url : url, 1.11194 + callback : callback, 1.11195 + scope : scope, 1.11196 + reader : reader 1.11197 + }; 1.11198 + var conn = this; 1.11199 + 1.11200 + window[trans.cb] = function(o){ 1.11201 + conn.handleResponse(o, trans); 1.11202 + }; 1.11203 + 1.11204 + url += String.format("&{0}={1}", this.callbackParam, trans.cb); 1.11205 + 1.11206 + if(this.autoAbort !== false){ 1.11207 + this.abort(); 1.11208 + } 1.11209 + 1.11210 + trans.timeoutId = this.handleFailure.defer(this.timeout, this, [trans]); 1.11211 + 1.11212 + var script = document.createElement("script"); 1.11213 + script.setAttribute("src", url); 1.11214 + script.setAttribute("type", "text/javascript"); 1.11215 + script.setAttribute("id", trans.scriptId); 1.11216 + this.head.appendChild(script); 1.11217 + 1.11218 + this.trans = trans; 1.11219 + }else{ 1.11220 + callback.call(scope||this, null, arg, false); 1.11221 + } 1.11222 + }, 1.11223 + 1.11224 + 1.11225 + isLoading : function(){ 1.11226 + return this.trans ? true : false; 1.11227 + }, 1.11228 + 1.11229 + 1.11230 + abort : function(){ 1.11231 + if(this.isLoading()){ 1.11232 + this.destroyTrans(this.trans); 1.11233 + } 1.11234 + }, 1.11235 + 1.11236 + 1.11237 + destroyTrans : function(trans, isLoaded){ 1.11238 + this.head.removeChild(document.getElementById(trans.scriptId)); 1.11239 + clearTimeout(trans.timeoutId); 1.11240 + if(isLoaded){ 1.11241 + window[trans.cb] = undefined; 1.11242 + try{ 1.11243 + delete window[trans.cb]; 1.11244 + }catch(e){} 1.11245 + }else{ 1.11246 + 1.11247 + window[trans.cb] = function(){ 1.11248 + window[trans.cb] = undefined; 1.11249 + try{ 1.11250 + delete window[trans.cb]; 1.11251 + }catch(e){} 1.11252 + }; 1.11253 + } 1.11254 + }, 1.11255 + 1.11256 + 1.11257 + handleResponse : function(o, trans){ 1.11258 + this.trans = false; 1.11259 + this.destroyTrans(trans, true); 1.11260 + var result; 1.11261 + try { 1.11262 + result = trans.reader.readRecords(o); 1.11263 + }catch(e){ 1.11264 + this.fireEvent("loadexception", this, o, trans.arg, e); 1.11265 + trans.callback.call(trans.scope||window, null, trans.arg, false); 1.11266 + return; 1.11267 + } 1.11268 + this.fireEvent("load", this, o, trans.arg); 1.11269 + trans.callback.call(trans.scope||window, result, trans.arg, true); 1.11270 + }, 1.11271 + 1.11272 + 1.11273 + handleFailure : function(trans){ 1.11274 + this.trans = false; 1.11275 + this.destroyTrans(trans, false); 1.11276 + this.fireEvent("loadexception", this, null, trans.arg); 1.11277 + trans.callback.call(trans.scope||window, null, trans.arg, false); 1.11278 + } 1.11279 +}); 1.11280 + 1.11281 +Ext.data.JsonReader = function(meta, recordType){ 1.11282 + meta = meta || {}; 1.11283 + Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields); 1.11284 +}; 1.11285 +Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { 1.11286 + 1.11287 + 1.11288 + read : function(response){ 1.11289 + var json = response.responseText; 1.11290 + var o = eval("("+json+")"); 1.11291 + if(!o) { 1.11292 + throw {message: "JsonReader.read: Json object not found"}; 1.11293 + } 1.11294 + return this.readRecords(o); 1.11295 + }, 1.11296 + 1.11297 + onMetaChange : function(meta, recordType, o){ 1.11298 + 1.11299 + }, 1.11300 + 1.11301 + 1.11302 + simpleAccess: function(obj, subsc) { 1.11303 + return obj[subsc]; 1.11304 + }, 1.11305 + 1.11306 + 1.11307 + getJsonAccessor: function(){ 1.11308 + var re = /[\[\.]/; 1.11309 + return function(expr) { 1.11310 + try { 1.11311 + return(re.test(expr)) 1.11312 + ? new Function("obj", "return obj." + expr) 1.11313 + : function(obj){ 1.11314 + return obj[expr]; 1.11315 + }; 1.11316 + } catch(e){} 1.11317 + return Ext.emptyFn; 1.11318 + }; 1.11319 + }(), 1.11320 + 1.11321 + 1.11322 + readRecords : function(o){ 1.11323 + 1.11324 + this.jsonData = o; 1.11325 + if(o.metaData){ 1.11326 + delete this.ef; 1.11327 + this.meta = o.metaData; 1.11328 + this.recordType = Ext.data.Record.create(o.metaData.fields); 1.11329 + this.onMetaChange(this.meta, this.recordType, o); 1.11330 + } 1.11331 + var s = this.meta, Record = this.recordType, 1.11332 + f = Record.prototype.fields, fi = f.items, fl = f.length; 1.11333 + 1.11334 + if (!this.ef) { 1.11335 + if(s.totalProperty) { 1.11336 + this.getTotal = this.getJsonAccessor(s.totalProperty); 1.11337 + } 1.11338 + if(s.successProperty) { 1.11339 + this.getSuccess = this.getJsonAccessor(s.successProperty); 1.11340 + } 1.11341 + this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p){return p;}; 1.11342 + if (s.id) { 1.11343 + var g = this.getJsonAccessor(s.id); 1.11344 + this.getId = function(rec) { 1.11345 + var r = g(rec); 1.11346 + return (r === undefined || r === "") ? null : r; 1.11347 + }; 1.11348 + } else { 1.11349 + this.getId = function(){return null;}; 1.11350 + } 1.11351 + this.ef = []; 1.11352 + for(var i = 0; i < fl; i++){ 1.11353 + f = fi[i]; 1.11354 + var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name; 1.11355 + this.ef[i] = this.getJsonAccessor(map); 1.11356 + } 1.11357 + } 1.11358 + 1.11359 + var root = this.getRoot(o), c = root.length, totalRecords = c, success = true; 1.11360 + if(s.totalProperty){ 1.11361 + var v = parseInt(this.getTotal(o), 10); 1.11362 + if(!isNaN(v)){ 1.11363 + totalRecords = v; 1.11364 + } 1.11365 + } 1.11366 + if(s.successProperty){ 1.11367 + var v = this.getSuccess(o); 1.11368 + if(v === false || v === 'false'){ 1.11369 + success = false; 1.11370 + } 1.11371 + } 1.11372 + var records = []; 1.11373 + for(var i = 0; i < c; i++){ 1.11374 + var n = root[i]; 1.11375 + var values = {}; 1.11376 + var id = this.getId(n); 1.11377 + for(var j = 0; j < fl; j++){ 1.11378 + f = fi[j]; 1.11379 + var v = this.ef[j](n); 1.11380 + values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, n); 1.11381 + } 1.11382 + var record = new Record(values, id); 1.11383 + record.json = n; 1.11384 + records[i] = record; 1.11385 + } 1.11386 + return { 1.11387 + success : success, 1.11388 + records : records, 1.11389 + totalRecords : totalRecords 1.11390 + }; 1.11391 + } 1.11392 +}); 1.11393 + 1.11394 +Ext.data.XmlReader = function(meta, recordType){ 1.11395 + meta = meta || {}; 1.11396 + Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields); 1.11397 +}; 1.11398 +Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, { 1.11399 + 1.11400 + read : function(response){ 1.11401 + var doc = response.responseXML; 1.11402 + if(!doc) { 1.11403 + throw {message: "XmlReader.read: XML Document not available"}; 1.11404 + } 1.11405 + return this.readRecords(doc); 1.11406 + }, 1.11407 + 1.11408 + 1.11409 + readRecords : function(doc){ 1.11410 + 1.11411 + this.xmlData = doc; 1.11412 + var root = doc.documentElement || doc; 1.11413 + var q = Ext.DomQuery; 1.11414 + var recordType = this.recordType, fields = recordType.prototype.fields; 1.11415 + var sid = this.meta.id; 1.11416 + var totalRecords = 0, success = true; 1.11417 + if(this.meta.totalRecords){ 1.11418 + totalRecords = q.selectNumber(this.meta.totalRecords, root, 0); 1.11419 + } 1.11420 + 1.11421 + if(this.meta.success){ 1.11422 + var sv = q.selectValue(this.meta.success, root, true); 1.11423 + success = sv !== false && sv !== 'false'; 1.11424 + } 1.11425 + var records = []; 1.11426 + var ns = q.select(this.meta.record, root); 1.11427 + for(var i = 0, len = ns.length; i < len; i++) { 1.11428 + var n = ns[i]; 1.11429 + var values = {}; 1.11430 + var id = sid ? q.selectValue(sid, n) : undefined; 1.11431 + for(var j = 0, jlen = fields.length; j < jlen; j++){ 1.11432 + var f = fields.items[j]; 1.11433 + var v = q.selectValue(f.mapping || f.name, n, f.defaultValue); 1.11434 + v = f.convert(v, n); 1.11435 + values[f.name] = v; 1.11436 + } 1.11437 + var record = new recordType(values, id); 1.11438 + record.node = n; 1.11439 + records[records.length] = record; 1.11440 + } 1.11441 + 1.11442 + return { 1.11443 + success : success, 1.11444 + records : records, 1.11445 + totalRecords : totalRecords || records.length 1.11446 + }; 1.11447 + } 1.11448 +}); 1.11449 + 1.11450 +Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { 1.11451 + 1.11452 + readRecords : function(o){ 1.11453 + var sid = this.meta ? this.meta.id : null; 1.11454 + var recordType = this.recordType, fields = recordType.prototype.fields; 1.11455 + var records = []; 1.11456 + var root = o; 1.11457 + for(var i = 0; i < root.length; i++){ 1.11458 + var n = root[i]; 1.11459 + var values = {}; 1.11460 + var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); 1.11461 + for(var j = 0, jlen = fields.length; j < jlen; j++){ 1.11462 + var f = fields.items[j]; 1.11463 + var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; 1.11464 + var v = n[k] !== undefined ? n[k] : f.defaultValue; 1.11465 + v = f.convert(v, n); 1.11466 + values[f.name] = v; 1.11467 + } 1.11468 + var record = new recordType(values, id); 1.11469 + record.json = n; 1.11470 + records[records.length] = record; 1.11471 + } 1.11472 + return { 1.11473 + records : records, 1.11474 + totalRecords : records.length 1.11475 + }; 1.11476 + } 1.11477 +}); 1.11478 + 1.11479 +Ext.data.Tree = function(root){ 1.11480 + this.nodeHash = {}; 1.11481 + 1.11482 + this.root = null; 1.11483 + if(root){ 1.11484 + this.setRootNode(root); 1.11485 + } 1.11486 + this.addEvents( 1.11487 + 1.11488 + "append", 1.11489 + 1.11490 + "remove", 1.11491 + 1.11492 + "move", 1.11493 + 1.11494 + "insert", 1.11495 + 1.11496 + "beforeappend", 1.11497 + 1.11498 + "beforeremove", 1.11499 + 1.11500 + "beforemove", 1.11501 + 1.11502 + "beforeinsert" 1.11503 + ); 1.11504 + 1.11505 + Ext.data.Tree.superclass.constructor.call(this); 1.11506 +}; 1.11507 + 1.11508 +Ext.extend(Ext.data.Tree, Ext.util.Observable, { 1.11509 + 1.11510 + pathSeparator: "/", 1.11511 + 1.11512 + 1.11513 + proxyNodeEvent : function(){ 1.11514 + return this.fireEvent.apply(this, arguments); 1.11515 + }, 1.11516 + 1.11517 + 1.11518 + getRootNode : function(){ 1.11519 + return this.root; 1.11520 + }, 1.11521 + 1.11522 + 1.11523 + setRootNode : function(node){ 1.11524 + this.root = node; 1.11525 + node.ownerTree = this; 1.11526 + node.isRoot = true; 1.11527 + this.registerNode(node); 1.11528 + return node; 1.11529 + }, 1.11530 + 1.11531 + 1.11532 + getNodeById : function(id){ 1.11533 + return this.nodeHash[id]; 1.11534 + }, 1.11535 + 1.11536 + 1.11537 + registerNode : function(node){ 1.11538 + this.nodeHash[node.id] = node; 1.11539 + }, 1.11540 + 1.11541 + 1.11542 + unregisterNode : function(node){ 1.11543 + delete this.nodeHash[node.id]; 1.11544 + }, 1.11545 + 1.11546 + toString : function(){ 1.11547 + return "[Tree"+(this.id?" "+this.id:"")+"]"; 1.11548 + } 1.11549 +}); 1.11550 + 1.11551 + 1.11552 +Ext.data.Node = function(attributes){ 1.11553 + 1.11554 + this.attributes = attributes || {}; 1.11555 + this.leaf = this.attributes.leaf; 1.11556 + 1.11557 + this.id = this.attributes.id; 1.11558 + if(!this.id){ 1.11559 + this.id = Ext.id(null, "ynode-"); 1.11560 + this.attributes.id = this.id; 1.11561 + } 1.11562 + 1.11563 + this.childNodes = []; 1.11564 + if(!this.childNodes.indexOf){ 1.11565 + this.childNodes.indexOf = function(o){ 1.11566 + for(var i = 0, len = this.length; i < len; i++){ 1.11567 + if(this[i] == o) return i; 1.11568 + } 1.11569 + return -1; 1.11570 + }; 1.11571 + } 1.11572 + 1.11573 + this.parentNode = null; 1.11574 + 1.11575 + this.firstChild = null; 1.11576 + 1.11577 + this.lastChild = null; 1.11578 + 1.11579 + this.previousSibling = null; 1.11580 + 1.11581 + this.nextSibling = null; 1.11582 + 1.11583 + this.addEvents({ 1.11584 + 1.11585 + "append" : true, 1.11586 + 1.11587 + "remove" : true, 1.11588 + 1.11589 + "move" : true, 1.11590 + 1.11591 + "insert" : true, 1.11592 + 1.11593 + "beforeappend" : true, 1.11594 + 1.11595 + "beforeremove" : true, 1.11596 + 1.11597 + "beforemove" : true, 1.11598 + 1.11599 + "beforeinsert" : true 1.11600 + }); 1.11601 + this.listeners = this.attributes.listeners; 1.11602 + Ext.data.Node.superclass.constructor.call(this); 1.11603 +}; 1.11604 + 1.11605 +Ext.extend(Ext.data.Node, Ext.util.Observable, { 1.11606 + 1.11607 + fireEvent : function(evtName){ 1.11608 + 1.11609 + if(Ext.data.Node.superclass.fireEvent.apply(this, arguments) === false){ 1.11610 + return false; 1.11611 + } 1.11612 + 1.11613 + var ot = this.getOwnerTree(); 1.11614 + if(ot){ 1.11615 + if(ot.proxyNodeEvent.apply(ot, arguments) === false){ 1.11616 + return false; 1.11617 + } 1.11618 + } 1.11619 + return true; 1.11620 + }, 1.11621 + 1.11622 + 1.11623 + isLeaf : function(){ 1.11624 + return this.leaf === true; 1.11625 + }, 1.11626 + 1.11627 + 1.11628 + setFirstChild : function(node){ 1.11629 + this.firstChild = node; 1.11630 + }, 1.11631 + 1.11632 + 1.11633 + setLastChild : function(node){ 1.11634 + this.lastChild = node; 1.11635 + }, 1.11636 + 1.11637 + 1.11638 + 1.11639 + isLast : function(){ 1.11640 + return (!this.parentNode ? true : this.parentNode.lastChild == this); 1.11641 + }, 1.11642 + 1.11643 + 1.11644 + isFirst : function(){ 1.11645 + return (!this.parentNode ? true : this.parentNode.firstChild == this); 1.11646 + }, 1.11647 + 1.11648 + hasChildNodes : function(){ 1.11649 + return !this.isLeaf() && this.childNodes.length > 0; 1.11650 + }, 1.11651 + 1.11652 + 1.11653 + appendChild : function(node){ 1.11654 + var multi = false; 1.11655 + if(Ext.isArray(node)){ 1.11656 + multi = node; 1.11657 + }else if(arguments.length > 1){ 1.11658 + multi = arguments; 1.11659 + } 1.11660 + 1.11661 + if(multi){ 1.11662 + for(var i = 0, len = multi.length; i < len; i++) { 1.11663 + this.appendChild(multi[i]); 1.11664 + } 1.11665 + }else{ 1.11666 + if(this.fireEvent("beforeappend", this.ownerTree, this, node) === false){ 1.11667 + return false; 1.11668 + } 1.11669 + var index = this.childNodes.length; 1.11670 + var oldParent = node.parentNode; 1.11671 + 1.11672 + if(oldParent){ 1.11673 + if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index) === false){ 1.11674 + return false; 1.11675 + } 1.11676 + oldParent.removeChild(node); 1.11677 + } 1.11678 + index = this.childNodes.length; 1.11679 + if(index == 0){ 1.11680 + this.setFirstChild(node); 1.11681 + } 1.11682 + this.childNodes.push(node); 1.11683 + node.parentNode = this; 1.11684 + var ps = this.childNodes[index-1]; 1.11685 + if(ps){ 1.11686 + node.previousSibling = ps; 1.11687 + ps.nextSibling = node; 1.11688 + }else{ 1.11689 + node.previousSibling = null; 1.11690 + } 1.11691 + node.nextSibling = null; 1.11692 + this.setLastChild(node); 1.11693 + node.setOwnerTree(this.getOwnerTree()); 1.11694 + this.fireEvent("append", this.ownerTree, this, node, index); 1.11695 + if(oldParent){ 1.11696 + node.fireEvent("move", this.ownerTree, node, oldParent, this, index); 1.11697 + } 1.11698 + return node; 1.11699 + } 1.11700 + }, 1.11701 + 1.11702 + 1.11703 + removeChild : function(node){ 1.11704 + var index = this.childNodes.indexOf(node); 1.11705 + if(index == -1){ 1.11706 + return false; 1.11707 + } 1.11708 + if(this.fireEvent("beforeremove", this.ownerTree, this, node) === false){ 1.11709 + return false; 1.11710 + } 1.11711 + 1.11712 + 1.11713 + this.childNodes.splice(index, 1); 1.11714 + 1.11715 + 1.11716 + if(node.previousSibling){ 1.11717 + node.previousSibling.nextSibling = node.nextSibling; 1.11718 + } 1.11719 + if(node.nextSibling){ 1.11720 + node.nextSibling.previousSibling = node.previousSibling; 1.11721 + } 1.11722 + 1.11723 + 1.11724 + if(this.firstChild == node){ 1.11725 + this.setFirstChild(node.nextSibling); 1.11726 + } 1.11727 + if(this.lastChild == node){ 1.11728 + this.setLastChild(node.previousSibling); 1.11729 + } 1.11730 + 1.11731 + node.setOwnerTree(null); 1.11732 + 1.11733 + node.parentNode = null; 1.11734 + node.previousSibling = null; 1.11735 + node.nextSibling = null; 1.11736 + this.fireEvent("remove", this.ownerTree, this, node); 1.11737 + return node; 1.11738 + }, 1.11739 + 1.11740 + 1.11741 + insertBefore : function(node, refNode){ 1.11742 + if(!refNode){ 1.11743 + return this.appendChild(node); 1.11744 + } 1.11745 + 1.11746 + if(node == refNode){ 1.11747 + return false; 1.11748 + } 1.11749 + 1.11750 + if(this.fireEvent("beforeinsert", this.ownerTree, this, node, refNode) === false){ 1.11751 + return false; 1.11752 + } 1.11753 + var index = this.childNodes.indexOf(refNode); 1.11754 + var oldParent = node.parentNode; 1.11755 + var refIndex = index; 1.11756 + 1.11757 + 1.11758 + if(oldParent == this && this.childNodes.indexOf(node) < index){ 1.11759 + refIndex--; 1.11760 + } 1.11761 + 1.11762 + 1.11763 + if(oldParent){ 1.11764 + if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index, refNode) === false){ 1.11765 + return false; 1.11766 + } 1.11767 + oldParent.removeChild(node); 1.11768 + } 1.11769 + if(refIndex == 0){ 1.11770 + this.setFirstChild(node); 1.11771 + } 1.11772 + this.childNodes.splice(refIndex, 0, node); 1.11773 + node.parentNode = this; 1.11774 + var ps = this.childNodes[refIndex-1]; 1.11775 + if(ps){ 1.11776 + node.previousSibling = ps; 1.11777 + ps.nextSibling = node; 1.11778 + }else{ 1.11779 + node.previousSibling = null; 1.11780 + } 1.11781 + node.nextSibling = refNode; 1.11782 + refNode.previousSibling = node; 1.11783 + node.setOwnerTree(this.getOwnerTree()); 1.11784 + this.fireEvent("insert", this.ownerTree, this, node, refNode); 1.11785 + if(oldParent){ 1.11786 + node.fireEvent("move", this.ownerTree, node, oldParent, this, refIndex, refNode); 1.11787 + } 1.11788 + return node; 1.11789 + }, 1.11790 + 1.11791 + 1.11792 + remove : function(){ 1.11793 + this.parentNode.removeChild(this); 1.11794 + return this; 1.11795 + }, 1.11796 + 1.11797 + 1.11798 + item : function(index){ 1.11799 + return this.childNodes[index]; 1.11800 + }, 1.11801 + 1.11802 + 1.11803 + replaceChild : function(newChild, oldChild){ 1.11804 + this.insertBefore(newChild, oldChild); 1.11805 + this.removeChild(oldChild); 1.11806 + return oldChild; 1.11807 + }, 1.11808 + 1.11809 + 1.11810 + indexOf : function(child){ 1.11811 + return this.childNodes.indexOf(child); 1.11812 + }, 1.11813 + 1.11814 + 1.11815 + getOwnerTree : function(){ 1.11816 + 1.11817 + if(!this.ownerTree){ 1.11818 + var p = this; 1.11819 + while(p){ 1.11820 + if(p.ownerTree){ 1.11821 + this.ownerTree = p.ownerTree; 1.11822 + break; 1.11823 + } 1.11824 + p = p.parentNode; 1.11825 + } 1.11826 + } 1.11827 + return this.ownerTree; 1.11828 + }, 1.11829 + 1.11830 + 1.11831 + getDepth : function(){ 1.11832 + var depth = 0; 1.11833 + var p = this; 1.11834 + while(p.parentNode){ 1.11835 + ++depth; 1.11836 + p = p.parentNode; 1.11837 + } 1.11838 + return depth; 1.11839 + }, 1.11840 + 1.11841 + 1.11842 + setOwnerTree : function(tree){ 1.11843 + 1.11844 + if(tree != this.ownerTree){ 1.11845 + if(this.ownerTree){ 1.11846 + this.ownerTree.unregisterNode(this); 1.11847 + } 1.11848 + this.ownerTree = tree; 1.11849 + var cs = this.childNodes; 1.11850 + for(var i = 0, len = cs.length; i < len; i++) { 1.11851 + cs[i].setOwnerTree(tree); 1.11852 + } 1.11853 + if(tree){ 1.11854 + tree.registerNode(this); 1.11855 + } 1.11856 + } 1.11857 + }, 1.11858 + 1.11859 + 1.11860 + getPath : function(attr){ 1.11861 + attr = attr || "id"; 1.11862 + var p = this.parentNode; 1.11863 + var b = [this.attributes[attr]]; 1.11864 + while(p){ 1.11865 + b.unshift(p.attributes[attr]); 1.11866 + p = p.parentNode; 1.11867 + } 1.11868 + var sep = this.getOwnerTree().pathSeparator; 1.11869 + return sep + b.join(sep); 1.11870 + }, 1.11871 + 1.11872 + 1.11873 + bubble : function(fn, scope, args){ 1.11874 + var p = this; 1.11875 + while(p){ 1.11876 + if(fn.apply(scope || p, args || [p]) === false){ 1.11877 + break; 1.11878 + } 1.11879 + p = p.parentNode; 1.11880 + } 1.11881 + }, 1.11882 + 1.11883 + 1.11884 + cascade : function(fn, scope, args){ 1.11885 + if(fn.apply(scope || this, args || [this]) !== false){ 1.11886 + var cs = this.childNodes; 1.11887 + for(var i = 0, len = cs.length; i < len; i++) { 1.11888 + cs[i].cascade(fn, scope, args); 1.11889 + } 1.11890 + } 1.11891 + }, 1.11892 + 1.11893 + 1.11894 + eachChild : function(fn, scope, args){ 1.11895 + var cs = this.childNodes; 1.11896 + for(var i = 0, len = cs.length; i < len; i++) { 1.11897 + if(fn.apply(scope || this, args || [cs[i]]) === false){ 1.11898 + break; 1.11899 + } 1.11900 + } 1.11901 + }, 1.11902 + 1.11903 + 1.11904 + findChild : function(attribute, value){ 1.11905 + var cs = this.childNodes; 1.11906 + for(var i = 0, len = cs.length; i < len; i++) { 1.11907 + if(cs[i].attributes[attribute] == value){ 1.11908 + return cs[i]; 1.11909 + } 1.11910 + } 1.11911 + return null; 1.11912 + }, 1.11913 + 1.11914 + 1.11915 + findChildBy : function(fn, scope){ 1.11916 + var cs = this.childNodes; 1.11917 + for(var i = 0, len = cs.length; i < len; i++) { 1.11918 + if(fn.call(scope||cs[i], cs[i]) === true){ 1.11919 + return cs[i]; 1.11920 + } 1.11921 + } 1.11922 + return null; 1.11923 + }, 1.11924 + 1.11925 + 1.11926 + sort : function(fn, scope){ 1.11927 + var cs = this.childNodes; 1.11928 + var len = cs.length; 1.11929 + if(len > 0){ 1.11930 + var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn; 1.11931 + cs.sort(sortFn); 1.11932 + for(var i = 0; i < len; i++){ 1.11933 + var n = cs[i]; 1.11934 + n.previousSibling = cs[i-1]; 1.11935 + n.nextSibling = cs[i+1]; 1.11936 + if(i == 0){ 1.11937 + this.setFirstChild(n); 1.11938 + } 1.11939 + if(i == len-1){ 1.11940 + this.setLastChild(n); 1.11941 + } 1.11942 + } 1.11943 + } 1.11944 + }, 1.11945 + 1.11946 + 1.11947 + contains : function(node){ 1.11948 + return node.isAncestor(this); 1.11949 + }, 1.11950 + 1.11951 + 1.11952 + isAncestor : function(node){ 1.11953 + var p = this.parentNode; 1.11954 + while(p){ 1.11955 + if(p == node){ 1.11956 + return true; 1.11957 + } 1.11958 + p = p.parentNode; 1.11959 + } 1.11960 + return false; 1.11961 + }, 1.11962 + 1.11963 + toString : function(){ 1.11964 + return "[Node"+(this.id?" "+this.id:"")+"]"; 1.11965 + } 1.11966 +}); 1.11967 + 1.11968 +Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { 1.11969 + 1.11970 + 1.11971 + remoteGroup : false, 1.11972 + 1.11973 + groupOnSort:false, 1.11974 + 1.11975 + 1.11976 + clearGrouping : function(){ 1.11977 + this.groupField = false; 1.11978 + if(this.remoteGroup){ 1.11979 + if(this.baseParams){ 1.11980 + delete this.baseParams.groupBy; 1.11981 + } 1.11982 + this.reload(); 1.11983 + }else{ 1.11984 + this.applySort(); 1.11985 + this.fireEvent('datachanged', this); 1.11986 + } 1.11987 + }, 1.11988 + 1.11989 + 1.11990 + groupBy : function(field, forceRegroup){ 1.11991 + if(this.groupField == field && !forceRegroup){ 1.11992 + return; 1.11993 + } 1.11994 + this.groupField = field; 1.11995 + if(this.remoteGroup){ 1.11996 + if(!this.baseParams){ 1.11997 + this.baseParams = {}; 1.11998 + } 1.11999 + this.baseParams['groupBy'] = field; 1.12000 + } 1.12001 + if(this.groupOnSort){ 1.12002 + this.sort(field); 1.12003 + return; 1.12004 + } 1.12005 + if(this.remoteGroup){ 1.12006 + this.reload(); 1.12007 + }else{ 1.12008 + var si = this.sortInfo || {}; 1.12009 + if(si.field != field){ 1.12010 + this.applySort(); 1.12011 + }else{ 1.12012 + this.sortData(field); 1.12013 + } 1.12014 + this.fireEvent('datachanged', this); 1.12015 + } 1.12016 + }, 1.12017 + 1.12018 + 1.12019 + applySort : function(){ 1.12020 + Ext.data.GroupingStore.superclass.applySort.call(this); 1.12021 + if(!this.groupOnSort && !this.remoteGroup){ 1.12022 + var gs = this.getGroupState(); 1.12023 + if(gs && gs != this.sortInfo.field){ 1.12024 + this.sortData(this.groupField); 1.12025 + } 1.12026 + } 1.12027 + }, 1.12028 + 1.12029 + 1.12030 + applyGrouping : function(alwaysFireChange){ 1.12031 + if(this.groupField !== false){ 1.12032 + this.groupBy(this.groupField, true); 1.12033 + return true; 1.12034 + }else{ 1.12035 + if(alwaysFireChange === true){ 1.12036 + this.fireEvent('datachanged', this); 1.12037 + } 1.12038 + return false; 1.12039 + } 1.12040 + }, 1.12041 + 1.12042 + 1.12043 + getGroupState : function(){ 1.12044 + return this.groupOnSort && this.groupField !== false ? 1.12045 + (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField; 1.12046 + } 1.12047 +}); 1.12048 + 1.12049 +Ext.ComponentMgr = function(){ 1.12050 + var all = new Ext.util.MixedCollection(); 1.12051 + var types = {}; 1.12052 + 1.12053 + return { 1.12054 + 1.12055 + register : function(c){ 1.12056 + all.add(c); 1.12057 + }, 1.12058 + 1.12059 + 1.12060 + unregister : function(c){ 1.12061 + all.remove(c); 1.12062 + }, 1.12063 + 1.12064 + 1.12065 + get : function(id){ 1.12066 + return all.get(id); 1.12067 + }, 1.12068 + 1.12069 + 1.12070 + onAvailable : function(id, fn, scope){ 1.12071 + all.on("add", function(index, o){ 1.12072 + if(o.id == id){ 1.12073 + fn.call(scope || o, o); 1.12074 + all.un("add", fn, scope); 1.12075 + } 1.12076 + }); 1.12077 + }, 1.12078 + 1.12079 + 1.12080 + all : all, 1.12081 + 1.12082 + 1.12083 + registerType : function(xtype, cls){ 1.12084 + types[xtype] = cls; 1.12085 + cls.xtype = xtype; 1.12086 + }, 1.12087 + 1.12088 + create : function(config, defaultType){ 1.12089 + return new types[config.xtype || defaultType](config); 1.12090 + } 1.12091 + }; 1.12092 +}(); 1.12093 + 1.12094 + 1.12095 +Ext.reg = Ext.ComponentMgr.registerType; // this will be called a lot internally, shorthand to keep the bytes down 1.12096 + 1.12097 +Ext.Component = function(config){ 1.12098 + config = config || {}; 1.12099 + if(config.initialConfig){ 1.12100 + if(config.isAction){ this.baseAction = config; 1.12101 + } 1.12102 + config = config.initialConfig; }else if(config.tagName || config.dom || typeof config == "string"){ config = {applyTo: config, id: config.id || config}; 1.12103 + } 1.12104 + 1.12105 + 1.12106 + this.initialConfig = config; 1.12107 + 1.12108 + Ext.apply(this, config); 1.12109 + this.addEvents( 1.12110 + 1.12111 + 'disable', 1.12112 + 1.12113 + 'enable', 1.12114 + 1.12115 + 'beforeshow', 1.12116 + 1.12117 + 'show', 1.12118 + 1.12119 + 'beforehide', 1.12120 + 1.12121 + 'hide', 1.12122 + 1.12123 + 'beforerender', 1.12124 + 1.12125 + 'render', 1.12126 + 1.12127 + 'beforedestroy', 1.12128 + 1.12129 + 'destroy', 1.12130 + 1.12131 + 'beforestaterestore', 1.12132 + 1.12133 + 'staterestore', 1.12134 + 1.12135 + 'beforestatesave', 1.12136 + 1.12137 + 'statesave' 1.12138 + ); 1.12139 + this.getId(); 1.12140 + Ext.ComponentMgr.register(this); 1.12141 + Ext.Component.superclass.constructor.call(this); 1.12142 + 1.12143 + if(this.baseAction){ 1.12144 + this.baseAction.addComponent(this); 1.12145 + } 1.12146 + 1.12147 + this.initComponent(); 1.12148 + 1.12149 + if(this.plugins){ 1.12150 + if(Ext.isArray(this.plugins)){ 1.12151 + for(var i = 0, len = this.plugins.length; i < len; i++){ 1.12152 + this.plugins[i].init(this); 1.12153 + } 1.12154 + }else{ 1.12155 + this.plugins.init(this); 1.12156 + } 1.12157 + } 1.12158 + 1.12159 + if(this.stateful !== false){ 1.12160 + this.initState(config); 1.12161 + } 1.12162 + 1.12163 + if(this.applyTo){ 1.12164 + this.applyToMarkup(this.applyTo); 1.12165 + delete this.applyTo; 1.12166 + }else if(this.renderTo){ 1.12167 + this.render(this.renderTo); 1.12168 + delete this.renderTo; 1.12169 + } 1.12170 +}; 1.12171 + 1.12172 +Ext.Component.AUTO_ID = 1000; 1.12173 + 1.12174 +Ext.extend(Ext.Component, Ext.util.Observable, { 1.12175 + 1.12176 + 1.12177 + 1.12178 + 1.12179 + 1.12180 + 1.12181 + 1.12182 + 1.12183 + 1.12184 + 1.12185 + 1.12186 + 1.12187 + 1.12188 + 1.12189 + 1.12190 + 1.12191 + disabledClass : "x-item-disabled", 1.12192 + 1.12193 + allowDomMove : true, 1.12194 + 1.12195 + autoShow : false, 1.12196 + 1.12197 + hideMode: 'display', 1.12198 + 1.12199 + hideParent: false, 1.12200 + 1.12201 + 1.12202 + 1.12203 + hidden : false, 1.12204 + 1.12205 + disabled : false, 1.12206 + 1.12207 + rendered : false, 1.12208 + 1.12209 + ctype : "Ext.Component", 1.12210 + 1.12211 + actionMode : "el", 1.12212 + 1.12213 + getActionEl : function(){ 1.12214 + return this[this.actionMode]; 1.12215 + }, 1.12216 + 1.12217 + 1.12218 + initComponent : Ext.emptyFn, 1.12219 + 1.12220 + 1.12221 + render : function(container, position){ 1.12222 + if(!this.rendered && this.fireEvent("beforerender", this) !== false){ 1.12223 + if(!container && this.el){ 1.12224 + this.el = Ext.get(this.el); 1.12225 + container = this.el.dom.parentNode; 1.12226 + this.allowDomMove = false; 1.12227 + } 1.12228 + this.container = Ext.get(container); 1.12229 + if(this.ctCls){ 1.12230 + this.container.addClass(this.ctCls); 1.12231 + } 1.12232 + this.rendered = true; 1.12233 + if(position !== undefined){ 1.12234 + if(typeof position == 'number'){ 1.12235 + position = this.container.dom.childNodes[position]; 1.12236 + }else{ 1.12237 + position = Ext.getDom(position); 1.12238 + } 1.12239 + } 1.12240 + this.onRender(this.container, position || null); 1.12241 + if(this.autoShow){ 1.12242 + this.el.removeClass(['x-hidden','x-hide-' + this.hideMode]); 1.12243 + } 1.12244 + if(this.cls){ 1.12245 + this.el.addClass(this.cls); 1.12246 + delete this.cls; 1.12247 + } 1.12248 + if(this.style){ 1.12249 + this.el.applyStyles(this.style); 1.12250 + delete this.style; 1.12251 + } 1.12252 + this.fireEvent("render", this); 1.12253 + this.afterRender(this.container); 1.12254 + if(this.hidden){ 1.12255 + this.hide(); 1.12256 + } 1.12257 + if(this.disabled){ 1.12258 + this.disable(); 1.12259 + } 1.12260 + 1.12261 + this.initStateEvents(); 1.12262 + } 1.12263 + return this; 1.12264 + }, 1.12265 + 1.12266 + initState : function(config){ 1.12267 + if(Ext.state.Manager){ 1.12268 + var state = Ext.state.Manager.get(this.stateId || this.id); 1.12269 + if(state){ 1.12270 + if(this.fireEvent('beforestaterestore', this, state) !== false){ 1.12271 + this.applyState(state); 1.12272 + this.fireEvent('staterestore', this, state); 1.12273 + } 1.12274 + } 1.12275 + } 1.12276 + }, 1.12277 + 1.12278 + initStateEvents : function(){ 1.12279 + if(this.stateEvents){ 1.12280 + for(var i = 0, e; e = this.stateEvents[i]; i++){ 1.12281 + this.on(e, this.saveState, this, {delay:100}); 1.12282 + } 1.12283 + } 1.12284 + }, 1.12285 + 1.12286 + applyState : function(state, config){ 1.12287 + if(state){ 1.12288 + Ext.apply(this, state); 1.12289 + } 1.12290 + }, 1.12291 + 1.12292 + getState : function(){ 1.12293 + return null; 1.12294 + }, 1.12295 + 1.12296 + saveState : function(){ 1.12297 + if(Ext.state.Manager){ 1.12298 + var state = this.getState(); 1.12299 + if(this.fireEvent('beforestatesave', this, state) !== false){ 1.12300 + Ext.state.Manager.set(this.stateId || this.id, state); 1.12301 + this.fireEvent('statesave', this, state); 1.12302 + } 1.12303 + } 1.12304 + }, 1.12305 + 1.12306 + 1.12307 + applyToMarkup : function(el){ 1.12308 + this.allowDomMove = false; 1.12309 + this.el = Ext.get(el); 1.12310 + this.render(this.el.dom.parentNode); 1.12311 + }, 1.12312 + 1.12313 + 1.12314 + addClass : function(cls){ 1.12315 + if(this.el){ 1.12316 + this.el.addClass(cls); 1.12317 + }else{ 1.12318 + this.cls = this.cls ? this.cls + ' ' + cls : cls; 1.12319 + } 1.12320 + }, 1.12321 + 1.12322 + 1.12323 + removeClass : function(cls){ 1.12324 + if(this.el){ 1.12325 + this.el.removeClass(cls); 1.12326 + }else if(this.cls){ 1.12327 + this.cls = this.cls.split(' ').remove(cls).join(' '); 1.12328 + } 1.12329 + }, 1.12330 + 1.12331 + onRender : function(ct, position){ 1.12332 + if(this.autoEl){ 1.12333 + if(typeof this.autoEl == 'string'){ 1.12334 + this.el = document.createElement(this.autoEl); 1.12335 + }else{ 1.12336 + var div = document.createElement('div'); 1.12337 + Ext.DomHelper.overwrite(div, this.autoEl); 1.12338 + this.el = div.firstChild; 1.12339 + } 1.12340 + if (!this.el.id) { 1.12341 + this.el.id = this.getId(); 1.12342 + } 1.12343 + } 1.12344 + if(this.el){ 1.12345 + this.el = Ext.get(this.el); 1.12346 + if(this.allowDomMove !== false){ 1.12347 + ct.dom.insertBefore(this.el.dom, position); 1.12348 + } 1.12349 + if(this.overCls) { 1.12350 + this.el.addClassOnOver(this.overCls); 1.12351 + } 1.12352 + } 1.12353 + }, 1.12354 + 1.12355 + getAutoCreate : function(){ 1.12356 + var cfg = typeof this.autoCreate == "object" ? 1.12357 + this.autoCreate : Ext.apply({}, this.defaultAutoCreate); 1.12358 + if(this.id && !cfg.id){ 1.12359 + cfg.id = this.id; 1.12360 + } 1.12361 + return cfg; 1.12362 + }, 1.12363 + 1.12364 + afterRender : Ext.emptyFn, 1.12365 + 1.12366 + 1.12367 + destroy : function(){ 1.12368 + if(this.fireEvent("beforedestroy", this) !== false){ 1.12369 + this.beforeDestroy(); 1.12370 + if(this.rendered){ 1.12371 + this.el.removeAllListeners(); 1.12372 + this.el.remove(); 1.12373 + if(this.actionMode == "container"){ 1.12374 + this.container.remove(); 1.12375 + } 1.12376 + } 1.12377 + this.onDestroy(); 1.12378 + Ext.ComponentMgr.unregister(this); 1.12379 + this.fireEvent("destroy", this); 1.12380 + this.purgeListeners(); 1.12381 + } 1.12382 + }, 1.12383 + 1.12384 + beforeDestroy : Ext.emptyFn, 1.12385 + 1.12386 + onDestroy : Ext.emptyFn, 1.12387 + 1.12388 + 1.12389 + getEl : function(){ 1.12390 + return this.el; 1.12391 + }, 1.12392 + 1.12393 + 1.12394 + getId : function(){ 1.12395 + return this.id || (this.id = "ext-comp-" + (++Ext.Component.AUTO_ID)); 1.12396 + }, 1.12397 + 1.12398 + 1.12399 + getItemId : function(){ 1.12400 + return this.itemId || this.getId(); 1.12401 + }, 1.12402 + 1.12403 + 1.12404 + focus : function(selectText, delay){ 1.12405 + if(delay){ 1.12406 + this.focus.defer(typeof delay == 'number' ? delay : 10, this, [selectText, false]); 1.12407 + return; 1.12408 + } 1.12409 + if(this.rendered){ 1.12410 + this.el.focus(); 1.12411 + if(selectText === true){ 1.12412 + this.el.dom.select(); 1.12413 + } 1.12414 + } 1.12415 + return this; 1.12416 + }, 1.12417 + 1.12418 + blur : function(){ 1.12419 + if(this.rendered){ 1.12420 + this.el.blur(); 1.12421 + } 1.12422 + return this; 1.12423 + }, 1.12424 + 1.12425 + 1.12426 + disable : function(){ 1.12427 + if(this.rendered){ 1.12428 + this.onDisable(); 1.12429 + } 1.12430 + this.disabled = true; 1.12431 + this.fireEvent("disable", this); 1.12432 + return this; 1.12433 + }, 1.12434 + 1.12435 + onDisable : function(){ 1.12436 + this.getActionEl().addClass(this.disabledClass); 1.12437 + this.el.dom.disabled = true; 1.12438 + }, 1.12439 + 1.12440 + 1.12441 + enable : function(){ 1.12442 + if(this.rendered){ 1.12443 + this.onEnable(); 1.12444 + } 1.12445 + this.disabled = false; 1.12446 + this.fireEvent("enable", this); 1.12447 + return this; 1.12448 + }, 1.12449 + 1.12450 + onEnable : function(){ 1.12451 + this.getActionEl().removeClass(this.disabledClass); 1.12452 + this.el.dom.disabled = false; 1.12453 + }, 1.12454 + 1.12455 + 1.12456 + setDisabled : function(disabled){ 1.12457 + this[disabled ? "disable" : "enable"](); 1.12458 + }, 1.12459 + 1.12460 + 1.12461 + show: function(){ 1.12462 + if(this.fireEvent("beforeshow", this) !== false){ 1.12463 + this.hidden = false; 1.12464 + if(this.autoRender){ 1.12465 + this.render(typeof this.autoRender == 'boolean' ? Ext.getBody() : this.autoRender); 1.12466 + } 1.12467 + if(this.rendered){ 1.12468 + this.onShow(); 1.12469 + } 1.12470 + this.fireEvent("show", this); 1.12471 + } 1.12472 + return this; 1.12473 + }, 1.12474 + 1.12475 + onShow : function(){ 1.12476 + if(this.hideParent){ 1.12477 + this.container.removeClass('x-hide-' + this.hideMode); 1.12478 + }else{ 1.12479 + this.getActionEl().removeClass('x-hide-' + this.hideMode); 1.12480 + } 1.12481 + 1.12482 + }, 1.12483 + 1.12484 + 1.12485 + hide: function(){ 1.12486 + if(this.fireEvent("beforehide", this) !== false){ 1.12487 + this.hidden = true; 1.12488 + if(this.rendered){ 1.12489 + this.onHide(); 1.12490 + } 1.12491 + this.fireEvent("hide", this); 1.12492 + } 1.12493 + return this; 1.12494 + }, 1.12495 + 1.12496 + onHide : function(){ 1.12497 + if(this.hideParent){ 1.12498 + this.container.addClass('x-hide-' + this.hideMode); 1.12499 + }else{ 1.12500 + this.getActionEl().addClass('x-hide-' + this.hideMode); 1.12501 + } 1.12502 + }, 1.12503 + 1.12504 + 1.12505 + setVisible: function(visible){ 1.12506 + if(visible) { 1.12507 + this.show(); 1.12508 + }else{ 1.12509 + this.hide(); 1.12510 + } 1.12511 + return this; 1.12512 + }, 1.12513 + 1.12514 + 1.12515 + isVisible : function(){ 1.12516 + return this.rendered && this.getActionEl().isVisible(); 1.12517 + }, 1.12518 + 1.12519 + 1.12520 + cloneConfig : function(overrides){ 1.12521 + overrides = overrides || {}; 1.12522 + var id = overrides.id || Ext.id(); 1.12523 + var cfg = Ext.applyIf(overrides, this.initialConfig); 1.12524 + cfg.id = id; return new this.constructor(cfg); 1.12525 + }, 1.12526 + 1.12527 + 1.12528 + getXType : function(){ 1.12529 + return this.constructor.xtype; 1.12530 + }, 1.12531 + 1.12532 + 1.12533 + isXType : function(xtype, shallow){ 1.12534 + return !shallow ? 1.12535 + ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1 : 1.12536 + this.constructor.xtype == xtype; 1.12537 + }, 1.12538 + 1.12539 + 1.12540 + getXTypes : function(){ 1.12541 + var tc = this.constructor; 1.12542 + if(!tc.xtypes){ 1.12543 + var c = [], sc = this; 1.12544 + while(sc && sc.constructor.xtype){ 1.12545 + c.unshift(sc.constructor.xtype); 1.12546 + sc = sc.constructor.superclass; 1.12547 + } 1.12548 + tc.xtypeChain = c; 1.12549 + tc.xtypes = c.join('/'); 1.12550 + } 1.12551 + return tc.xtypes; 1.12552 + }, 1.12553 + 1.12554 + 1.12555 + findParentBy: function(fn) { 1.12556 + for (var p = this.ownerCt; (p != null) && !fn(p, this); p = p.ownerCt); 1.12557 + return p || null; 1.12558 + }, 1.12559 + 1.12560 + 1.12561 + findParentByType: function(xtype) { 1.12562 + return typeof xtype == 'function' ? 1.12563 + this.findParentBy(function(p){ 1.12564 + return p.constructor === xtype; 1.12565 + }) : 1.12566 + this.findParentBy(function(p){ 1.12567 + return p.constructor.xtype === xtype; 1.12568 + }); 1.12569 + }, 1.12570 + 1.12571 + mon : function(item, ename, fn, scope, opt){ 1.12572 + if(!this.mons){ 1.12573 + this.mons = []; 1.12574 + this.on('beforedestroy', function(){ 1.12575 + for(var i= 0, len = this.mons.length; i < len; i++){ 1.12576 + var m = this.mons[i]; 1.12577 + m.item.un(m.ename, m.fn, m.scope); 1.12578 + } 1.12579 + }, this); 1.12580 + } 1.12581 + this.mons.push({ 1.12582 + item: item, ename: ename, fn: fn, scope: scope 1.12583 + }); 1.12584 + item.on(ename, fn, scope, opt); 1.12585 + } 1.12586 +}); 1.12587 + 1.12588 +Ext.reg('component', Ext.Component); 1.12589 + 1.12590 + 1.12591 +Ext.Action = function(config){ 1.12592 + this.initialConfig = config; 1.12593 + this.items = []; 1.12594 +} 1.12595 + 1.12596 +Ext.Action.prototype = { 1.12597 + 1.12598 + 1.12599 + 1.12600 + 1.12601 + 1.12602 + 1.12603 + 1.12604 + 1.12605 + isAction : true, 1.12606 + 1.12607 + 1.12608 + setText : function(text){ 1.12609 + this.initialConfig.text = text; 1.12610 + this.callEach('setText', [text]); 1.12611 + }, 1.12612 + 1.12613 + 1.12614 + getText : function(){ 1.12615 + return this.initialConfig.text; 1.12616 + }, 1.12617 + 1.12618 + 1.12619 + setIconClass : function(cls){ 1.12620 + this.initialConfig.iconCls = cls; 1.12621 + this.callEach('setIconClass', [cls]); 1.12622 + }, 1.12623 + 1.12624 + 1.12625 + getIconClass : function(){ 1.12626 + return this.initialConfig.iconCls; 1.12627 + }, 1.12628 + 1.12629 + 1.12630 + setDisabled : function(v){ 1.12631 + this.initialConfig.disabled = v; 1.12632 + this.callEach('setDisabled', [v]); 1.12633 + }, 1.12634 + 1.12635 + 1.12636 + enable : function(){ 1.12637 + this.setDisabled(false); 1.12638 + }, 1.12639 + 1.12640 + 1.12641 + disable : function(){ 1.12642 + this.setDisabled(true); 1.12643 + }, 1.12644 + 1.12645 + 1.12646 + isDisabled : function(){ 1.12647 + return this.initialConfig.disabled; 1.12648 + }, 1.12649 + 1.12650 + 1.12651 + setHidden : function(v){ 1.12652 + this.initialConfig.hidden = v; 1.12653 + this.callEach('setVisible', [!v]); 1.12654 + }, 1.12655 + 1.12656 + 1.12657 + show : function(){ 1.12658 + this.setHidden(false); 1.12659 + }, 1.12660 + 1.12661 + 1.12662 + hide : function(){ 1.12663 + this.setHidden(true); 1.12664 + }, 1.12665 + 1.12666 + 1.12667 + isHidden : function(){ 1.12668 + return this.initialConfig.hidden; 1.12669 + }, 1.12670 + 1.12671 + 1.12672 + setHandler : function(fn, scope){ 1.12673 + this.initialConfig.handler = fn; 1.12674 + this.initialConfig.scope = scope; 1.12675 + this.callEach('setHandler', [fn, scope]); 1.12676 + }, 1.12677 + 1.12678 + 1.12679 + each : function(fn, scope){ 1.12680 + Ext.each(this.items, fn, scope); 1.12681 + }, 1.12682 + 1.12683 + 1.12684 + callEach : function(fnName, args){ 1.12685 + var cs = this.items; 1.12686 + for(var i = 0, len = cs.length; i < len; i++){ 1.12687 + cs[i][fnName].apply(cs[i], args); 1.12688 + } 1.12689 + }, 1.12690 + 1.12691 + 1.12692 + addComponent : function(comp){ 1.12693 + this.items.push(comp); 1.12694 + comp.on('destroy', this.removeComponent, this); 1.12695 + }, 1.12696 + 1.12697 + 1.12698 + removeComponent : function(comp){ 1.12699 + this.items.remove(comp); 1.12700 + }, 1.12701 + 1.12702 + 1.12703 + execute : function(){ 1.12704 + this.initialConfig.handler.apply(this.initialConfig.scope || window, arguments); 1.12705 + } 1.12706 +}; 1.12707 + 1.12708 +(function(){ 1.12709 +Ext.Layer = function(config, existingEl){ 1.12710 + config = config || {}; 1.12711 + var dh = Ext.DomHelper; 1.12712 + var cp = config.parentEl, pel = cp ? Ext.getDom(cp) : document.body; 1.12713 + if(existingEl){ 1.12714 + this.dom = Ext.getDom(existingEl); 1.12715 + } 1.12716 + if(!this.dom){ 1.12717 + var o = config.dh || {tag: "div", cls: "x-layer"}; 1.12718 + this.dom = dh.append(pel, o); 1.12719 + } 1.12720 + if(config.cls){ 1.12721 + this.addClass(config.cls); 1.12722 + } 1.12723 + this.constrain = config.constrain !== false; 1.12724 + this.visibilityMode = Ext.Element.VISIBILITY; 1.12725 + if(config.id){ 1.12726 + this.id = this.dom.id = config.id; 1.12727 + }else{ 1.12728 + this.id = Ext.id(this.dom); 1.12729 + } 1.12730 + this.zindex = config.zindex || this.getZIndex(); 1.12731 + this.position("absolute", this.zindex); 1.12732 + if(config.shadow){ 1.12733 + this.shadowOffset = config.shadowOffset || 4; 1.12734 + this.shadow = new Ext.Shadow({ 1.12735 + offset : this.shadowOffset, 1.12736 + mode : config.shadow 1.12737 + }); 1.12738 + }else{ 1.12739 + this.shadowOffset = 0; 1.12740 + } 1.12741 + this.useShim = config.shim !== false && Ext.useShims; 1.12742 + this.useDisplay = config.useDisplay; 1.12743 + this.hide(); 1.12744 +}; 1.12745 + 1.12746 +var supr = Ext.Element.prototype; 1.12747 + 1.12748 + 1.12749 +var shims = []; 1.12750 + 1.12751 +Ext.extend(Ext.Layer, Ext.Element, { 1.12752 + 1.12753 + getZIndex : function(){ 1.12754 + return this.zindex || parseInt(this.getStyle("z-index"), 10) || 11000; 1.12755 + }, 1.12756 + 1.12757 + getShim : function(){ 1.12758 + if(!this.useShim){ 1.12759 + return null; 1.12760 + } 1.12761 + if(this.shim){ 1.12762 + return this.shim; 1.12763 + } 1.12764 + var shim = shims.shift(); 1.12765 + if(!shim){ 1.12766 + shim = this.createShim(); 1.12767 + shim.enableDisplayMode('block'); 1.12768 + shim.dom.style.display = 'none'; 1.12769 + shim.dom.style.visibility = 'visible'; 1.12770 + } 1.12771 + var pn = this.dom.parentNode; 1.12772 + if(shim.dom.parentNode != pn){ 1.12773 + pn.insertBefore(shim.dom, this.dom); 1.12774 + } 1.12775 + shim.setStyle('z-index', this.getZIndex()-2); 1.12776 + this.shim = shim; 1.12777 + return shim; 1.12778 + }, 1.12779 + 1.12780 + hideShim : function(){ 1.12781 + if(this.shim){ 1.12782 + this.shim.setDisplayed(false); 1.12783 + shims.push(this.shim); 1.12784 + delete this.shim; 1.12785 + } 1.12786 + }, 1.12787 + 1.12788 + disableShadow : function(){ 1.12789 + if(this.shadow){ 1.12790 + this.shadowDisabled = true; 1.12791 + this.shadow.hide(); 1.12792 + this.lastShadowOffset = this.shadowOffset; 1.12793 + this.shadowOffset = 0; 1.12794 + } 1.12795 + }, 1.12796 + 1.12797 + enableShadow : function(show){ 1.12798 + if(this.shadow){ 1.12799 + this.shadowDisabled = false; 1.12800 + this.shadowOffset = this.lastShadowOffset; 1.12801 + delete this.lastShadowOffset; 1.12802 + if(show){ 1.12803 + this.sync(true); 1.12804 + } 1.12805 + } 1.12806 + }, 1.12807 + 1.12808 + 1.12809 + 1.12810 + 1.12811 + sync : function(doShow){ 1.12812 + var sw = this.shadow; 1.12813 + if(!this.updating && this.isVisible() && (sw || this.useShim)){ 1.12814 + var sh = this.getShim(); 1.12815 + 1.12816 + var w = this.getWidth(), 1.12817 + h = this.getHeight(); 1.12818 + 1.12819 + var l = this.getLeft(true), 1.12820 + t = this.getTop(true); 1.12821 + 1.12822 + if(sw && !this.shadowDisabled){ 1.12823 + if(doShow && !sw.isVisible()){ 1.12824 + sw.show(this); 1.12825 + }else{ 1.12826 + sw.realign(l, t, w, h); 1.12827 + } 1.12828 + if(sh){ 1.12829 + if(doShow){ 1.12830 + sh.show(); 1.12831 + } 1.12832 + 1.12833 + var a = sw.adjusts, s = sh.dom.style; 1.12834 + s.left = (Math.min(l, l+a.l))+"px"; 1.12835 + s.top = (Math.min(t, t+a.t))+"px"; 1.12836 + s.width = (w+a.w)+"px"; 1.12837 + s.height = (h+a.h)+"px"; 1.12838 + } 1.12839 + }else if(sh){ 1.12840 + if(doShow){ 1.12841 + sh.show(); 1.12842 + } 1.12843 + sh.setSize(w, h); 1.12844 + sh.setLeftTop(l, t); 1.12845 + } 1.12846 + 1.12847 + } 1.12848 + }, 1.12849 + 1.12850 + 1.12851 + destroy : function(){ 1.12852 + this.hideShim(); 1.12853 + if(this.shadow){ 1.12854 + this.shadow.hide(); 1.12855 + } 1.12856 + this.removeAllListeners(); 1.12857 + Ext.removeNode(this.dom); 1.12858 + Ext.Element.uncache(this.id); 1.12859 + }, 1.12860 + 1.12861 + remove : function(){ 1.12862 + this.destroy(); 1.12863 + }, 1.12864 + 1.12865 + 1.12866 + beginUpdate : function(){ 1.12867 + this.updating = true; 1.12868 + }, 1.12869 + 1.12870 + 1.12871 + endUpdate : function(){ 1.12872 + this.updating = false; 1.12873 + this.sync(true); 1.12874 + }, 1.12875 + 1.12876 + 1.12877 + hideUnders : function(negOffset){ 1.12878 + if(this.shadow){ 1.12879 + this.shadow.hide(); 1.12880 + } 1.12881 + this.hideShim(); 1.12882 + }, 1.12883 + 1.12884 + 1.12885 + constrainXY : function(){ 1.12886 + if(this.constrain){ 1.12887 + var vw = Ext.lib.Dom.getViewWidth(), 1.12888 + vh = Ext.lib.Dom.getViewHeight(); 1.12889 + var s = Ext.getDoc().getScroll(); 1.12890 + 1.12891 + var xy = this.getXY(); 1.12892 + var x = xy[0], y = xy[1]; 1.12893 + var w = this.dom.offsetWidth+this.shadowOffset, h = this.dom.offsetHeight+this.shadowOffset; 1.12894 + 1.12895 + var moved = false; 1.12896 + 1.12897 + if((x + w) > vw+s.left){ 1.12898 + x = vw - w - this.shadowOffset; 1.12899 + moved = true; 1.12900 + } 1.12901 + if((y + h) > vh+s.top){ 1.12902 + y = vh - h - this.shadowOffset; 1.12903 + moved = true; 1.12904 + } 1.12905 + 1.12906 + if(x < s.left){ 1.12907 + x = s.left; 1.12908 + moved = true; 1.12909 + } 1.12910 + if(y < s.top){ 1.12911 + y = s.top; 1.12912 + moved = true; 1.12913 + } 1.12914 + if(moved){ 1.12915 + if(this.avoidY){ 1.12916 + var ay = this.avoidY; 1.12917 + if(y <= ay && (y+h) >= ay){ 1.12918 + y = ay-h-5; 1.12919 + } 1.12920 + } 1.12921 + xy = [x, y]; 1.12922 + this.storeXY(xy); 1.12923 + supr.setXY.call(this, xy); 1.12924 + this.sync(); 1.12925 + } 1.12926 + } 1.12927 + }, 1.12928 + 1.12929 + isVisible : function(){ 1.12930 + return this.visible; 1.12931 + }, 1.12932 + 1.12933 + 1.12934 + showAction : function(){ 1.12935 + this.visible = true; 1.12936 + if(this.useDisplay === true){ 1.12937 + this.setDisplayed(""); 1.12938 + }else if(this.lastXY){ 1.12939 + supr.setXY.call(this, this.lastXY); 1.12940 + }else if(this.lastLT){ 1.12941 + supr.setLeftTop.call(this, this.lastLT[0], this.lastLT[1]); 1.12942 + } 1.12943 + }, 1.12944 + 1.12945 + 1.12946 + hideAction : function(){ 1.12947 + this.visible = false; 1.12948 + if(this.useDisplay === true){ 1.12949 + this.setDisplayed(false); 1.12950 + }else{ 1.12951 + this.setLeftTop(-10000,-10000); 1.12952 + } 1.12953 + }, 1.12954 + 1.12955 + 1.12956 + setVisible : function(v, a, d, c, e){ 1.12957 + if(v){ 1.12958 + this.showAction(); 1.12959 + } 1.12960 + if(a && v){ 1.12961 + var cb = function(){ 1.12962 + this.sync(true); 1.12963 + if(c){ 1.12964 + c(); 1.12965 + } 1.12966 + }.createDelegate(this); 1.12967 + supr.setVisible.call(this, true, true, d, cb, e); 1.12968 + }else{ 1.12969 + if(!v){ 1.12970 + this.hideUnders(true); 1.12971 + } 1.12972 + var cb = c; 1.12973 + if(a){ 1.12974 + cb = function(){ 1.12975 + this.hideAction(); 1.12976 + if(c){ 1.12977 + c(); 1.12978 + } 1.12979 + }.createDelegate(this); 1.12980 + } 1.12981 + supr.setVisible.call(this, v, a, d, cb, e); 1.12982 + if(v){ 1.12983 + this.sync(true); 1.12984 + }else if(!a){ 1.12985 + this.hideAction(); 1.12986 + } 1.12987 + } 1.12988 + }, 1.12989 + 1.12990 + storeXY : function(xy){ 1.12991 + delete this.lastLT; 1.12992 + this.lastXY = xy; 1.12993 + }, 1.12994 + 1.12995 + storeLeftTop : function(left, top){ 1.12996 + delete this.lastXY; 1.12997 + this.lastLT = [left, top]; 1.12998 + }, 1.12999 + 1.13000 + 1.13001 + beforeFx : function(){ 1.13002 + this.beforeAction(); 1.13003 + return Ext.Layer.superclass.beforeFx.apply(this, arguments); 1.13004 + }, 1.13005 + 1.13006 + 1.13007 + afterFx : function(){ 1.13008 + Ext.Layer.superclass.afterFx.apply(this, arguments); 1.13009 + this.sync(this.isVisible()); 1.13010 + }, 1.13011 + 1.13012 + 1.13013 + beforeAction : function(){ 1.13014 + if(!this.updating && this.shadow){ 1.13015 + this.shadow.hide(); 1.13016 + } 1.13017 + }, 1.13018 + 1.13019 + 1.13020 + setLeft : function(left){ 1.13021 + this.storeLeftTop(left, this.getTop(true)); 1.13022 + supr.setLeft.apply(this, arguments); 1.13023 + this.sync(); 1.13024 + }, 1.13025 + 1.13026 + setTop : function(top){ 1.13027 + this.storeLeftTop(this.getLeft(true), top); 1.13028 + supr.setTop.apply(this, arguments); 1.13029 + this.sync(); 1.13030 + }, 1.13031 + 1.13032 + setLeftTop : function(left, top){ 1.13033 + this.storeLeftTop(left, top); 1.13034 + supr.setLeftTop.apply(this, arguments); 1.13035 + this.sync(); 1.13036 + }, 1.13037 + 1.13038 + setXY : function(xy, a, d, c, e){ 1.13039 + this.fixDisplay(); 1.13040 + this.beforeAction(); 1.13041 + this.storeXY(xy); 1.13042 + var cb = this.createCB(c); 1.13043 + supr.setXY.call(this, xy, a, d, cb, e); 1.13044 + if(!a){ 1.13045 + cb(); 1.13046 + } 1.13047 + }, 1.13048 + 1.13049 + 1.13050 + createCB : function(c){ 1.13051 + var el = this; 1.13052 + return function(){ 1.13053 + el.constrainXY(); 1.13054 + el.sync(true); 1.13055 + if(c){ 1.13056 + c(); 1.13057 + } 1.13058 + }; 1.13059 + }, 1.13060 + 1.13061 + 1.13062 + setX : function(x, a, d, c, e){ 1.13063 + this.setXY([x, this.getY()], a, d, c, e); 1.13064 + }, 1.13065 + 1.13066 + 1.13067 + setY : function(y, a, d, c, e){ 1.13068 + this.setXY([this.getX(), y], a, d, c, e); 1.13069 + }, 1.13070 + 1.13071 + 1.13072 + setSize : function(w, h, a, d, c, e){ 1.13073 + this.beforeAction(); 1.13074 + var cb = this.createCB(c); 1.13075 + supr.setSize.call(this, w, h, a, d, cb, e); 1.13076 + if(!a){ 1.13077 + cb(); 1.13078 + } 1.13079 + }, 1.13080 + 1.13081 + 1.13082 + setWidth : function(w, a, d, c, e){ 1.13083 + this.beforeAction(); 1.13084 + var cb = this.createCB(c); 1.13085 + supr.setWidth.call(this, w, a, d, cb, e); 1.13086 + if(!a){ 1.13087 + cb(); 1.13088 + } 1.13089 + }, 1.13090 + 1.13091 + 1.13092 + setHeight : function(h, a, d, c, e){ 1.13093 + this.beforeAction(); 1.13094 + var cb = this.createCB(c); 1.13095 + supr.setHeight.call(this, h, a, d, cb, e); 1.13096 + if(!a){ 1.13097 + cb(); 1.13098 + } 1.13099 + }, 1.13100 + 1.13101 + 1.13102 + setBounds : function(x, y, w, h, a, d, c, e){ 1.13103 + this.beforeAction(); 1.13104 + var cb = this.createCB(c); 1.13105 + if(!a){ 1.13106 + this.storeXY([x, y]); 1.13107 + supr.setXY.call(this, [x, y]); 1.13108 + supr.setSize.call(this, w, h, a, d, cb, e); 1.13109 + cb(); 1.13110 + }else{ 1.13111 + supr.setBounds.call(this, x, y, w, h, a, d, cb, e); 1.13112 + } 1.13113 + return this; 1.13114 + }, 1.13115 + 1.13116 + 1.13117 + setZIndex : function(zindex){ 1.13118 + this.zindex = zindex; 1.13119 + this.setStyle("z-index", zindex + 2); 1.13120 + if(this.shadow){ 1.13121 + this.shadow.setZIndex(zindex + 1); 1.13122 + } 1.13123 + if(this.shim){ 1.13124 + this.shim.setStyle("z-index", zindex); 1.13125 + } 1.13126 + } 1.13127 +}); 1.13128 +})(); 1.13129 + 1.13130 +Ext.Shadow = function(config){ 1.13131 + Ext.apply(this, config); 1.13132 + if(typeof this.mode != "string"){ 1.13133 + this.mode = this.defaultMode; 1.13134 + } 1.13135 + var o = this.offset, a = {h: 0}; 1.13136 + var rad = Math.floor(this.offset/2); 1.13137 + switch(this.mode.toLowerCase()){ case "drop": 1.13138 + a.w = 0; 1.13139 + a.l = a.t = o; 1.13140 + a.t -= 1; 1.13141 + if(Ext.isIE){ 1.13142 + a.l -= this.offset + rad; 1.13143 + a.t -= this.offset + rad; 1.13144 + a.w -= rad; 1.13145 + a.h -= rad; 1.13146 + a.t += 1; 1.13147 + } 1.13148 + break; 1.13149 + case "sides": 1.13150 + a.w = (o*2); 1.13151 + a.l = -o; 1.13152 + a.t = o-1; 1.13153 + if(Ext.isIE){ 1.13154 + a.l -= (this.offset - rad); 1.13155 + a.t -= this.offset + rad; 1.13156 + a.l += 1; 1.13157 + a.w -= (this.offset - rad)*2; 1.13158 + a.w -= rad + 1; 1.13159 + a.h -= 1; 1.13160 + } 1.13161 + break; 1.13162 + case "frame": 1.13163 + a.w = a.h = (o*2); 1.13164 + a.l = a.t = -o; 1.13165 + a.t += 1; 1.13166 + a.h -= 2; 1.13167 + if(Ext.isIE){ 1.13168 + a.l -= (this.offset - rad); 1.13169 + a.t -= (this.offset - rad); 1.13170 + a.l += 1; 1.13171 + a.w -= (this.offset + rad + 1); 1.13172 + a.h -= (this.offset + rad); 1.13173 + a.h += 1; 1.13174 + } 1.13175 + break; 1.13176 + }; 1.13177 + 1.13178 + this.adjusts = a; 1.13179 +}; 1.13180 + 1.13181 +Ext.Shadow.prototype = { 1.13182 + 1.13183 + 1.13184 + offset: 4, 1.13185 + 1.13186 + defaultMode: "drop", 1.13187 + 1.13188 + 1.13189 + show : function(target){ 1.13190 + target = Ext.get(target); 1.13191 + if(!this.el){ 1.13192 + this.el = Ext.Shadow.Pool.pull(); 1.13193 + if(this.el.dom.nextSibling != target.dom){ 1.13194 + this.el.insertBefore(target); 1.13195 + } 1.13196 + } 1.13197 + this.el.setStyle("z-index", this.zIndex || parseInt(target.getStyle("z-index"), 10)-1); 1.13198 + if(Ext.isIE){ 1.13199 + this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"; 1.13200 + } 1.13201 + this.realign( 1.13202 + target.getLeft(true), 1.13203 + target.getTop(true), 1.13204 + target.getWidth(), 1.13205 + target.getHeight() 1.13206 + ); 1.13207 + this.el.dom.style.display = "block"; 1.13208 + }, 1.13209 + 1.13210 + 1.13211 + isVisible : function(){ 1.13212 + return this.el ? true : false; 1.13213 + }, 1.13214 + 1.13215 + 1.13216 + realign : function(l, t, w, h){ 1.13217 + if(!this.el){ 1.13218 + return; 1.13219 + } 1.13220 + var a = this.adjusts, d = this.el.dom, s = d.style; 1.13221 + var iea = 0; 1.13222 + s.left = (l+a.l)+"px"; 1.13223 + s.top = (t+a.t)+"px"; 1.13224 + var sw = (w+a.w), sh = (h+a.h), sws = sw +"px", shs = sh + "px"; 1.13225 + if(s.width != sws || s.height != shs){ 1.13226 + s.width = sws; 1.13227 + s.height = shs; 1.13228 + if(!Ext.isIE){ 1.13229 + var cn = d.childNodes; 1.13230 + var sww = Math.max(0, (sw-12))+"px"; 1.13231 + cn[0].childNodes[1].style.width = sww; 1.13232 + cn[1].childNodes[1].style.width = sww; 1.13233 + cn[2].childNodes[1].style.width = sww; 1.13234 + cn[1].style.height = Math.max(0, (sh-12))+"px"; 1.13235 + } 1.13236 + } 1.13237 + }, 1.13238 + 1.13239 + 1.13240 + hide : function(){ 1.13241 + if(this.el){ 1.13242 + this.el.dom.style.display = "none"; 1.13243 + Ext.Shadow.Pool.push(this.el); 1.13244 + delete this.el; 1.13245 + } 1.13246 + }, 1.13247 + 1.13248 + 1.13249 + setZIndex : function(z){ 1.13250 + this.zIndex = z; 1.13251 + if(this.el){ 1.13252 + this.el.setStyle("z-index", z); 1.13253 + } 1.13254 + } 1.13255 +}; 1.13256 + 1.13257 +Ext.Shadow.Pool = function(){ 1.13258 + var p = []; 1.13259 + var markup = Ext.isIE ? 1.13260 + '<div class="x-ie-shadow"></div>' : 1.13261 + '<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>'; 1.13262 + return { 1.13263 + pull : function(){ 1.13264 + var sh = p.shift(); 1.13265 + if(!sh){ 1.13266 + sh = Ext.get(Ext.DomHelper.insertHtml("beforeBegin", document.body.firstChild, markup)); 1.13267 + sh.autoBoxAdjust = false; 1.13268 + } 1.13269 + return sh; 1.13270 + }, 1.13271 + 1.13272 + push : function(sh){ 1.13273 + p.push(sh); 1.13274 + } 1.13275 + }; 1.13276 +}(); 1.13277 + 1.13278 +Ext.BoxComponent = Ext.extend(Ext.Component, { 1.13279 + 1.13280 + 1.13281 + 1.13282 + 1.13283 + 1.13284 + 1.13285 + 1.13286 + 1.13287 + 1.13288 + 1.13289 + 1.13290 + initComponent : function(){ 1.13291 + Ext.BoxComponent.superclass.initComponent.call(this); 1.13292 + this.addEvents( 1.13293 + 1.13294 + 'resize', 1.13295 + 1.13296 + 'move' 1.13297 + ); 1.13298 + }, 1.13299 + 1.13300 + boxReady : false, 1.13301 + deferHeight: false, 1.13302 + 1.13303 + 1.13304 + setSize : function(w, h){ 1.13305 + if(typeof w == 'object'){ 1.13306 + h = w.height; 1.13307 + w = w.width; 1.13308 + } 1.13309 + if(!this.boxReady){ 1.13310 + this.width = w; 1.13311 + this.height = h; 1.13312 + return this; 1.13313 + } 1.13314 + 1.13315 + if(this.lastSize && this.lastSize.width == w && this.lastSize.height == h){ 1.13316 + return this; 1.13317 + } 1.13318 + this.lastSize = {width: w, height: h}; 1.13319 + var adj = this.adjustSize(w, h); 1.13320 + var aw = adj.width, ah = adj.height; 1.13321 + if(aw !== undefined || ah !== undefined){ var rz = this.getResizeEl(); 1.13322 + if(!this.deferHeight && aw !== undefined && ah !== undefined){ 1.13323 + rz.setSize(aw, ah); 1.13324 + }else if(!this.deferHeight && ah !== undefined){ 1.13325 + rz.setHeight(ah); 1.13326 + }else if(aw !== undefined){ 1.13327 + rz.setWidth(aw); 1.13328 + } 1.13329 + this.onResize(aw, ah, w, h); 1.13330 + this.fireEvent('resize', this, aw, ah, w, h); 1.13331 + } 1.13332 + return this; 1.13333 + }, 1.13334 + 1.13335 + 1.13336 + setWidth : function(width){ 1.13337 + return this.setSize(width); 1.13338 + }, 1.13339 + 1.13340 + 1.13341 + setHeight : function(height){ 1.13342 + return this.setSize(undefined, height); 1.13343 + }, 1.13344 + 1.13345 + 1.13346 + getSize : function(){ 1.13347 + return this.el.getSize(); 1.13348 + }, 1.13349 + 1.13350 + 1.13351 + getPosition : function(local){ 1.13352 + if(local === true){ 1.13353 + return [this.el.getLeft(true), this.el.getTop(true)]; 1.13354 + } 1.13355 + return this.xy || this.el.getXY(); 1.13356 + }, 1.13357 + 1.13358 + 1.13359 + getBox : function(local){ 1.13360 + var s = this.el.getSize(); 1.13361 + if(local === true){ 1.13362 + s.x = this.el.getLeft(true); 1.13363 + s.y = this.el.getTop(true); 1.13364 + }else{ 1.13365 + var xy = this.xy || this.el.getXY(); 1.13366 + s.x = xy[0]; 1.13367 + s.y = xy[1]; 1.13368 + } 1.13369 + return s; 1.13370 + }, 1.13371 + 1.13372 + 1.13373 + updateBox : function(box){ 1.13374 + this.setSize(box.width, box.height); 1.13375 + this.setPagePosition(box.x, box.y); 1.13376 + return this; 1.13377 + }, 1.13378 + 1.13379 + getResizeEl : function(){ 1.13380 + return this.resizeEl || this.el; 1.13381 + }, 1.13382 + 1.13383 + getPositionEl : function(){ 1.13384 + return this.positionEl || this.el; 1.13385 + }, 1.13386 + 1.13387 + 1.13388 + setPosition : function(x, y){ 1.13389 + if(x && typeof x[1] == 'number'){ 1.13390 + y = x[1]; 1.13391 + x = x[0]; 1.13392 + } 1.13393 + this.x = x; 1.13394 + this.y = y; 1.13395 + if(!this.boxReady){ 1.13396 + return this; 1.13397 + } 1.13398 + var adj = this.adjustPosition(x, y); 1.13399 + var ax = adj.x, ay = adj.y; 1.13400 + 1.13401 + var el = this.getPositionEl(); 1.13402 + if(ax !== undefined || ay !== undefined){ 1.13403 + if(ax !== undefined && ay !== undefined){ 1.13404 + el.setLeftTop(ax, ay); 1.13405 + }else if(ax !== undefined){ 1.13406 + el.setLeft(ax); 1.13407 + }else if(ay !== undefined){ 1.13408 + el.setTop(ay); 1.13409 + } 1.13410 + this.onPosition(ax, ay); 1.13411 + this.fireEvent('move', this, ax, ay); 1.13412 + } 1.13413 + return this; 1.13414 + }, 1.13415 + 1.13416 + 1.13417 + setPagePosition : function(x, y){ 1.13418 + if(x && typeof x[1] == 'number'){ 1.13419 + y = x[1]; 1.13420 + x = x[0]; 1.13421 + } 1.13422 + this.pageX = x; 1.13423 + this.pageY = y; 1.13424 + if(!this.boxReady){ 1.13425 + return; 1.13426 + } 1.13427 + if(x === undefined || y === undefined){ return; 1.13428 + } 1.13429 + var p = this.el.translatePoints(x, y); 1.13430 + this.setPosition(p.left, p.top); 1.13431 + return this; 1.13432 + }, 1.13433 + 1.13434 + onRender : function(ct, position){ 1.13435 + Ext.BoxComponent.superclass.onRender.call(this, ct, position); 1.13436 + if(this.resizeEl){ 1.13437 + this.resizeEl = Ext.get(this.resizeEl); 1.13438 + } 1.13439 + if(this.positionEl){ 1.13440 + this.positionEl = Ext.get(this.positionEl); 1.13441 + } 1.13442 + }, 1.13443 + 1.13444 + afterRender : function(){ 1.13445 + Ext.BoxComponent.superclass.afterRender.call(this); 1.13446 + this.boxReady = true; 1.13447 + this.setSize(this.width, this.height); 1.13448 + if(this.x || this.y){ 1.13449 + this.setPosition(this.x, this.y); 1.13450 + }else if(this.pageX || this.pageY){ 1.13451 + this.setPagePosition(this.pageX, this.pageY); 1.13452 + } 1.13453 + }, 1.13454 + 1.13455 + 1.13456 + syncSize : function(){ 1.13457 + delete this.lastSize; 1.13458 + this.setSize(this.autoWidth ? undefined : this.el.getWidth(), this.autoHeight ? undefined : this.el.getHeight()); 1.13459 + return this; 1.13460 + }, 1.13461 + 1.13462 + 1.13463 + onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){ 1.13464 + 1.13465 + }, 1.13466 + 1.13467 + 1.13468 + onPosition : function(x, y){ 1.13469 + 1.13470 + }, 1.13471 + 1.13472 + adjustSize : function(w, h){ 1.13473 + if(this.autoWidth){ 1.13474 + w = 'auto'; 1.13475 + } 1.13476 + if(this.autoHeight){ 1.13477 + h = 'auto'; 1.13478 + } 1.13479 + return {width : w, height: h}; 1.13480 + }, 1.13481 + 1.13482 + adjustPosition : function(x, y){ 1.13483 + return {x : x, y: y}; 1.13484 + } 1.13485 +}); 1.13486 +Ext.reg('box', Ext.BoxComponent); 1.13487 + 1.13488 +Ext.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){ 1.13489 + 1.13490 + 1.13491 + this.el = Ext.get(dragElement, true); 1.13492 + this.el.dom.unselectable = "on"; 1.13493 + 1.13494 + this.resizingEl = Ext.get(resizingElement, true); 1.13495 + 1.13496 + 1.13497 + this.orientation = orientation || Ext.SplitBar.HORIZONTAL; 1.13498 + 1.13499 + 1.13500 + this.minSize = 0; 1.13501 + 1.13502 + 1.13503 + this.maxSize = 2000; 1.13504 + 1.13505 + 1.13506 + this.animate = false; 1.13507 + 1.13508 + 1.13509 + this.useShim = false; 1.13510 + 1.13511 + 1.13512 + this.shim = null; 1.13513 + 1.13514 + if(!existingProxy){ 1.13515 + 1.13516 + this.proxy = Ext.SplitBar.createProxy(this.orientation); 1.13517 + }else{ 1.13518 + this.proxy = Ext.get(existingProxy).dom; 1.13519 + } 1.13520 + 1.13521 + this.dd = new Ext.dd.DDProxy(this.el.dom.id, "XSplitBars", {dragElId : this.proxy.id}); 1.13522 + 1.13523 + 1.13524 + this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this); 1.13525 + 1.13526 + 1.13527 + this.dd.endDrag = this.onEndProxyDrag.createDelegate(this); 1.13528 + 1.13529 + 1.13530 + this.dragSpecs = {}; 1.13531 + 1.13532 + 1.13533 + this.adapter = new Ext.SplitBar.BasicLayoutAdapter(); 1.13534 + this.adapter.init(this); 1.13535 + 1.13536 + if(this.orientation == Ext.SplitBar.HORIZONTAL){ 1.13537 + 1.13538 + this.placement = placement || (this.el.getX() > this.resizingEl.getX() ? Ext.SplitBar.LEFT : Ext.SplitBar.RIGHT); 1.13539 + this.el.addClass("x-splitbar-h"); 1.13540 + }else{ 1.13541 + 1.13542 + this.placement = placement || (this.el.getY() > this.resizingEl.getY() ? Ext.SplitBar.TOP : Ext.SplitBar.BOTTOM); 1.13543 + this.el.addClass("x-splitbar-v"); 1.13544 + } 1.13545 + 1.13546 + this.addEvents( 1.13547 + 1.13548 + "resize", 1.13549 + 1.13550 + "moved", 1.13551 + 1.13552 + "beforeresize", 1.13553 + 1.13554 + "beforeapply" 1.13555 + ); 1.13556 + 1.13557 + Ext.SplitBar.superclass.constructor.call(this); 1.13558 +}; 1.13559 + 1.13560 +Ext.extend(Ext.SplitBar, Ext.util.Observable, { 1.13561 + onStartProxyDrag : function(x, y){ 1.13562 + this.fireEvent("beforeresize", this); 1.13563 + this.overlay = Ext.DomHelper.append(document.body, {cls: "x-drag-overlay", html: " "}, true); 1.13564 + this.overlay.unselectable(); 1.13565 + this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); 1.13566 + this.overlay.show(); 1.13567 + Ext.get(this.proxy).setDisplayed("block"); 1.13568 + var size = this.adapter.getElementSize(this); 1.13569 + this.activeMinSize = this.getMinimumSize();; 1.13570 + this.activeMaxSize = this.getMaximumSize();; 1.13571 + var c1 = size - this.activeMinSize; 1.13572 + var c2 = Math.max(this.activeMaxSize - size, 0); 1.13573 + if(this.orientation == Ext.SplitBar.HORIZONTAL){ 1.13574 + this.dd.resetConstraints(); 1.13575 + this.dd.setXConstraint( 1.13576 + this.placement == Ext.SplitBar.LEFT ? c1 : c2, 1.13577 + this.placement == Ext.SplitBar.LEFT ? c2 : c1 1.13578 + ); 1.13579 + this.dd.setYConstraint(0, 0); 1.13580 + }else{ 1.13581 + this.dd.resetConstraints(); 1.13582 + this.dd.setXConstraint(0, 0); 1.13583 + this.dd.setYConstraint( 1.13584 + this.placement == Ext.SplitBar.TOP ? c1 : c2, 1.13585 + this.placement == Ext.SplitBar.TOP ? c2 : c1 1.13586 + ); 1.13587 + } 1.13588 + this.dragSpecs.startSize = size; 1.13589 + this.dragSpecs.startPoint = [x, y]; 1.13590 + Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd, x, y); 1.13591 + }, 1.13592 + 1.13593 + 1.13594 + onEndProxyDrag : function(e){ 1.13595 + Ext.get(this.proxy).setDisplayed(false); 1.13596 + var endPoint = Ext.lib.Event.getXY(e); 1.13597 + if(this.overlay){ 1.13598 + this.overlay.remove(); 1.13599 + delete this.overlay; 1.13600 + } 1.13601 + var newSize; 1.13602 + if(this.orientation == Ext.SplitBar.HORIZONTAL){ 1.13603 + newSize = this.dragSpecs.startSize + 1.13604 + (this.placement == Ext.SplitBar.LEFT ? 1.13605 + endPoint[0] - this.dragSpecs.startPoint[0] : 1.13606 + this.dragSpecs.startPoint[0] - endPoint[0] 1.13607 + ); 1.13608 + }else{ 1.13609 + newSize = this.dragSpecs.startSize + 1.13610 + (this.placement == Ext.SplitBar.TOP ? 1.13611 + endPoint[1] - this.dragSpecs.startPoint[1] : 1.13612 + this.dragSpecs.startPoint[1] - endPoint[1] 1.13613 + ); 1.13614 + } 1.13615 + newSize = Math.min(Math.max(newSize, this.activeMinSize), this.activeMaxSize); 1.13616 + if(newSize != this.dragSpecs.startSize){ 1.13617 + if(this.fireEvent('beforeapply', this, newSize) !== false){ 1.13618 + this.adapter.setElementSize(this, newSize); 1.13619 + this.fireEvent("moved", this, newSize); 1.13620 + this.fireEvent("resize", this, newSize); 1.13621 + } 1.13622 + } 1.13623 + }, 1.13624 + 1.13625 + 1.13626 + getAdapter : function(){ 1.13627 + return this.adapter; 1.13628 + }, 1.13629 + 1.13630 + 1.13631 + setAdapter : function(adapter){ 1.13632 + this.adapter = adapter; 1.13633 + this.adapter.init(this); 1.13634 + }, 1.13635 + 1.13636 + 1.13637 + getMinimumSize : function(){ 1.13638 + return this.minSize; 1.13639 + }, 1.13640 + 1.13641 + 1.13642 + setMinimumSize : function(minSize){ 1.13643 + this.minSize = minSize; 1.13644 + }, 1.13645 + 1.13646 + 1.13647 + getMaximumSize : function(){ 1.13648 + return this.maxSize; 1.13649 + }, 1.13650 + 1.13651 + 1.13652 + setMaximumSize : function(maxSize){ 1.13653 + this.maxSize = maxSize; 1.13654 + }, 1.13655 + 1.13656 + 1.13657 + setCurrentSize : function(size){ 1.13658 + var oldAnimate = this.animate; 1.13659 + this.animate = false; 1.13660 + this.adapter.setElementSize(this, size); 1.13661 + this.animate = oldAnimate; 1.13662 + }, 1.13663 + 1.13664 + 1.13665 + destroy : function(removeEl){ 1.13666 + if(this.shim){ 1.13667 + this.shim.remove(); 1.13668 + } 1.13669 + this.dd.unreg(); 1.13670 + Ext.removeNode(this.proxy); 1.13671 + if(removeEl){ 1.13672 + this.el.remove(); 1.13673 + } 1.13674 + } 1.13675 +}); 1.13676 + 1.13677 + 1.13678 +Ext.SplitBar.createProxy = function(dir){ 1.13679 + var proxy = new Ext.Element(document.createElement("div")); 1.13680 + proxy.unselectable(); 1.13681 + var cls = 'x-splitbar-proxy'; 1.13682 + proxy.addClass(cls + ' ' + (dir == Ext.SplitBar.HORIZONTAL ? cls +'-h' : cls + '-v')); 1.13683 + document.body.appendChild(proxy.dom); 1.13684 + return proxy.dom; 1.13685 +}; 1.13686 + 1.13687 + 1.13688 +Ext.SplitBar.BasicLayoutAdapter = function(){ 1.13689 +}; 1.13690 + 1.13691 +Ext.SplitBar.BasicLayoutAdapter.prototype = { 1.13692 + 1.13693 + init : function(s){ 1.13694 + 1.13695 + }, 1.13696 + 1.13697 + getElementSize : function(s){ 1.13698 + if(s.orientation == Ext.SplitBar.HORIZONTAL){ 1.13699 + return s.resizingEl.getWidth(); 1.13700 + }else{ 1.13701 + return s.resizingEl.getHeight(); 1.13702 + } 1.13703 + }, 1.13704 + 1.13705 + 1.13706 + setElementSize : function(s, newSize, onComplete){ 1.13707 + if(s.orientation == Ext.SplitBar.HORIZONTAL){ 1.13708 + if(!s.animate){ 1.13709 + s.resizingEl.setWidth(newSize); 1.13710 + if(onComplete){ 1.13711 + onComplete(s, newSize); 1.13712 + } 1.13713 + }else{ 1.13714 + s.resizingEl.setWidth(newSize, true, .1, onComplete, 'easeOut'); 1.13715 + } 1.13716 + }else{ 1.13717 + 1.13718 + if(!s.animate){ 1.13719 + s.resizingEl.setHeight(newSize); 1.13720 + if(onComplete){ 1.13721 + onComplete(s, newSize); 1.13722 + } 1.13723 + }else{ 1.13724 + s.resizingEl.setHeight(newSize, true, .1, onComplete, 'easeOut'); 1.13725 + } 1.13726 + } 1.13727 + } 1.13728 +}; 1.13729 + 1.13730 + 1.13731 +Ext.SplitBar.AbsoluteLayoutAdapter = function(container){ 1.13732 + this.basic = new Ext.SplitBar.BasicLayoutAdapter(); 1.13733 + this.container = Ext.get(container); 1.13734 +}; 1.13735 + 1.13736 +Ext.SplitBar.AbsoluteLayoutAdapter.prototype = { 1.13737 + init : function(s){ 1.13738 + this.basic.init(s); 1.13739 + }, 1.13740 + 1.13741 + getElementSize : function(s){ 1.13742 + return this.basic.getElementSize(s); 1.13743 + }, 1.13744 + 1.13745 + setElementSize : function(s, newSize, onComplete){ 1.13746 + this.basic.setElementSize(s, newSize, this.moveSplitter.createDelegate(this, [s])); 1.13747 + }, 1.13748 + 1.13749 + moveSplitter : function(s){ 1.13750 + var yes = Ext.SplitBar; 1.13751 + switch(s.placement){ 1.13752 + case yes.LEFT: 1.13753 + s.el.setX(s.resizingEl.getRight()); 1.13754 + break; 1.13755 + case yes.RIGHT: 1.13756 + s.el.setStyle("right", (this.container.getWidth() - s.resizingEl.getLeft()) + "px"); 1.13757 + break; 1.13758 + case yes.TOP: 1.13759 + s.el.setY(s.resizingEl.getBottom()); 1.13760 + break; 1.13761 + case yes.BOTTOM: 1.13762 + s.el.setY(s.resizingEl.getTop() - s.el.getHeight()); 1.13763 + break; 1.13764 + } 1.13765 + } 1.13766 +}; 1.13767 + 1.13768 + 1.13769 +Ext.SplitBar.VERTICAL = 1; 1.13770 + 1.13771 + 1.13772 +Ext.SplitBar.HORIZONTAL = 2; 1.13773 + 1.13774 + 1.13775 +Ext.SplitBar.LEFT = 1; 1.13776 + 1.13777 + 1.13778 +Ext.SplitBar.RIGHT = 2; 1.13779 + 1.13780 + 1.13781 +Ext.SplitBar.TOP = 3; 1.13782 + 1.13783 + 1.13784 +Ext.SplitBar.BOTTOM = 4; 1.13785 + 1.13786 + 1.13787 +Ext.Container = Ext.extend(Ext.BoxComponent, { 1.13788 + 1.13789 + 1.13790 + 1.13791 + 1.13792 + 1.13793 + 1.13794 + 1.13795 + 1.13796 + 1.13797 + autoDestroy: true, 1.13798 + 1.13799 + 1.13800 + defaultType: 'panel', 1.13801 + 1.13802 + initComponent : function(){ 1.13803 + Ext.Container.superclass.initComponent.call(this); 1.13804 + 1.13805 + this.addEvents( 1.13806 + 1.13807 + 'afterlayout', 1.13808 + 1.13809 + 'beforeadd', 1.13810 + 1.13811 + 'beforeremove', 1.13812 + 1.13813 + 'add', 1.13814 + 1.13815 + 'remove' 1.13816 + ); 1.13817 + 1.13818 + 1.13819 + var items = this.items; 1.13820 + if(items){ 1.13821 + delete this.items; 1.13822 + if(Ext.isArray(items)){ 1.13823 + this.add.apply(this, items); 1.13824 + }else{ 1.13825 + this.add(items); 1.13826 + } 1.13827 + } 1.13828 + }, 1.13829 + 1.13830 + initItems : function(){ 1.13831 + if(!this.items){ 1.13832 + this.items = new Ext.util.MixedCollection(false, this.getComponentId); 1.13833 + this.getLayout(); } 1.13834 + }, 1.13835 + 1.13836 + setLayout : function(layout){ 1.13837 + if(this.layout && this.layout != layout){ 1.13838 + this.layout.setContainer(null); 1.13839 + } 1.13840 + this.initItems(); 1.13841 + this.layout = layout; 1.13842 + layout.setContainer(this); 1.13843 + }, 1.13844 + 1.13845 + render : function(){ 1.13846 + Ext.Container.superclass.render.apply(this, arguments); 1.13847 + if(this.layout){ 1.13848 + if(typeof this.layout == 'string'){ 1.13849 + this.layout = new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig); 1.13850 + } 1.13851 + this.setLayout(this.layout); 1.13852 + 1.13853 + if(this.activeItem !== undefined){ 1.13854 + var item = this.activeItem; 1.13855 + delete this.activeItem; 1.13856 + this.layout.setActiveItem(item); 1.13857 + return; 1.13858 + } 1.13859 + } 1.13860 + if(!this.ownerCt){ 1.13861 + this.doLayout(); 1.13862 + } 1.13863 + if(this.monitorResize === true){ 1.13864 + Ext.EventManager.onWindowResize(this.doLayout, this, [false]); 1.13865 + } 1.13866 + }, 1.13867 + 1.13868 + getLayoutTarget : function(){ 1.13869 + return this.el; 1.13870 + }, 1.13871 + 1.13872 + getComponentId : function(comp){ 1.13873 + return comp.itemId || comp.id; 1.13874 + }, 1.13875 + 1.13876 + 1.13877 + add : function(comp){ 1.13878 + if(!this.items){ 1.13879 + this.initItems(); 1.13880 + } 1.13881 + var a = arguments, len = a.length; 1.13882 + if(len > 1){ 1.13883 + for(var i = 0; i < len; i++) { 1.13884 + this.add(a[i]); 1.13885 + } 1.13886 + return; 1.13887 + } 1.13888 + var c = this.lookupComponent(this.applyDefaults(comp)); 1.13889 + var pos = this.items.length; 1.13890 + if(this.fireEvent('beforeadd', this, c, pos) !== false && this.onBeforeAdd(c) !== false){ 1.13891 + this.items.add(c); 1.13892 + c.ownerCt = this; 1.13893 + this.fireEvent('add', this, c, pos); 1.13894 + } 1.13895 + return c; 1.13896 + }, 1.13897 + 1.13898 + 1.13899 + insert : function(index, comp){ 1.13900 + if(!this.items){ 1.13901 + this.initItems(); 1.13902 + } 1.13903 + var a = arguments, len = a.length; 1.13904 + if(len > 2){ 1.13905 + for(var i = len-1; i >= 1; --i) { 1.13906 + this.insert(index, a[i]); 1.13907 + } 1.13908 + return; 1.13909 + } 1.13910 + var c = this.lookupComponent(this.applyDefaults(comp)); 1.13911 + 1.13912 + if(c.ownerCt == this && this.items.indexOf(c) < index){ 1.13913 + --index; 1.13914 + } 1.13915 + 1.13916 + if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){ 1.13917 + this.items.insert(index, c); 1.13918 + c.ownerCt = this; 1.13919 + this.fireEvent('add', this, c, index); 1.13920 + } 1.13921 + return c; 1.13922 + }, 1.13923 + 1.13924 + applyDefaults : function(c){ 1.13925 + if(this.defaults){ 1.13926 + if(typeof c == 'string'){ 1.13927 + c = Ext.ComponentMgr.get(c); 1.13928 + Ext.apply(c, this.defaults); 1.13929 + }else if(!c.events){ 1.13930 + Ext.applyIf(c, this.defaults); 1.13931 + }else{ 1.13932 + Ext.apply(c, this.defaults); 1.13933 + } 1.13934 + } 1.13935 + return c; 1.13936 + }, 1.13937 + 1.13938 + onBeforeAdd : function(item){ 1.13939 + if(item.ownerCt){ 1.13940 + item.ownerCt.remove(item, false); 1.13941 + } 1.13942 + if(this.hideBorders === true){ 1.13943 + item.border = (item.border === true); 1.13944 + } 1.13945 + }, 1.13946 + 1.13947 + 1.13948 + remove : function(comp, autoDestroy){ 1.13949 + var c = this.getComponent(comp); 1.13950 + if(c && this.fireEvent('beforeremove', this, c) !== false){ 1.13951 + this.items.remove(c); 1.13952 + delete c.ownerCt; 1.13953 + if(autoDestroy === true || (autoDestroy !== false && this.autoDestroy)){ 1.13954 + c.destroy(); 1.13955 + } 1.13956 + if(this.layout && this.layout.activeItem == c){ 1.13957 + delete this.layout.activeItem; 1.13958 + } 1.13959 + this.fireEvent('remove', this, c); 1.13960 + } 1.13961 + return c; 1.13962 + }, 1.13963 + 1.13964 + 1.13965 + getComponent : function(comp){ 1.13966 + if(typeof comp == 'object'){ 1.13967 + return comp; 1.13968 + } 1.13969 + return this.items.get(comp); 1.13970 + }, 1.13971 + 1.13972 + lookupComponent : function(comp){ 1.13973 + if(typeof comp == 'string'){ 1.13974 + return Ext.ComponentMgr.get(comp); 1.13975 + }else if(!comp.events){ 1.13976 + return this.createComponent(comp); 1.13977 + } 1.13978 + return comp; 1.13979 + }, 1.13980 + 1.13981 + createComponent : function(config){ 1.13982 + return Ext.ComponentMgr.create(config, this.defaultType); 1.13983 + }, 1.13984 + 1.13985 + 1.13986 + doLayout : function(shallow){ 1.13987 + if(this.rendered && this.layout){ 1.13988 + this.layout.layout(); 1.13989 + } 1.13990 + if(shallow !== false && this.items){ 1.13991 + var cs = this.items.items; 1.13992 + for(var i = 0, len = cs.length; i < len; i++) { 1.13993 + var c = cs[i]; 1.13994 + if(c.doLayout){ 1.13995 + c.doLayout(); 1.13996 + } 1.13997 + } 1.13998 + } 1.13999 + }, 1.14000 + 1.14001 + 1.14002 + getLayout : function(){ 1.14003 + if(!this.layout){ 1.14004 + var layout = new Ext.layout.ContainerLayout(this.layoutConfig); 1.14005 + this.setLayout(layout); 1.14006 + } 1.14007 + return this.layout; 1.14008 + }, 1.14009 + 1.14010 + onDestroy : function(){ 1.14011 + if(this.items){ 1.14012 + var cs = this.items.items; 1.14013 + for(var i = 0, len = cs.length; i < len; i++) { 1.14014 + Ext.destroy(cs[i]); 1.14015 + } 1.14016 + } 1.14017 + if(this.monitorResize){ 1.14018 + Ext.EventManager.removeResizeListener(this.doLayout, this); 1.14019 + } 1.14020 + Ext.Container.superclass.onDestroy.call(this); 1.14021 + }, 1.14022 + 1.14023 + 1.14024 + bubble : function(fn, scope, args){ 1.14025 + var p = this; 1.14026 + while(p){ 1.14027 + if(fn.apply(scope || p, args || [p]) === false){ 1.14028 + break; 1.14029 + } 1.14030 + p = p.ownerCt; 1.14031 + } 1.14032 + }, 1.14033 + 1.14034 + 1.14035 + cascade : function(fn, scope, args){ 1.14036 + if(fn.apply(scope || this, args || [this]) !== false){ 1.14037 + if(this.items){ 1.14038 + var cs = this.items.items; 1.14039 + for(var i = 0, len = cs.length; i < len; i++){ 1.14040 + if(cs[i].cascade){ 1.14041 + cs[i].cascade(fn, scope, args); 1.14042 + }else{ 1.14043 + fn.apply(scope || this, args || [cs[i]]); 1.14044 + } 1.14045 + } 1.14046 + } 1.14047 + } 1.14048 + }, 1.14049 + 1.14050 + 1.14051 + findById : function(id){ 1.14052 + var m, ct = this; 1.14053 + this.cascade(function(c){ 1.14054 + if(ct != c && c.id === id){ 1.14055 + m = c; 1.14056 + return false; 1.14057 + } 1.14058 + }); 1.14059 + return m || null; 1.14060 + }, 1.14061 + 1.14062 + 1.14063 + findByType : function(xtype){ 1.14064 + return typeof xtype == 'function' ? 1.14065 + this.findBy(function(c){ 1.14066 + return c.constructor === xtype; 1.14067 + }) : 1.14068 + this.findBy(function(c){ 1.14069 + return c.constructor.xtype === xtype; 1.14070 + }); 1.14071 + }, 1.14072 + 1.14073 + 1.14074 + find : function(prop, value){ 1.14075 + return this.findBy(function(c){ 1.14076 + return c[prop] === value; 1.14077 + }); 1.14078 + }, 1.14079 + 1.14080 + 1.14081 + findBy : function(fn, scope){ 1.14082 + var m = [], ct = this; 1.14083 + this.cascade(function(c){ 1.14084 + if(ct != c && fn.call(scope || c, c, ct) === true){ 1.14085 + m.push(c); 1.14086 + } 1.14087 + }); 1.14088 + return m; 1.14089 + } 1.14090 +}); 1.14091 + 1.14092 +Ext.Container.LAYOUTS = {}; 1.14093 +Ext.reg('container', Ext.Container); 1.14094 + 1.14095 +Ext.layout.ContainerLayout = function(config){ 1.14096 + Ext.apply(this, config); 1.14097 +}; 1.14098 + 1.14099 +Ext.layout.ContainerLayout.prototype = { 1.14100 + 1.14101 + 1.14102 + 1.14103 + 1.14104 + 1.14105 + monitorResize:false, 1.14106 + activeItem : null, 1.14107 + 1.14108 + layout : function(){ 1.14109 + var target = this.container.getLayoutTarget(); 1.14110 + this.onLayout(this.container, target); 1.14111 + this.container.fireEvent('afterlayout', this.container, this); 1.14112 + }, 1.14113 + 1.14114 + onLayout : function(ct, target){ 1.14115 + this.renderAll(ct, target); 1.14116 + }, 1.14117 + 1.14118 + isValidParent : function(c, target){ 1.14119 + var el = c.getPositionEl ? c.getPositionEl() : c.getEl(); 1.14120 + return el.dom.parentNode == target.dom; 1.14121 + }, 1.14122 + 1.14123 + renderAll : function(ct, target){ 1.14124 + var items = ct.items.items; 1.14125 + for(var i = 0, len = items.length; i < len; i++) { 1.14126 + var c = items[i]; 1.14127 + if(c && (!c.rendered || !this.isValidParent(c, target))){ 1.14128 + this.renderItem(c, i, target); 1.14129 + } 1.14130 + } 1.14131 + }, 1.14132 + 1.14133 + renderItem : function(c, position, target){ 1.14134 + if(c && !c.rendered){ 1.14135 + c.render(target, position); 1.14136 + if(this.extraCls){ 1.14137 + var t = c.getPositionEl ? c.getPositionEl() : c; 1.14138 + t.addClass(this.extraCls); 1.14139 + } 1.14140 + if (this.renderHidden && c != this.activeItem) { 1.14141 + c.hide(); 1.14142 + } 1.14143 + }else if(c && !this.isValidParent(c, target)){ 1.14144 + if(this.extraCls){ 1.14145 + c.addClass(this.extraCls); 1.14146 + } 1.14147 + if(typeof position == 'number'){ 1.14148 + position = target.dom.childNodes[position]; 1.14149 + } 1.14150 + target.dom.insertBefore(c.getEl().dom, position || null); 1.14151 + if (this.renderHidden && c != this.activeItem) { 1.14152 + c.hide(); 1.14153 + } 1.14154 + } 1.14155 + }, 1.14156 + 1.14157 + onResize: function(){ 1.14158 + if(this.container.collapsed){ 1.14159 + return; 1.14160 + } 1.14161 + var b = this.container.bufferResize; 1.14162 + if(b){ 1.14163 + if(!this.resizeTask){ 1.14164 + this.resizeTask = new Ext.util.DelayedTask(this.layout, this); 1.14165 + this.resizeBuffer = typeof b == 'number' ? b : 100; 1.14166 + } 1.14167 + this.resizeTask.delay(this.resizeBuffer); 1.14168 + }else{ 1.14169 + this.layout(); 1.14170 + } 1.14171 + }, 1.14172 + 1.14173 + setContainer : function(ct){ 1.14174 + if(this.monitorResize && ct != this.container){ 1.14175 + if(this.container){ 1.14176 + this.container.un('resize', this.onResize, this); 1.14177 + } 1.14178 + if(ct){ 1.14179 + ct.on('resize', this.onResize, this); 1.14180 + } 1.14181 + } 1.14182 + this.container = ct; 1.14183 + }, 1.14184 + 1.14185 + parseMargins : function(v){ 1.14186 + var ms = v.split(' '); 1.14187 + var len = ms.length; 1.14188 + if(len == 1){ 1.14189 + ms[1] = ms[0]; 1.14190 + ms[2] = ms[0]; 1.14191 + ms[3] = ms[0]; 1.14192 + } 1.14193 + if(len == 2){ 1.14194 + ms[2] = ms[0]; 1.14195 + ms[3] = ms[1]; 1.14196 + } 1.14197 + return { 1.14198 + top:parseInt(ms[0], 10) || 0, 1.14199 + right:parseInt(ms[1], 10) || 0, 1.14200 + bottom:parseInt(ms[2], 10) || 0, 1.14201 + left:parseInt(ms[3], 10) || 0 1.14202 + }; 1.14203 + } 1.14204 +}; 1.14205 +Ext.Container.LAYOUTS['auto'] = Ext.layout.ContainerLayout; 1.14206 + 1.14207 +Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, { 1.14208 + 1.14209 + monitorResize:true, 1.14210 + 1.14211 + 1.14212 + onLayout : function(ct, target){ 1.14213 + Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target); 1.14214 + if(!this.container.collapsed){ 1.14215 + this.setItemSize(this.activeItem || ct.items.itemAt(0), target.getStyleSize()); 1.14216 + } 1.14217 + }, 1.14218 + 1.14219 + 1.14220 + setItemSize : function(item, size){ 1.14221 + if(item && size.height > 0){ 1.14222 + item.setSize(size); 1.14223 + } 1.14224 + } 1.14225 +}); 1.14226 +Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout; 1.14227 + 1.14228 +Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, { 1.14229 + 1.14230 + deferredRender : false, 1.14231 + 1.14232 + 1.14233 + renderHidden : true, 1.14234 + 1.14235 + 1.14236 + setActiveItem : function(item){ 1.14237 + item = this.container.getComponent(item); 1.14238 + if(this.activeItem != item){ 1.14239 + if(this.activeItem){ 1.14240 + this.activeItem.hide(); 1.14241 + } 1.14242 + this.activeItem = item; 1.14243 + item.show(); 1.14244 + this.layout(); 1.14245 + } 1.14246 + }, 1.14247 + 1.14248 + 1.14249 + renderAll : function(ct, target){ 1.14250 + if(this.deferredRender){ 1.14251 + this.renderItem(this.activeItem, undefined, target); 1.14252 + }else{ 1.14253 + Ext.layout.CardLayout.superclass.renderAll.call(this, ct, target); 1.14254 + } 1.14255 + } 1.14256 +}); 1.14257 +Ext.Container.LAYOUTS['card'] = Ext.layout.CardLayout; 1.14258 + 1.14259 +Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, { 1.14260 + 1.14261 + monitorResize:true, 1.14262 + 1.14263 + 1.14264 + getAnchorViewSize : function(ct, target){ 1.14265 + return target.dom == document.body ? 1.14266 + target.getViewSize() : target.getStyleSize(); 1.14267 + }, 1.14268 + 1.14269 + 1.14270 + onLayout : function(ct, target){ 1.14271 + Ext.layout.AnchorLayout.superclass.onLayout.call(this, ct, target); 1.14272 + 1.14273 + var size = this.getAnchorViewSize(ct, target); 1.14274 + 1.14275 + var w = size.width, h = size.height; 1.14276 + 1.14277 + if(w < 20 || h < 20){ 1.14278 + return; 1.14279 + } 1.14280 + 1.14281 + 1.14282 + var aw, ah; 1.14283 + if(ct.anchorSize){ 1.14284 + if(typeof ct.anchorSize == 'number'){ 1.14285 + aw = ct.anchorSize; 1.14286 + }else{ 1.14287 + aw = ct.anchorSize.width; 1.14288 + ah = ct.anchorSize.height; 1.14289 + } 1.14290 + }else{ 1.14291 + aw = ct.initialConfig.width; 1.14292 + ah = ct.initialConfig.height; 1.14293 + } 1.14294 + 1.14295 + var cs = ct.items.items, len = cs.length, i, c, a, cw, ch; 1.14296 + for(i = 0; i < len; i++){ 1.14297 + c = cs[i]; 1.14298 + if(c.anchor){ 1.14299 + a = c.anchorSpec; 1.14300 + if(!a){ 1.14301 + var vs = c.anchor.split(' '); 1.14302 + c.anchorSpec = a = { 1.14303 + right: this.parseAnchor(vs[0], c.initialConfig.width, aw), 1.14304 + bottom: this.parseAnchor(vs[1], c.initialConfig.height, ah) 1.14305 + }; 1.14306 + } 1.14307 + cw = a.right ? this.adjustWidthAnchor(a.right(w), c) : undefined; 1.14308 + ch = a.bottom ? this.adjustHeightAnchor(a.bottom(h), c) : undefined; 1.14309 + 1.14310 + if(cw || ch){ 1.14311 + c.setSize(cw || undefined, ch || undefined); 1.14312 + } 1.14313 + } 1.14314 + } 1.14315 + }, 1.14316 + 1.14317 + 1.14318 + parseAnchor : function(a, start, cstart){ 1.14319 + if(a && a != 'none'){ 1.14320 + var last; 1.14321 + if(/^(r|right|b|bottom)$/i.test(a)){ 1.14322 + var diff = cstart - start; 1.14323 + return function(v){ 1.14324 + if(v !== last){ 1.14325 + last = v; 1.14326 + return v - diff; 1.14327 + } 1.14328 + } 1.14329 + }else if(a.indexOf('%') != -1){ 1.14330 + var ratio = parseFloat(a.replace('%', ''))*.01; 1.14331 + return function(v){ 1.14332 + if(v !== last){ 1.14333 + last = v; 1.14334 + return Math.floor(v*ratio); 1.14335 + } 1.14336 + } 1.14337 + }else{ 1.14338 + a = parseInt(a, 10); 1.14339 + if(!isNaN(a)){ 1.14340 + return function(v){ 1.14341 + if(v !== last){ 1.14342 + last = v; 1.14343 + return v + a; 1.14344 + } 1.14345 + } 1.14346 + } 1.14347 + } 1.14348 + } 1.14349 + return false; 1.14350 + }, 1.14351 + 1.14352 + 1.14353 + adjustWidthAnchor : function(value, comp){ 1.14354 + return value; 1.14355 + }, 1.14356 + 1.14357 + 1.14358 + adjustHeightAnchor : function(value, comp){ 1.14359 + return value; 1.14360 + } 1.14361 + 1.14362 + 1.14363 +}); 1.14364 +Ext.Container.LAYOUTS['anchor'] = Ext.layout.AnchorLayout; 1.14365 + 1.14366 +Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { 1.14367 + 1.14368 + monitorResize:true, 1.14369 + 1.14370 + extraCls: 'x-column', 1.14371 + 1.14372 + scrollOffset : 0, 1.14373 + 1.14374 + 1.14375 + isValidParent : function(c, target){ 1.14376 + return c.getEl().dom.parentNode == this.innerCt.dom; 1.14377 + }, 1.14378 + 1.14379 + 1.14380 + onLayout : function(ct, target){ 1.14381 + var cs = ct.items.items, len = cs.length, c, i; 1.14382 + 1.14383 + if(!this.innerCt){ 1.14384 + target.addClass('x-column-layout-ct'); 1.14385 + 1.14386 + 1.14387 + 1.14388 + this.innerCt = target.createChild({cls:'x-column-inner'}); 1.14389 + this.innerCt.createChild({cls:'x-clear'}); 1.14390 + } 1.14391 + this.renderAll(ct, this.innerCt); 1.14392 + 1.14393 + var size = target.getViewSize(); 1.14394 + 1.14395 + if(size.width < 1 && size.height < 1){ 1.14396 + return; 1.14397 + } 1.14398 + 1.14399 + var w = size.width - target.getPadding('lr') - this.scrollOffset, 1.14400 + h = size.height - target.getPadding('tb'), 1.14401 + pw = w; 1.14402 + 1.14403 + this.innerCt.setWidth(w); 1.14404 + 1.14405 + 1.14406 + 1.14407 + 1.14408 + for(i = 0; i < len; i++){ 1.14409 + c = cs[i]; 1.14410 + if(!c.columnWidth){ 1.14411 + pw -= (c.getSize().width + c.getEl().getMargins('lr')); 1.14412 + } 1.14413 + } 1.14414 + 1.14415 + pw = pw < 0 ? 0 : pw; 1.14416 + 1.14417 + for(i = 0; i < len; i++){ 1.14418 + c = cs[i]; 1.14419 + if(c.columnWidth){ 1.14420 + c.setSize(Math.floor(c.columnWidth*pw) - c.getEl().getMargins('lr')); 1.14421 + } 1.14422 + } 1.14423 + } 1.14424 + 1.14425 + 1.14426 +}); 1.14427 + 1.14428 +Ext.Container.LAYOUTS['column'] = Ext.layout.ColumnLayout; 1.14429 + 1.14430 +Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, { 1.14431 + monitorResize:true, 1.14432 + rendered : false, 1.14433 + 1.14434 + onLayout : function(ct, target){ 1.14435 + var collapsed; 1.14436 + if(!this.rendered){ 1.14437 + target.position(); 1.14438 + target.addClass('x-border-layout-ct'); 1.14439 + var items = ct.items.items; 1.14440 + collapsed = []; 1.14441 + for(var i = 0, len = items.length; i < len; i++) { 1.14442 + var c = items[i]; 1.14443 + var pos = c.region; 1.14444 + if(c.collapsed){ 1.14445 + collapsed.push(c); 1.14446 + } 1.14447 + c.collapsed = false; 1.14448 + if(!c.rendered){ 1.14449 + c.cls = c.cls ? c.cls +' x-border-panel' : 'x-border-panel'; 1.14450 + c.render(target, i); 1.14451 + } 1.14452 + this[pos] = pos != 'center' && c.split ? 1.14453 + new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) : 1.14454 + new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos); 1.14455 + this[pos].render(target, c); 1.14456 + } 1.14457 + this.rendered = true; 1.14458 + } 1.14459 + 1.14460 + var size = target.getViewSize(); 1.14461 + if(size.width < 20 || size.height < 20){ if(collapsed){ 1.14462 + this.restoreCollapsed = collapsed; 1.14463 + } 1.14464 + return; 1.14465 + }else if(this.restoreCollapsed){ 1.14466 + collapsed = this.restoreCollapsed; 1.14467 + delete this.restoreCollapsed; 1.14468 + } 1.14469 + 1.14470 + var w = size.width, h = size.height; 1.14471 + var centerW = w, centerH = h, centerY = 0, centerX = 0; 1.14472 + 1.14473 + var n = this.north, s = this.south, west = this.west, e = this.east, c = this.center; 1.14474 + if(!c){ 1.14475 + throw 'No center region defined in BorderLayout ' + ct.id; 1.14476 + } 1.14477 + 1.14478 + if(n && n.isVisible()){ 1.14479 + var b = n.getSize(); 1.14480 + var m = n.getMargins(); 1.14481 + b.width = w - (m.left+m.right); 1.14482 + b.x = m.left; 1.14483 + b.y = m.top; 1.14484 + centerY = b.height + b.y + m.bottom; 1.14485 + centerH -= centerY; 1.14486 + n.applyLayout(b); 1.14487 + } 1.14488 + if(s && s.isVisible()){ 1.14489 + var b = s.getSize(); 1.14490 + var m = s.getMargins(); 1.14491 + b.width = w - (m.left+m.right); 1.14492 + b.x = m.left; 1.14493 + var totalHeight = (b.height + m.top + m.bottom); 1.14494 + b.y = h - totalHeight + m.top; 1.14495 + centerH -= totalHeight; 1.14496 + s.applyLayout(b); 1.14497 + } 1.14498 + if(west && west.isVisible()){ 1.14499 + var b = west.getSize(); 1.14500 + var m = west.getMargins(); 1.14501 + b.height = centerH - (m.top+m.bottom); 1.14502 + b.x = m.left; 1.14503 + b.y = centerY + m.top; 1.14504 + var totalWidth = (b.width + m.left + m.right); 1.14505 + centerX += totalWidth; 1.14506 + centerW -= totalWidth; 1.14507 + west.applyLayout(b); 1.14508 + } 1.14509 + if(e && e.isVisible()){ 1.14510 + var b = e.getSize(); 1.14511 + var m = e.getMargins(); 1.14512 + b.height = centerH - (m.top+m.bottom); 1.14513 + var totalWidth = (b.width + m.left + m.right); 1.14514 + b.x = w - totalWidth + m.left; 1.14515 + b.y = centerY + m.top; 1.14516 + centerW -= totalWidth; 1.14517 + e.applyLayout(b); 1.14518 + } 1.14519 + 1.14520 + var m = c.getMargins(); 1.14521 + var centerBox = { 1.14522 + x: centerX + m.left, 1.14523 + y: centerY + m.top, 1.14524 + width: centerW - (m.left+m.right), 1.14525 + height: centerH - (m.top+m.bottom) 1.14526 + }; 1.14527 + c.applyLayout(centerBox); 1.14528 + 1.14529 + if(collapsed){ 1.14530 + for(var i = 0, len = collapsed.length; i < len; i++){ 1.14531 + collapsed[i].collapse(false); 1.14532 + } 1.14533 + } 1.14534 + 1.14535 + if(Ext.isIE && Ext.isStrict){ target.repaint(); 1.14536 + } 1.14537 + } 1.14538 + 1.14539 + 1.14540 +}); 1.14541 + 1.14542 + 1.14543 +Ext.layout.BorderLayout.Region = function(layout, config, pos){ 1.14544 + Ext.apply(this, config); 1.14545 + this.layout = layout; 1.14546 + this.position = pos; 1.14547 + this.state = {}; 1.14548 + if(typeof this.margins == 'string'){ 1.14549 + this.margins = this.layout.parseMargins(this.margins); 1.14550 + } 1.14551 + this.margins = Ext.applyIf(this.margins || {}, this.defaultMargins); 1.14552 + if(this.collapsible){ 1.14553 + if(typeof this.cmargins == 'string'){ 1.14554 + this.cmargins = this.layout.parseMargins(this.cmargins); 1.14555 + } 1.14556 + if(this.collapseMode == 'mini' && !this.cmargins){ 1.14557 + this.cmargins = {left:0,top:0,right:0,bottom:0}; 1.14558 + }else{ 1.14559 + this.cmargins = Ext.applyIf(this.cmargins || {}, 1.14560 + pos == 'north' || pos == 'south' ? this.defaultNSCMargins : this.defaultEWCMargins); 1.14561 + } 1.14562 + } 1.14563 +}; 1.14564 + 1.14565 +Ext.layout.BorderLayout.Region.prototype = { 1.14566 + 1.14567 + 1.14568 + 1.14569 + 1.14570 + 1.14571 + 1.14572 + 1.14573 + collapsible : false, 1.14574 + 1.14575 + split:false, 1.14576 + 1.14577 + floatable: true, 1.14578 + 1.14579 + minWidth:50, 1.14580 + 1.14581 + minHeight:50, 1.14582 + 1.14583 + defaultMargins : {left:0,top:0,right:0,bottom:0}, 1.14584 + defaultNSCMargins : {left:5,top:5,right:5,bottom:5}, 1.14585 + defaultEWCMargins : {left:5,top:0,right:5,bottom:0}, 1.14586 + 1.14587 + 1.14588 + isCollapsed : false, 1.14589 + 1.14590 + 1.14591 + 1.14592 + 1.14593 + 1.14594 + render : function(ct, p){ 1.14595 + this.panel = p; 1.14596 + p.el.enableDisplayMode(); 1.14597 + this.targetEl = ct; 1.14598 + this.el = p.el; 1.14599 + 1.14600 + var gs = p.getState, ps = this.position; 1.14601 + p.getState = function(){ 1.14602 + return Ext.apply(gs.call(p) || {}, this.state); 1.14603 + }.createDelegate(this); 1.14604 + 1.14605 + if(ps != 'center'){ 1.14606 + p.allowQueuedExpand = false; 1.14607 + p.on({ 1.14608 + beforecollapse: this.beforeCollapse, 1.14609 + collapse: this.onCollapse, 1.14610 + beforeexpand: this.beforeExpand, 1.14611 + expand: this.onExpand, 1.14612 + hide: this.onHide, 1.14613 + show: this.onShow, 1.14614 + scope: this 1.14615 + }); 1.14616 + if(this.collapsible){ 1.14617 + p.collapseEl = 'el'; 1.14618 + p.slideAnchor = this.getSlideAnchor(); 1.14619 + } 1.14620 + if(p.tools && p.tools.toggle){ 1.14621 + p.tools.toggle.addClass('x-tool-collapse-'+ps); 1.14622 + p.tools.toggle.addClassOnOver('x-tool-collapse-'+ps+'-over'); 1.14623 + } 1.14624 + } 1.14625 + }, 1.14626 + 1.14627 + getCollapsedEl : function(){ 1.14628 + if(!this.collapsedEl){ 1.14629 + if(!this.toolTemplate){ 1.14630 + var tt = new Ext.Template( 1.14631 + '<div class="x-tool x-tool-{id}"> </div>' 1.14632 + ); 1.14633 + tt.disableFormats = true; 1.14634 + tt.compile(); 1.14635 + Ext.layout.BorderLayout.Region.prototype.toolTemplate = tt; 1.14636 + } 1.14637 + this.collapsedEl = this.targetEl.createChild({ 1.14638 + cls: "x-layout-collapsed x-layout-collapsed-"+this.position, 1.14639 + id: this.panel.id + '-xcollapsed' 1.14640 + }); 1.14641 + this.collapsedEl.enableDisplayMode('block'); 1.14642 + 1.14643 + if(this.collapseMode == 'mini'){ 1.14644 + this.collapsedEl.addClass('x-layout-cmini-'+this.position); 1.14645 + this.miniCollapsedEl = this.collapsedEl.createChild({ 1.14646 + cls: "x-layout-mini x-layout-mini-"+this.position, html: " " 1.14647 + }); 1.14648 + this.miniCollapsedEl.addClassOnOver('x-layout-mini-over'); 1.14649 + this.collapsedEl.addClassOnOver("x-layout-collapsed-over"); 1.14650 + this.collapsedEl.on('click', this.onExpandClick, this, {stopEvent:true}); 1.14651 + }else { 1.14652 + var t = this.toolTemplate.append( 1.14653 + this.collapsedEl.dom, 1.14654 + {id:'expand-'+this.position}, true); 1.14655 + t.addClassOnOver('x-tool-expand-'+this.position+'-over'); 1.14656 + t.on('click', this.onExpandClick, this, {stopEvent:true}); 1.14657 + 1.14658 + if(this.floatable !== false){ 1.14659 + this.collapsedEl.addClassOnOver("x-layout-collapsed-over"); 1.14660 + this.collapsedEl.on("click", this.collapseClick, this); 1.14661 + } 1.14662 + } 1.14663 + } 1.14664 + return this.collapsedEl; 1.14665 + }, 1.14666 + 1.14667 + onExpandClick : function(e){ 1.14668 + if(this.isSlid){ 1.14669 + this.afterSlideIn(); 1.14670 + this.panel.expand(false); 1.14671 + }else{ 1.14672 + this.panel.expand(); 1.14673 + } 1.14674 + }, 1.14675 + 1.14676 + onCollapseClick : function(e){ 1.14677 + this.panel.collapse(); 1.14678 + }, 1.14679 + 1.14680 + beforeCollapse : function(p, animate){ 1.14681 + this.lastAnim = animate; 1.14682 + if(this.splitEl){ 1.14683 + this.splitEl.hide(); 1.14684 + } 1.14685 + this.getCollapsedEl().show(); 1.14686 + this.panel.el.setStyle('z-index', 100); 1.14687 + this.isCollapsed = true; 1.14688 + this.layout.layout(); 1.14689 + }, 1.14690 + 1.14691 + onCollapse : function(animate){ 1.14692 + this.panel.el.setStyle('z-index', 1); 1.14693 + if(this.lastAnim === false || this.panel.animCollapse === false){ 1.14694 + this.getCollapsedEl().dom.style.visibility = 'visible'; 1.14695 + }else{ 1.14696 + this.getCollapsedEl().slideIn(this.panel.slideAnchor, {duration:.2}); 1.14697 + } 1.14698 + this.state.collapsed = true; 1.14699 + this.panel.saveState(); 1.14700 + }, 1.14701 + 1.14702 + beforeExpand : function(animate){ 1.14703 + var c = this.getCollapsedEl(); 1.14704 + this.el.show(); 1.14705 + if(this.position == 'east' || this.position == 'west'){ 1.14706 + this.panel.setSize(undefined, c.getHeight()); 1.14707 + }else{ 1.14708 + this.panel.setSize(c.getWidth(), undefined); 1.14709 + } 1.14710 + c.hide(); 1.14711 + c.dom.style.visibility = 'hidden'; 1.14712 + this.panel.el.setStyle('z-index', 100); 1.14713 + }, 1.14714 + 1.14715 + onExpand : function(){ 1.14716 + this.isCollapsed = false; 1.14717 + if(this.splitEl){ 1.14718 + this.splitEl.show(); 1.14719 + } 1.14720 + this.layout.layout(); 1.14721 + this.panel.el.setStyle('z-index', 1); 1.14722 + this.state.collapsed = false; 1.14723 + this.panel.saveState(); 1.14724 + }, 1.14725 + 1.14726 + collapseClick : function(e){ 1.14727 + if(this.isSlid){ 1.14728 + e.stopPropagation(); 1.14729 + this.slideIn(); 1.14730 + }else{ 1.14731 + e.stopPropagation(); 1.14732 + this.slideOut(); 1.14733 + } 1.14734 + }, 1.14735 + 1.14736 + onHide : function(){ 1.14737 + if(this.isCollapsed){ 1.14738 + this.getCollapsedEl().hide(); 1.14739 + }else if(this.splitEl){ 1.14740 + this.splitEl.hide(); 1.14741 + } 1.14742 + }, 1.14743 + 1.14744 + onShow : function(){ 1.14745 + if(this.isCollapsed){ 1.14746 + this.getCollapsedEl().show(); 1.14747 + }else if(this.splitEl){ 1.14748 + this.splitEl.show(); 1.14749 + } 1.14750 + }, 1.14751 + 1.14752 + 1.14753 + isVisible : function(){ 1.14754 + return !this.panel.hidden; 1.14755 + }, 1.14756 + 1.14757 + 1.14758 + getMargins : function(){ 1.14759 + return this.isCollapsed && this.cmargins ? this.cmargins : this.margins; 1.14760 + }, 1.14761 + 1.14762 + 1.14763 + getSize : function(){ 1.14764 + return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel.getSize(); 1.14765 + }, 1.14766 + 1.14767 + 1.14768 + setPanel : function(panel){ 1.14769 + this.panel = panel; 1.14770 + }, 1.14771 + 1.14772 + 1.14773 + getMinWidth: function(){ 1.14774 + return this.minWidth; 1.14775 + }, 1.14776 + 1.14777 + 1.14778 + getMinHeight: function(){ 1.14779 + return this.minHeight; 1.14780 + }, 1.14781 + 1.14782 + applyLayoutCollapsed : function(box){ 1.14783 + var ce = this.getCollapsedEl(); 1.14784 + ce.setLeftTop(box.x, box.y); 1.14785 + ce.setSize(box.width, box.height); 1.14786 + }, 1.14787 + 1.14788 + applyLayout : function(box){ 1.14789 + if(this.isCollapsed){ 1.14790 + this.applyLayoutCollapsed(box); 1.14791 + }else{ 1.14792 + this.panel.setPosition(box.x, box.y); 1.14793 + this.panel.setSize(box.width, box.height); 1.14794 + } 1.14795 + }, 1.14796 + 1.14797 + beforeSlide: function(){ 1.14798 + this.panel.beforeEffect(); 1.14799 + }, 1.14800 + 1.14801 + afterSlide : function(){ 1.14802 + this.panel.afterEffect(); 1.14803 + }, 1.14804 + 1.14805 + initAutoHide : function(){ 1.14806 + if(this.autoHide !== false){ 1.14807 + if(!this.autoHideHd){ 1.14808 + var st = new Ext.util.DelayedTask(this.slideIn, this); 1.14809 + this.autoHideHd = { 1.14810 + "mouseout": function(e){ 1.14811 + if(!e.within(this.el, true)){ 1.14812 + st.delay(500); 1.14813 + } 1.14814 + }, 1.14815 + "mouseover" : function(e){ 1.14816 + st.cancel(); 1.14817 + }, 1.14818 + scope : this 1.14819 + }; 1.14820 + } 1.14821 + this.el.on(this.autoHideHd); 1.14822 + } 1.14823 + }, 1.14824 + 1.14825 + clearAutoHide : function(){ 1.14826 + if(this.autoHide !== false){ 1.14827 + this.el.un("mouseout", this.autoHideHd.mouseout); 1.14828 + this.el.un("mouseover", this.autoHideHd.mouseover); 1.14829 + } 1.14830 + }, 1.14831 + 1.14832 + clearMonitor : function(){ 1.14833 + Ext.getDoc().un("click", this.slideInIf, this); 1.14834 + }, 1.14835 + 1.14836 + slideOut : function(){ 1.14837 + if(this.isSlid || this.el.hasActiveFx()){ 1.14838 + return; 1.14839 + } 1.14840 + this.isSlid = true; 1.14841 + var ts = this.panel.tools; 1.14842 + if(ts && ts.toggle){ 1.14843 + ts.toggle.hide(); 1.14844 + } 1.14845 + this.el.show(); 1.14846 + if(this.position == 'east' || this.position == 'west'){ 1.14847 + this.panel.setSize(undefined, this.collapsedEl.getHeight()); 1.14848 + }else{ 1.14849 + this.panel.setSize(this.collapsedEl.getWidth(), undefined); 1.14850 + } 1.14851 + this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top]; 1.14852 + this.el.alignTo(this.collapsedEl, this.getCollapseAnchor()); 1.14853 + this.el.setStyle("z-index", 102); 1.14854 + if(this.animFloat !== false){ 1.14855 + this.beforeSlide(); 1.14856 + this.el.slideIn(this.getSlideAnchor(), { 1.14857 + callback: function(){ 1.14858 + this.afterSlide(); 1.14859 + this.initAutoHide(); 1.14860 + Ext.getDoc().on("click", this.slideInIf, this); 1.14861 + }, 1.14862 + scope: this, 1.14863 + block: true 1.14864 + }); 1.14865 + }else{ 1.14866 + this.initAutoHide(); 1.14867 + Ext.getDoc().on("click", this.slideInIf, this); 1.14868 + } 1.14869 + }, 1.14870 + 1.14871 + afterSlideIn : function(){ 1.14872 + this.clearAutoHide(); 1.14873 + this.isSlid = false; 1.14874 + this.clearMonitor(); 1.14875 + this.el.setStyle("z-index", ""); 1.14876 + this.el.dom.style.left = this.restoreLT[0]; 1.14877 + this.el.dom.style.top = this.restoreLT[1]; 1.14878 + 1.14879 + var ts = this.panel.tools; 1.14880 + if(ts && ts.toggle){ 1.14881 + ts.toggle.show(); 1.14882 + } 1.14883 + }, 1.14884 + 1.14885 + slideIn : function(cb){ 1.14886 + if(!this.isSlid || this.el.hasActiveFx()){ 1.14887 + Ext.callback(cb); 1.14888 + return; 1.14889 + } 1.14890 + this.isSlid = false; 1.14891 + if(this.animFloat !== false){ 1.14892 + this.beforeSlide(); 1.14893 + this.el.slideOut(this.getSlideAnchor(), { 1.14894 + callback: function(){ 1.14895 + this.el.hide(); 1.14896 + this.afterSlide(); 1.14897 + this.afterSlideIn(); 1.14898 + Ext.callback(cb); 1.14899 + }, 1.14900 + scope: this, 1.14901 + block: true 1.14902 + }); 1.14903 + }else{ 1.14904 + this.el.hide(); 1.14905 + this.afterSlideIn(); 1.14906 + } 1.14907 + }, 1.14908 + 1.14909 + slideInIf : function(e){ 1.14910 + if(!e.within(this.el)){ 1.14911 + this.slideIn(); 1.14912 + } 1.14913 + }, 1.14914 + 1.14915 + anchors : { 1.14916 + "west" : "left", 1.14917 + "east" : "right", 1.14918 + "north" : "top", 1.14919 + "south" : "bottom" 1.14920 + }, 1.14921 + 1.14922 + sanchors : { 1.14923 + "west" : "l", 1.14924 + "east" : "r", 1.14925 + "north" : "t", 1.14926 + "south" : "b" 1.14927 + }, 1.14928 + 1.14929 + canchors : { 1.14930 + "west" : "tl-tr", 1.14931 + "east" : "tr-tl", 1.14932 + "north" : "tl-bl", 1.14933 + "south" : "bl-tl" 1.14934 + }, 1.14935 + 1.14936 + getAnchor : function(){ 1.14937 + return this.anchors[this.position]; 1.14938 + }, 1.14939 + 1.14940 + getCollapseAnchor : function(){ 1.14941 + return this.canchors[this.position]; 1.14942 + }, 1.14943 + 1.14944 + getSlideAnchor : function(){ 1.14945 + return this.sanchors[this.position]; 1.14946 + }, 1.14947 + 1.14948 + getAlignAdj : function(){ 1.14949 + var cm = this.cmargins; 1.14950 + switch(this.position){ 1.14951 + case "west": 1.14952 + return [0, 0]; 1.14953 + break; 1.14954 + case "east": 1.14955 + return [0, 0]; 1.14956 + break; 1.14957 + case "north": 1.14958 + return [0, 0]; 1.14959 + break; 1.14960 + case "south": 1.14961 + return [0, 0]; 1.14962 + break; 1.14963 + } 1.14964 + }, 1.14965 + 1.14966 + getExpandAdj : function(){ 1.14967 + var c = this.collapsedEl, cm = this.cmargins; 1.14968 + switch(this.position){ 1.14969 + case "west": 1.14970 + return [-(cm.right+c.getWidth()+cm.left), 0]; 1.14971 + break; 1.14972 + case "east": 1.14973 + return [cm.right+c.getWidth()+cm.left, 0]; 1.14974 + break; 1.14975 + case "north": 1.14976 + return [0, -(cm.top+cm.bottom+c.getHeight())]; 1.14977 + break; 1.14978 + case "south": 1.14979 + return [0, cm.top+cm.bottom+c.getHeight()]; 1.14980 + break; 1.14981 + } 1.14982 + } 1.14983 +}; 1.14984 + 1.14985 + 1.14986 +Ext.layout.BorderLayout.SplitRegion = function(layout, config, pos){ 1.14987 + Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this, layout, config, pos); 1.14988 + this.applyLayout = this.applyFns[pos]; 1.14989 +}; 1.14990 + 1.14991 +Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, { 1.14992 + 1.14993 + splitTip : "Drag to resize.", 1.14994 + 1.14995 + collapsibleSplitTip : "Drag to resize. Double click to hide.", 1.14996 + 1.14997 + useSplitTips : false, 1.14998 + 1.14999 + splitSettings : { 1.15000 + north : { 1.15001 + orientation: Ext.SplitBar.VERTICAL, 1.15002 + placement: Ext.SplitBar.TOP, 1.15003 + maxFn : 'getVMaxSize', 1.15004 + minProp: 'minHeight', 1.15005 + maxProp: 'maxHeight' 1.15006 + }, 1.15007 + south : { 1.15008 + orientation: Ext.SplitBar.VERTICAL, 1.15009 + placement: Ext.SplitBar.BOTTOM, 1.15010 + maxFn : 'getVMaxSize', 1.15011 + minProp: 'minHeight', 1.15012 + maxProp: 'maxHeight' 1.15013 + }, 1.15014 + east : { 1.15015 + orientation: Ext.SplitBar.HORIZONTAL, 1.15016 + placement: Ext.SplitBar.RIGHT, 1.15017 + maxFn : 'getHMaxSize', 1.15018 + minProp: 'minWidth', 1.15019 + maxProp: 'maxWidth' 1.15020 + }, 1.15021 + west : { 1.15022 + orientation: Ext.SplitBar.HORIZONTAL, 1.15023 + placement: Ext.SplitBar.LEFT, 1.15024 + maxFn : 'getHMaxSize', 1.15025 + minProp: 'minWidth', 1.15026 + maxProp: 'maxWidth' 1.15027 + } 1.15028 + }, 1.15029 + 1.15030 + applyFns : { 1.15031 + west : function(box){ 1.15032 + if(this.isCollapsed){ 1.15033 + return this.applyLayoutCollapsed(box); 1.15034 + } 1.15035 + var sd = this.splitEl.dom, s = sd.style; 1.15036 + this.panel.setPosition(box.x, box.y); 1.15037 + var sw = sd.offsetWidth; 1.15038 + s.left = (box.x+box.width-sw)+'px'; 1.15039 + s.top = (box.y)+'px'; 1.15040 + s.height = Math.max(0, box.height)+'px'; 1.15041 + this.panel.setSize(box.width-sw, box.height); 1.15042 + }, 1.15043 + east : function(box){ 1.15044 + if(this.isCollapsed){ 1.15045 + return this.applyLayoutCollapsed(box); 1.15046 + } 1.15047 + var sd = this.splitEl.dom, s = sd.style; 1.15048 + var sw = sd.offsetWidth; 1.15049 + this.panel.setPosition(box.x+sw, box.y); 1.15050 + s.left = (box.x)+'px'; 1.15051 + s.top = (box.y)+'px'; 1.15052 + s.height = Math.max(0, box.height)+'px'; 1.15053 + this.panel.setSize(box.width-sw, box.height); 1.15054 + }, 1.15055 + north : function(box){ 1.15056 + if(this.isCollapsed){ 1.15057 + return this.applyLayoutCollapsed(box); 1.15058 + } 1.15059 + var sd = this.splitEl.dom, s = sd.style; 1.15060 + var sh = sd.offsetHeight; 1.15061 + this.panel.setPosition(box.x, box.y); 1.15062 + s.left = (box.x)+'px'; 1.15063 + s.top = (box.y+box.height-sh)+'px'; 1.15064 + s.width = Math.max(0, box.width)+'px'; 1.15065 + this.panel.setSize(box.width, box.height-sh); 1.15066 + }, 1.15067 + south : function(box){ 1.15068 + if(this.isCollapsed){ 1.15069 + return this.applyLayoutCollapsed(box); 1.15070 + } 1.15071 + var sd = this.splitEl.dom, s = sd.style; 1.15072 + var sh = sd.offsetHeight; 1.15073 + this.panel.setPosition(box.x, box.y+sh); 1.15074 + s.left = (box.x)+'px'; 1.15075 + s.top = (box.y)+'px'; 1.15076 + s.width = Math.max(0, box.width)+'px'; 1.15077 + this.panel.setSize(box.width, box.height-sh); 1.15078 + } 1.15079 + }, 1.15080 + 1.15081 + render : function(ct, p){ 1.15082 + Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this, ct, p); 1.15083 + 1.15084 + var ps = this.position; 1.15085 + 1.15086 + this.splitEl = ct.createChild({ 1.15087 + cls: "x-layout-split x-layout-split-"+ps, html: " ", 1.15088 + id: this.panel.id + '-xsplit' 1.15089 + }); 1.15090 + 1.15091 + if(this.collapseMode == 'mini'){ 1.15092 + this.miniSplitEl = this.splitEl.createChild({ 1.15093 + cls: "x-layout-mini x-layout-mini-"+ps, html: " " 1.15094 + }); 1.15095 + this.miniSplitEl.addClassOnOver('x-layout-mini-over'); 1.15096 + this.miniSplitEl.on('click', this.onCollapseClick, this, {stopEvent:true}); 1.15097 + } 1.15098 + 1.15099 + var s = this.splitSettings[ps]; 1.15100 + 1.15101 + this.split = new Ext.SplitBar(this.splitEl.dom, p.el, s.orientation); 1.15102 + this.split.placement = s.placement; 1.15103 + this.split.getMaximumSize = this[s.maxFn].createDelegate(this); 1.15104 + this.split.minSize = this.minSize || this[s.minProp]; 1.15105 + this.split.on("beforeapply", this.onSplitMove, this); 1.15106 + this.split.useShim = this.useShim === true; 1.15107 + this.maxSize = this.maxSize || this[s.maxProp]; 1.15108 + 1.15109 + if(p.hidden){ 1.15110 + this.splitEl.hide(); 1.15111 + } 1.15112 + 1.15113 + if(this.useSplitTips){ 1.15114 + this.splitEl.dom.title = this.collapsible ? this.collapsibleSplitTip : this.splitTip; 1.15115 + } 1.15116 + if(this.collapsible){ 1.15117 + this.splitEl.on("dblclick", this.onCollapseClick, this); 1.15118 + } 1.15119 + }, 1.15120 + 1.15121 + getSize : function(){ 1.15122 + if(this.isCollapsed){ 1.15123 + return this.collapsedEl.getSize(); 1.15124 + } 1.15125 + var s = this.panel.getSize(); 1.15126 + if(this.position == 'north' || this.position == 'south'){ 1.15127 + s.height += this.splitEl.dom.offsetHeight; 1.15128 + }else{ 1.15129 + s.width += this.splitEl.dom.offsetWidth; 1.15130 + } 1.15131 + return s; 1.15132 + }, 1.15133 + 1.15134 + getHMaxSize : function(){ 1.15135 + var cmax = this.maxSize || 10000; 1.15136 + var center = this.layout.center; 1.15137 + return Math.min(cmax, (this.el.getWidth()+center.el.getWidth())-center.getMinWidth()); 1.15138 + }, 1.15139 + 1.15140 + getVMaxSize : function(){ 1.15141 + var cmax = this.maxSize || 10000; 1.15142 + var center = this.layout.center; 1.15143 + return Math.min(cmax, (this.el.getHeight()+center.el.getHeight())-center.getMinHeight()); 1.15144 + }, 1.15145 + 1.15146 + onSplitMove : function(split, newSize){ 1.15147 + var s = this.panel.getSize(); 1.15148 + this.lastSplitSize = newSize; 1.15149 + if(this.position == 'north' || this.position == 'south'){ 1.15150 + this.panel.setSize(s.width, newSize); 1.15151 + this.state.height = newSize; 1.15152 + }else{ 1.15153 + this.panel.setSize(newSize, s.height); 1.15154 + this.state.width = newSize; 1.15155 + } 1.15156 + this.layout.layout(); 1.15157 + this.panel.saveState(); 1.15158 + return false; 1.15159 + }, 1.15160 + 1.15161 + 1.15162 + getSplitBar : function(){ 1.15163 + return this.split; 1.15164 + } 1.15165 +}); 1.15166 + 1.15167 +Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout; 1.15168 + 1.15169 +Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { 1.15170 + 1.15171 + 1.15172 + 1.15173 + labelSeparator : ':', 1.15174 + 1.15175 + getAnchorViewSize : function(ct, target){ 1.15176 + return ct.body.getStyleSize(); 1.15177 + }, 1.15178 + 1.15179 + setContainer : function(ct){ 1.15180 + Ext.layout.FormLayout.superclass.setContainer.call(this, ct); 1.15181 + 1.15182 + if(ct.labelAlign){ 1.15183 + ct.addClass('x-form-label-'+ct.labelAlign); 1.15184 + } 1.15185 + 1.15186 + if(ct.hideLabels){ 1.15187 + this.labelStyle = "display:none"; 1.15188 + this.elementStyle = "padding-left:0;"; 1.15189 + this.labelAdjust = 0; 1.15190 + }else{ 1.15191 + this.labelSeparator = ct.labelSeparator || this.labelSeparator; 1.15192 + ct.labelWidth = ct.labelWidth || 100; 1.15193 + if(typeof ct.labelWidth == 'number'){ 1.15194 + var pad = (typeof ct.labelPad == 'number' ? ct.labelPad : 5); 1.15195 + this.labelAdjust = ct.labelWidth+pad; 1.15196 + this.labelStyle = "width:"+ct.labelWidth+"px;"; 1.15197 + this.elementStyle = "padding-left:"+(ct.labelWidth+pad)+'px'; 1.15198 + } 1.15199 + if(ct.labelAlign == 'top'){ 1.15200 + this.labelStyle = "width:auto;"; 1.15201 + this.labelAdjust = 0; 1.15202 + this.elementStyle = "padding-left:0;"; 1.15203 + } 1.15204 + } 1.15205 + 1.15206 + if(!this.fieldTpl){ 1.15207 + var t = new Ext.Template( 1.15208 + '<div class="x-form-item {5}" tabIndex="-1">', 1.15209 + '<label for="{0}" style="{2}" class="x-form-item-label">{1}{4}</label>', 1.15210 + '<div class="x-form-element" id="x-form-el-{0}" style="{3}">', 1.15211 + '</div><div class="{6}"></div>', 1.15212 + '</div>' 1.15213 + ); 1.15214 + t.disableFormats = true; 1.15215 + t.compile(); 1.15216 + Ext.layout.FormLayout.prototype.fieldTpl = t; 1.15217 + } 1.15218 + }, 1.15219 + 1.15220 + renderItem : function(c, position, target){ 1.15221 + if(c && !c.rendered && c.isFormField && c.inputType != 'hidden'){ 1.15222 + var args = [ 1.15223 + c.id, c.fieldLabel, 1.15224 + c.labelStyle||this.labelStyle||'', 1.15225 + this.elementStyle||'', 1.15226 + typeof c.labelSeparator == 'undefined' ? this.labelSeparator : c.labelSeparator, 1.15227 + (c.itemCls||this.container.itemCls||'') + (c.hideLabel ? ' x-hide-label' : ''), 1.15228 + c.clearCls || 'x-form-clear-left' 1.15229 + ]; 1.15230 + if(typeof position == 'number'){ 1.15231 + position = target.dom.childNodes[position] || null; 1.15232 + } 1.15233 + if(position){ 1.15234 + this.fieldTpl.insertBefore(position, args); 1.15235 + }else{ 1.15236 + this.fieldTpl.append(target, args); 1.15237 + } 1.15238 + c.render('x-form-el-'+c.id); 1.15239 + }else { 1.15240 + Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments); 1.15241 + } 1.15242 + }, 1.15243 + 1.15244 + adjustWidthAnchor : function(value, comp){ 1.15245 + return value - (comp.isFormField ? (comp.hideLabel ? 0 : this.labelAdjust) : 0); 1.15246 + }, 1.15247 + 1.15248 + isValidParent : function(c, target){ 1.15249 + return true; 1.15250 + } 1.15251 + 1.15252 + 1.15253 +}); 1.15254 + 1.15255 +Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout; 1.15256 + 1.15257 +Ext.layout.Accordion = Ext.extend(Ext.layout.FitLayout, { 1.15258 + 1.15259 + fill : true, 1.15260 + 1.15261 + autoWidth : true, 1.15262 + 1.15263 + titleCollapse : true, 1.15264 + 1.15265 + hideCollapseTool : false, 1.15266 + 1.15267 + collapseFirst : false, 1.15268 + 1.15269 + animate : false, 1.15270 + 1.15271 + sequence : false, 1.15272 + 1.15273 + activeOnTop : false, 1.15274 + 1.15275 + renderItem : function(c){ 1.15276 + if(this.animate === false){ 1.15277 + c.animCollapse = false; 1.15278 + } 1.15279 + c.collapsible = true; 1.15280 + if(this.autoWidth){ 1.15281 + c.autoWidth = true; 1.15282 + } 1.15283 + if(this.titleCollapse){ 1.15284 + c.titleCollapse = true; 1.15285 + } 1.15286 + if(this.hideCollapseTool){ 1.15287 + c.hideCollapseTool = true; 1.15288 + } 1.15289 + if(this.collapseFirst !== undefined){ 1.15290 + c.collapseFirst = this.collapseFirst; 1.15291 + } 1.15292 + if(!this.activeItem && !c.collapsed){ 1.15293 + this.activeItem = c; 1.15294 + }else if(this.activeItem){ 1.15295 + c.collapsed = true; 1.15296 + } 1.15297 + Ext.layout.Accordion.superclass.renderItem.apply(this, arguments); 1.15298 + c.header.addClass('x-accordion-hd'); 1.15299 + c.on('beforeexpand', this.beforeExpand, this); 1.15300 + }, 1.15301 + 1.15302 + 1.15303 + beforeExpand : function(p, anim){ 1.15304 + var ai = this.activeItem; 1.15305 + if(ai){ 1.15306 + if(this.sequence){ 1.15307 + delete this.activeItem; 1.15308 + if (!ai.collapsed){ 1.15309 + ai.collapse({callback:function(){ 1.15310 + p.expand(anim || true); 1.15311 + }, scope: this}); 1.15312 + return false; 1.15313 + } 1.15314 + }else{ 1.15315 + ai.collapse(this.animate); 1.15316 + } 1.15317 + } 1.15318 + this.activeItem = p; 1.15319 + if(this.activeOnTop){ 1.15320 + p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild); 1.15321 + } 1.15322 + this.layout(); 1.15323 + }, 1.15324 + 1.15325 + 1.15326 + setItemSize : function(item, size){ 1.15327 + if(this.fill && item){ 1.15328 + var items = this.container.items.items; 1.15329 + var hh = 0; 1.15330 + for(var i = 0, len = items.length; i < len; i++){ 1.15331 + var p = items[i]; 1.15332 + if(p != item){ 1.15333 + hh += (p.getSize().height - p.bwrap.getHeight()); 1.15334 + } 1.15335 + } 1.15336 + size.height -= hh; 1.15337 + item.setSize(size); 1.15338 + } 1.15339 + } 1.15340 +}); 1.15341 +Ext.Container.LAYOUTS['accordion'] = Ext.layout.Accordion; 1.15342 + 1.15343 +Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, { 1.15344 + 1.15345 + 1.15346 + 1.15347 + monitorResize:false, 1.15348 + 1.15349 + 1.15350 + setContainer : function(ct){ 1.15351 + Ext.layout.TableLayout.superclass.setContainer.call(this, ct); 1.15352 + 1.15353 + this.currentRow = 0; 1.15354 + this.currentColumn = 0; 1.15355 + this.cells = []; 1.15356 + }, 1.15357 + 1.15358 + 1.15359 + onLayout : function(ct, target){ 1.15360 + var cs = ct.items.items, len = cs.length, c, i; 1.15361 + 1.15362 + if(!this.table){ 1.15363 + target.addClass('x-table-layout-ct'); 1.15364 + 1.15365 + this.table = target.createChild( 1.15366 + {tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, null, true); 1.15367 + 1.15368 + this.renderAll(ct, target); 1.15369 + } 1.15370 + }, 1.15371 + 1.15372 + 1.15373 + getRow : function(index){ 1.15374 + var row = this.table.tBodies[0].childNodes[index]; 1.15375 + if(!row){ 1.15376 + row = document.createElement('tr'); 1.15377 + this.table.tBodies[0].appendChild(row); 1.15378 + } 1.15379 + return row; 1.15380 + }, 1.15381 + 1.15382 + 1.15383 + getNextCell : function(c){ 1.15384 + var cell = this.getNextNonSpan(this.currentColumn, this.currentRow); 1.15385 + var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1]; 1.15386 + for(var rowIndex = curRow; rowIndex < curRow + (c.rowspan || 1); rowIndex++){ 1.15387 + if(!this.cells[rowIndex]){ 1.15388 + this.cells[rowIndex] = []; 1.15389 + } 1.15390 + for(var colIndex = curCol; colIndex < curCol + (c.colspan || 1); colIndex++){ 1.15391 + this.cells[rowIndex][colIndex] = true; 1.15392 + } 1.15393 + } 1.15394 + var td = document.createElement('td'); 1.15395 + if(c.cellId){ 1.15396 + td.id = c.cellId; 1.15397 + } 1.15398 + var cls = 'x-table-layout-cell'; 1.15399 + if(c.cellCls){ 1.15400 + cls += ' ' + c.cellCls; 1.15401 + } 1.15402 + td.className = cls; 1.15403 + if(c.colspan){ 1.15404 + td.colSpan = c.colspan; 1.15405 + } 1.15406 + if(c.rowspan){ 1.15407 + td.rowSpan = c.rowspan; 1.15408 + } 1.15409 + this.getRow(curRow).appendChild(td); 1.15410 + return td; 1.15411 + }, 1.15412 + 1.15413 + 1.15414 + getNextNonSpan: function(colIndex, rowIndex){ 1.15415 + var cols = this.columns; 1.15416 + while((cols && colIndex >= cols) || (this.cells[rowIndex] && this.cells[rowIndex][colIndex])) { 1.15417 + if(cols && colIndex >= cols){ 1.15418 + rowIndex++; 1.15419 + colIndex = 0; 1.15420 + }else{ 1.15421 + colIndex++; 1.15422 + } 1.15423 + } 1.15424 + return [colIndex, rowIndex]; 1.15425 + }, 1.15426 + 1.15427 + 1.15428 + renderItem : function(c, position, target){ 1.15429 + if(c && !c.rendered){ 1.15430 + c.render(this.getNextCell(c)); 1.15431 + } 1.15432 + }, 1.15433 + 1.15434 + 1.15435 + isValidParent : function(c, target){ 1.15436 + return true; 1.15437 + } 1.15438 + 1.15439 + 1.15440 +}); 1.15441 + 1.15442 +Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout; 1.15443 + 1.15444 +Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, { 1.15445 + extraCls: 'x-abs-layout-item', 1.15446 + isForm: false, 1.15447 + 1.15448 + setContainer : function(ct){ 1.15449 + Ext.layout.AbsoluteLayout.superclass.setContainer.call(this, ct); 1.15450 + if(ct.isXType('form')){ 1.15451 + this.isForm = true; 1.15452 + } 1.15453 + }, 1.15454 + 1.15455 + onLayout : function(ct, target){ 1.15456 + if(this.isForm){ ct.body.position(); } else { target.position(); } 1.15457 + Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target); 1.15458 + }, 1.15459 + 1.15460 + 1.15461 + getAnchorViewSize : function(ct, target){ 1.15462 + return this.isForm ? ct.body.getStyleSize() : Ext.layout.AbsoluteLayout.superclass.getAnchorViewSize.call(this, ct, target); 1.15463 + }, 1.15464 + 1.15465 + 1.15466 + isValidParent : function(c, target){ 1.15467 + return this.isForm ? true : Ext.layout.AbsoluteLayout.superclass.isValidParent.call(this, c, target); 1.15468 + }, 1.15469 + 1.15470 + 1.15471 + adjustWidthAnchor : function(value, comp){ 1.15472 + return value ? value - comp.getPosition(true)[0] : value; 1.15473 + }, 1.15474 + 1.15475 + 1.15476 + adjustHeightAnchor : function(value, comp){ 1.15477 + return value ? value - comp.getPosition(true)[1] : value; 1.15478 + } 1.15479 + 1.15480 +}); 1.15481 +Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout; 1.15482 + 1.15483 +Ext.Viewport = Ext.extend(Ext.Container, { 1.15484 + 1.15485 + 1.15486 + 1.15487 + 1.15488 + 1.15489 + 1.15490 + 1.15491 + 1.15492 + 1.15493 + 1.15494 + 1.15495 + 1.15496 + initComponent : function() { 1.15497 + Ext.Viewport.superclass.initComponent.call(this); 1.15498 + document.getElementsByTagName('html')[0].className += ' x-viewport'; 1.15499 + this.el = Ext.getBody(); 1.15500 + this.el.setHeight = Ext.emptyFn; 1.15501 + this.el.setWidth = Ext.emptyFn; 1.15502 + this.el.setSize = Ext.emptyFn; 1.15503 + this.el.dom.scroll = 'no'; 1.15504 + this.allowDomMove = false; 1.15505 + this.autoWidth = true; 1.15506 + this.autoHeight = true; 1.15507 + Ext.EventManager.onWindowResize(this.fireResize, this); 1.15508 + this.renderTo = this.el; 1.15509 + }, 1.15510 + 1.15511 + fireResize : function(w, h){ 1.15512 + this.fireEvent('resize', this, w, h, w, h); 1.15513 + } 1.15514 +}); 1.15515 +Ext.reg('viewport', Ext.Viewport); 1.15516 + 1.15517 +Ext.Panel = Ext.extend(Ext.Container, { 1.15518 + 1.15519 + 1.15520 + 1.15521 + 1.15522 + 1.15523 + 1.15524 + 1.15525 + 1.15526 + 1.15527 + 1.15528 + 1.15529 + 1.15530 + 1.15531 + 1.15532 + 1.15533 + 1.15534 + 1.15535 + 1.15536 + 1.15537 + 1.15538 + 1.15539 + 1.15540 + 1.15541 + 1.15542 + 1.15543 + 1.15544 + 1.15545 + 1.15546 + 1.15547 + 1.15548 + 1.15549 + 1.15550 + 1.15551 + baseCls : 'x-panel', 1.15552 + 1.15553 + collapsedCls : 'x-panel-collapsed', 1.15554 + 1.15555 + maskDisabled: true, 1.15556 + 1.15557 + animCollapse: Ext.enableFx, 1.15558 + 1.15559 + headerAsText: true, 1.15560 + 1.15561 + buttonAlign: 'right', 1.15562 + 1.15563 + collapsed : false, 1.15564 + 1.15565 + collapseFirst: true, 1.15566 + 1.15567 + minButtonWidth:75, 1.15568 + 1.15569 + elements : 'body', 1.15570 + 1.15571 + toolTarget : 'header', 1.15572 + collapseEl : 'bwrap', 1.15573 + slideAnchor : 't', 1.15574 + 1.15575 + deferHeight: true, 1.15576 + expandDefaults: { 1.15577 + duration:.25 1.15578 + }, 1.15579 + collapseDefaults: { 1.15580 + duration:.25 1.15581 + }, 1.15582 + 1.15583 + initComponent : function(){ 1.15584 + Ext.Panel.superclass.initComponent.call(this); 1.15585 + 1.15586 + this.addEvents( 1.15587 + 1.15588 + 'bodyresize', 1.15589 + 1.15590 + 'titlechange', 1.15591 + 1.15592 + 'collapse', 1.15593 + 1.15594 + 'expand', 1.15595 + 1.15596 + 'beforecollapse', 1.15597 + 1.15598 + 'beforeexpand', 1.15599 + 1.15600 + 'beforeclose', 1.15601 + 1.15602 + 'close', 1.15603 + 1.15604 + 'activate', 1.15605 + 1.15606 + 'deactivate' 1.15607 + ); 1.15608 + 1.15609 + if(this.tbar){ 1.15610 + this.elements += ',tbar'; 1.15611 + if(typeof this.tbar == 'object'){ 1.15612 + this.topToolbar = this.tbar; 1.15613 + } 1.15614 + delete this.tbar; 1.15615 + } 1.15616 + if(this.bbar){ 1.15617 + this.elements += ',bbar'; 1.15618 + if(typeof this.bbar == 'object'){ 1.15619 + this.bottomToolbar = this.bbar; 1.15620 + } 1.15621 + delete this.bbar; 1.15622 + } 1.15623 + 1.15624 + if(this.header === true){ 1.15625 + this.elements += ',header'; 1.15626 + delete this.header; 1.15627 + }else if(this.title && this.header !== false){ 1.15628 + this.elements += ',header'; 1.15629 + } 1.15630 + 1.15631 + if(this.footer === true){ 1.15632 + this.elements += ',footer'; 1.15633 + delete this.footer; 1.15634 + } 1.15635 + 1.15636 + if(this.buttons){ 1.15637 + var btns = this.buttons; 1.15638 + 1.15639 + this.buttons = []; 1.15640 + for(var i = 0, len = btns.length; i < len; i++) { 1.15641 + if(btns[i].render){ this.buttons.push(btns[i]); 1.15642 + }else{ 1.15643 + this.addButton(btns[i]); 1.15644 + } 1.15645 + } 1.15646 + } 1.15647 + if(this.autoLoad){ 1.15648 + this.on('render', this.doAutoLoad, this, {delay:10}); 1.15649 + } 1.15650 + }, 1.15651 + 1.15652 + createElement : function(name, pnode){ 1.15653 + if(this[name]){ 1.15654 + pnode.appendChild(this[name].dom); 1.15655 + return; 1.15656 + } 1.15657 + 1.15658 + if(name === 'bwrap' || this.elements.indexOf(name) != -1){ 1.15659 + if(this[name+'Cfg']){ 1.15660 + this[name] = Ext.fly(pnode).createChild(this[name+'Cfg']); 1.15661 + }else{ 1.15662 + var el = document.createElement('div'); 1.15663 + el.className = this[name+'Cls']; 1.15664 + this[name] = Ext.get(pnode.appendChild(el)); 1.15665 + } 1.15666 + } 1.15667 + }, 1.15668 + 1.15669 + onRender : function(ct, position){ 1.15670 + Ext.Panel.superclass.onRender.call(this, ct, position); 1.15671 + 1.15672 + this.createClasses(); 1.15673 + 1.15674 + if(this.el){ this.el.addClass(this.baseCls); 1.15675 + this.header = this.el.down('.'+this.headerCls); 1.15676 + this.bwrap = this.el.down('.'+this.bwrapCls); 1.15677 + var cp = this.bwrap ? this.bwrap : this.el; 1.15678 + this.tbar = cp.down('.'+this.tbarCls); 1.15679 + this.body = cp.down('.'+this.bodyCls); 1.15680 + this.bbar = cp.down('.'+this.bbarCls); 1.15681 + this.footer = cp.down('.'+this.footerCls); 1.15682 + this.fromMarkup = true; 1.15683 + }else{ 1.15684 + this.el = ct.createChild({ 1.15685 + id: this.id, 1.15686 + cls: this.baseCls 1.15687 + }, position); 1.15688 + } 1.15689 + var el = this.el, d = el.dom; 1.15690 + 1.15691 + if(this.cls){ 1.15692 + this.el.addClass(this.cls); 1.15693 + } 1.15694 + 1.15695 + if(this.buttons){ 1.15696 + this.elements += ',footer'; 1.15697 + } 1.15698 + 1.15699 + 1.15700 + if(this.frame){ 1.15701 + el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls)); 1.15702 + 1.15703 + this.createElement('header', d.firstChild.firstChild.firstChild); 1.15704 + this.createElement('bwrap', d); 1.15705 + 1.15706 + var bw = this.bwrap.dom; 1.15707 + var ml = d.childNodes[1], bl = d.childNodes[2]; 1.15708 + bw.appendChild(ml); 1.15709 + bw.appendChild(bl); 1.15710 + 1.15711 + var mc = bw.firstChild.firstChild.firstChild; 1.15712 + this.createElement('tbar', mc); 1.15713 + this.createElement('body', mc); 1.15714 + this.createElement('bbar', mc); 1.15715 + this.createElement('footer', bw.lastChild.firstChild.firstChild); 1.15716 + 1.15717 + if(!this.footer){ 1.15718 + this.bwrap.dom.lastChild.className += ' x-panel-nofooter'; 1.15719 + } 1.15720 + }else{ 1.15721 + this.createElement('header', d); 1.15722 + this.createElement('bwrap', d); 1.15723 + 1.15724 + var bw = this.bwrap.dom; 1.15725 + this.createElement('tbar', bw); 1.15726 + this.createElement('body', bw); 1.15727 + this.createElement('bbar', bw); 1.15728 + this.createElement('footer', bw); 1.15729 + 1.15730 + if(!this.header){ 1.15731 + this.body.addClass(this.bodyCls + '-noheader'); 1.15732 + if(this.tbar){ 1.15733 + this.tbar.addClass(this.tbarCls + '-noheader'); 1.15734 + } 1.15735 + } 1.15736 + } 1.15737 + 1.15738 + if(this.border === false){ 1.15739 + this.el.addClass(this.baseCls + '-noborder'); 1.15740 + this.body.addClass(this.bodyCls + '-noborder'); 1.15741 + if(this.header){ 1.15742 + this.header.addClass(this.headerCls + '-noborder'); 1.15743 + } 1.15744 + if(this.footer){ 1.15745 + this.footer.addClass(this.footerCls + '-noborder'); 1.15746 + } 1.15747 + if(this.tbar){ 1.15748 + this.tbar.addClass(this.tbarCls + '-noborder'); 1.15749 + } 1.15750 + if(this.bbar){ 1.15751 + this.bbar.addClass(this.bbarCls + '-noborder'); 1.15752 + } 1.15753 + } 1.15754 + 1.15755 + if(this.bodyBorder === false){ 1.15756 + this.body.addClass(this.bodyCls + '-noborder'); 1.15757 + } 1.15758 + 1.15759 + if(this.bodyStyle){ 1.15760 + this.body.applyStyles(this.bodyStyle); 1.15761 + } 1.15762 + 1.15763 + this.bwrap.enableDisplayMode('block'); 1.15764 + 1.15765 + if(this.header){ 1.15766 + this.header.unselectable(); 1.15767 + 1.15768 + if(this.headerAsText){ 1.15769 + this.header.dom.innerHTML = 1.15770 + '<span class="' + this.headerTextCls + '">'+this.header.dom.innerHTML+'</span>'; 1.15771 + 1.15772 + if(this.iconCls){ 1.15773 + this.setIconClass(this.iconCls); 1.15774 + } 1.15775 + } 1.15776 + } 1.15777 + 1.15778 + if(this.floating){ 1.15779 + this.makeFloating(this.floating); 1.15780 + } 1.15781 + 1.15782 + if(this.collapsible){ 1.15783 + this.tools = this.tools ? this.tools.slice(0) : []; 1.15784 + if(!this.hideCollapseTool){ 1.15785 + this.tools[this.collapseFirst?'unshift':'push']({ 1.15786 + id: 'toggle', 1.15787 + handler : this.toggleCollapse, 1.15788 + scope: this 1.15789 + }); 1.15790 + } 1.15791 + if(this.titleCollapse && this.header){ 1.15792 + this.header.on('click', this.toggleCollapse, this); 1.15793 + this.header.setStyle('cursor', 'pointer'); 1.15794 + } 1.15795 + } 1.15796 + if(this.tools){ 1.15797 + var ts = this.tools; 1.15798 + this.tools = {}; 1.15799 + this.addTool.apply(this, ts); 1.15800 + }else{ 1.15801 + this.tools = {}; 1.15802 + } 1.15803 + 1.15804 + if(this.buttons && this.buttons.length > 0){ 1.15805 + var tb = this.footer.createChild({cls:'x-panel-btns-ct', cn: { 1.15806 + cls:"x-panel-btns x-panel-btns-"+this.buttonAlign, 1.15807 + html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>' 1.15808 + }}, null, true); 1.15809 + var tr = tb.getElementsByTagName('tr')[0]; 1.15810 + for(var i = 0, len = this.buttons.length; i < len; i++) { 1.15811 + var b = this.buttons[i]; 1.15812 + var td = document.createElement('td'); 1.15813 + td.className = 'x-panel-btn-td'; 1.15814 + b.render(tr.appendChild(td)); 1.15815 + } 1.15816 + } 1.15817 + 1.15818 + if(this.tbar && this.topToolbar){ 1.15819 + if(Ext.isArray(this.topToolbar)){ 1.15820 + this.topToolbar = new Ext.Toolbar(this.topToolbar); 1.15821 + } 1.15822 + this.topToolbar.render(this.tbar); 1.15823 + this.topToolbar.ownerCt = this; 1.15824 + } 1.15825 + if(this.bbar && this.bottomToolbar){ 1.15826 + if(Ext.isArray(this.bottomToolbar)){ 1.15827 + this.bottomToolbar = new Ext.Toolbar(this.bottomToolbar); 1.15828 + } 1.15829 + this.bottomToolbar.render(this.bbar); 1.15830 + this.bottomToolbar.ownerCt = this; 1.15831 + } 1.15832 + }, 1.15833 + 1.15834 + 1.15835 + setIconClass : function(cls){ 1.15836 + var old = this.iconCls; 1.15837 + this.iconCls = cls; 1.15838 + if(this.rendered && this.header){ 1.15839 + if(this.frame){ 1.15840 + this.header.addClass('x-panel-icon'); 1.15841 + this.header.replaceClass(old, this.iconCls); 1.15842 + }else{ 1.15843 + var hd = this.header.dom; 1.15844 + var img = hd.firstChild && String(hd.firstChild.tagName).toLowerCase() == 'img' ? hd.firstChild : null; 1.15845 + if(img){ 1.15846 + Ext.fly(img).replaceClass(old, this.iconCls); 1.15847 + }else{ 1.15848 + Ext.DomHelper.insertBefore(hd.firstChild, { 1.15849 + tag:'img', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls 1.15850 + }); 1.15851 + } 1.15852 + } 1.15853 + } 1.15854 + }, 1.15855 + 1.15856 + makeFloating : function(cfg){ 1.15857 + this.floating = true; 1.15858 + this.el = new Ext.Layer( 1.15859 + typeof cfg == 'object' ? cfg : { 1.15860 + shadow: this.shadow !== undefined ? this.shadow : 'sides', 1.15861 + shadowOffset: this.shadowOffset, 1.15862 + constrain:false, 1.15863 + shim: this.shim === false ? false : undefined 1.15864 + }, this.el 1.15865 + ); 1.15866 + }, 1.15867 + 1.15868 + 1.15869 + getTopToolbar : function(){ 1.15870 + return this.topToolbar; 1.15871 + }, 1.15872 + 1.15873 + 1.15874 + getBottomToolbar : function(){ 1.15875 + return this.bottomToolbar; 1.15876 + }, 1.15877 + 1.15878 + 1.15879 + addButton : function(config, handler, scope){ 1.15880 + var bc = { 1.15881 + handler: handler, 1.15882 + scope: scope, 1.15883 + minWidth: this.minButtonWidth, 1.15884 + hideParent:true 1.15885 + }; 1.15886 + if(typeof config == "string"){ 1.15887 + bc.text = config; 1.15888 + }else{ 1.15889 + Ext.apply(bc, config); 1.15890 + } 1.15891 + var btn = new Ext.Button(bc); 1.15892 + btn.ownerCt = this; 1.15893 + if(!this.buttons){ 1.15894 + this.buttons = []; 1.15895 + } 1.15896 + this.buttons.push(btn); 1.15897 + return btn; 1.15898 + }, 1.15899 + 1.15900 + addTool : function(){ 1.15901 + if(!this[this.toolTarget]) { return; 1.15902 + } 1.15903 + if(!this.toolTemplate){ 1.15904 + var tt = new Ext.Template( 1.15905 + '<div class="x-tool x-tool-{id}"> </div>' 1.15906 + ); 1.15907 + tt.disableFormats = true; 1.15908 + tt.compile(); 1.15909 + Ext.Panel.prototype.toolTemplate = tt; 1.15910 + } 1.15911 + for(var i = 0, a = arguments, len = a.length; i < len; i++) { 1.15912 + var tc = a[i], overCls = 'x-tool-'+tc.id+'-over'; 1.15913 + var t = this.toolTemplate.insertFirst((tc.align !== 'left') ? this[this.toolTarget] : this[this.toolTarget].child('span'), tc, true); 1.15914 + this.tools[tc.id] = t; 1.15915 + t.enableDisplayMode('block'); 1.15916 + t.on('click', this.createToolHandler(t, tc, overCls, this)); 1.15917 + if(tc.on){ 1.15918 + t.on(tc.on); 1.15919 + } 1.15920 + if(tc.hidden){ 1.15921 + t.hide(); 1.15922 + } 1.15923 + if(tc.qtip){ 1.15924 + if(typeof tc.qtip == 'object'){ 1.15925 + Ext.QuickTips.register(Ext.apply({ 1.15926 + target: t.id 1.15927 + }, tc.qtip)); 1.15928 + } else { 1.15929 + t.dom.qtip = tc.qtip; 1.15930 + } 1.15931 + } 1.15932 + t.addClassOnOver(overCls); 1.15933 + } 1.15934 + }, 1.15935 + 1.15936 + onShow : function(){ 1.15937 + if(this.floating){ 1.15938 + return this.el.show(); 1.15939 + } 1.15940 + Ext.Panel.superclass.onShow.call(this); 1.15941 + }, 1.15942 + 1.15943 + onHide : function(){ 1.15944 + if(this.floating){ 1.15945 + return this.el.hide(); 1.15946 + } 1.15947 + Ext.Panel.superclass.onHide.call(this); 1.15948 + }, 1.15949 + 1.15950 + createToolHandler : function(t, tc, overCls, panel){ 1.15951 + return function(e){ 1.15952 + t.removeClass(overCls); 1.15953 + e.stopEvent(); 1.15954 + if(tc.handler){ 1.15955 + tc.handler.call(tc.scope || t, e, t, panel); 1.15956 + } 1.15957 + }; 1.15958 + }, 1.15959 + 1.15960 + afterRender : function(){ 1.15961 + if(this.fromMarkup && this.height === undefined && !this.autoHeight){ 1.15962 + this.height = this.el.getHeight(); 1.15963 + } 1.15964 + if(this.floating && !this.hidden && !this.initHidden){ 1.15965 + this.el.show(); 1.15966 + } 1.15967 + if(this.title){ 1.15968 + this.setTitle(this.title); 1.15969 + } 1.15970 + this.setAutoScroll(); 1.15971 + if(this.html){ 1.15972 + this.body.update(typeof this.html == 'object' ? 1.15973 + Ext.DomHelper.markup(this.html) : 1.15974 + this.html); 1.15975 + delete this.html; 1.15976 + } 1.15977 + if(this.contentEl){ 1.15978 + var ce = Ext.getDom(this.contentEl); 1.15979 + Ext.fly(ce).removeClass(['x-hidden', 'x-hide-display']); 1.15980 + this.body.dom.appendChild(ce); 1.15981 + } 1.15982 + if(this.collapsed){ 1.15983 + this.collapsed = false; 1.15984 + this.collapse(false); 1.15985 + } 1.15986 + Ext.Panel.superclass.afterRender.call(this); this.initEvents(); 1.15987 + }, 1.15988 + 1.15989 + setAutoScroll : function(){ 1.15990 + if(this.rendered && this.autoScroll){ 1.15991 + this.body.setOverflow('auto'); 1.15992 + } 1.15993 + }, 1.15994 + 1.15995 + getKeyMap : function(){ 1.15996 + if(!this.keyMap){ 1.15997 + this.keyMap = new Ext.KeyMap(this.el, this.keys); 1.15998 + } 1.15999 + return this.keyMap; 1.16000 + }, 1.16001 + 1.16002 + initEvents : function(){ 1.16003 + if(this.keys){ 1.16004 + this.getKeyMap(); 1.16005 + } 1.16006 + if(this.draggable){ 1.16007 + this.initDraggable(); 1.16008 + } 1.16009 + }, 1.16010 + 1.16011 + initDraggable : function(){ 1.16012 + 1.16013 + this.dd = new Ext.Panel.DD(this, typeof this.draggable == 'boolean' ? null : this.draggable); 1.16014 + }, 1.16015 + 1.16016 + beforeEffect : function(){ 1.16017 + if(this.floating){ 1.16018 + this.el.beforeAction(); 1.16019 + } 1.16020 + this.el.addClass('x-panel-animated'); 1.16021 + }, 1.16022 + 1.16023 + afterEffect : function(){ 1.16024 + this.syncShadow(); 1.16025 + this.el.removeClass('x-panel-animated'); 1.16026 + }, 1.16027 + 1.16028 + createEffect : function(a, cb, scope){ 1.16029 + var o = { 1.16030 + scope:scope, 1.16031 + block:true 1.16032 + }; 1.16033 + if(a === true){ 1.16034 + o.callback = cb; 1.16035 + return o; 1.16036 + }else if(!a.callback){ 1.16037 + o.callback = cb; 1.16038 + }else { o.callback = function(){ 1.16039 + cb.call(scope); 1.16040 + Ext.callback(a.callback, a.scope); 1.16041 + }; 1.16042 + } 1.16043 + return Ext.applyIf(o, a); 1.16044 + }, 1.16045 + 1.16046 + 1.16047 + collapse : function(animate){ 1.16048 + if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){ 1.16049 + return; 1.16050 + } 1.16051 + var doAnim = animate === true || (animate !== false && this.animCollapse); 1.16052 + this.beforeEffect(); 1.16053 + this.onCollapse(doAnim, animate); 1.16054 + return this; 1.16055 + }, 1.16056 + 1.16057 + onCollapse : function(doAnim, animArg){ 1.16058 + if(doAnim){ 1.16059 + this[this.collapseEl].slideOut(this.slideAnchor, 1.16060 + Ext.apply(this.createEffect(animArg||true, this.afterCollapse, this), 1.16061 + this.collapseDefaults)); 1.16062 + }else{ 1.16063 + this[this.collapseEl].hide(); 1.16064 + this.afterCollapse(); 1.16065 + } 1.16066 + }, 1.16067 + 1.16068 + afterCollapse : function(){ 1.16069 + this.collapsed = true; 1.16070 + this.el.addClass(this.collapsedCls); 1.16071 + this.afterEffect(); 1.16072 + this.fireEvent('collapse', this); 1.16073 + }, 1.16074 + 1.16075 + 1.16076 + expand : function(animate){ 1.16077 + if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){ 1.16078 + return; 1.16079 + } 1.16080 + var doAnim = animate === true || (animate !== false && this.animCollapse); 1.16081 + this.el.removeClass(this.collapsedCls); 1.16082 + this.beforeEffect(); 1.16083 + this.onExpand(doAnim, animate); 1.16084 + return this; 1.16085 + }, 1.16086 + 1.16087 + onExpand : function(doAnim, animArg){ 1.16088 + if(doAnim){ 1.16089 + this[this.collapseEl].slideIn(this.slideAnchor, 1.16090 + Ext.apply(this.createEffect(animArg||true, this.afterExpand, this), 1.16091 + this.expandDefaults)); 1.16092 + }else{ 1.16093 + this[this.collapseEl].show(); 1.16094 + this.afterExpand(); 1.16095 + } 1.16096 + }, 1.16097 + 1.16098 + afterExpand : function(){ 1.16099 + this.collapsed = false; 1.16100 + this.afterEffect(); 1.16101 + this.fireEvent('expand', this); 1.16102 + }, 1.16103 + 1.16104 + 1.16105 + toggleCollapse : function(animate){ 1.16106 + this[this.collapsed ? 'expand' : 'collapse'](animate); 1.16107 + return this; 1.16108 + }, 1.16109 + 1.16110 + onDisable : function(){ 1.16111 + if(this.rendered && this.maskDisabled){ 1.16112 + this.el.mask(); 1.16113 + } 1.16114 + Ext.Panel.superclass.onDisable.call(this); 1.16115 + }, 1.16116 + 1.16117 + onEnable : function(){ 1.16118 + if(this.rendered && this.maskDisabled){ 1.16119 + this.el.unmask(); 1.16120 + } 1.16121 + Ext.Panel.superclass.onEnable.call(this); 1.16122 + }, 1.16123 + 1.16124 + onResize : function(w, h){ 1.16125 + if(w !== undefined || h !== undefined){ 1.16126 + if(!this.collapsed){ 1.16127 + if(typeof w == 'number'){ 1.16128 + this.body.setWidth( 1.16129 + this.adjustBodyWidth(w - this.getFrameWidth())); 1.16130 + }else if(w == 'auto'){ 1.16131 + this.body.setWidth(w); 1.16132 + } 1.16133 + 1.16134 + if(typeof h == 'number'){ 1.16135 + this.body.setHeight( 1.16136 + this.adjustBodyHeight(h - this.getFrameHeight())); 1.16137 + }else if(h == 'auto'){ 1.16138 + this.body.setHeight(h); 1.16139 + } 1.16140 + }else{ 1.16141 + this.queuedBodySize = {width: w, height: h}; 1.16142 + if(!this.queuedExpand && this.allowQueuedExpand !== false){ 1.16143 + this.queuedExpand = true; 1.16144 + this.on('expand', function(){ 1.16145 + delete this.queuedExpand; 1.16146 + this.onResize(this.queuedBodySize.width, this.queuedBodySize.height); 1.16147 + this.doLayout(); 1.16148 + }, this, {single:true}); 1.16149 + } 1.16150 + } 1.16151 + this.fireEvent('bodyresize', this, w, h); 1.16152 + } 1.16153 + this.syncShadow(); 1.16154 + }, 1.16155 + 1.16156 + adjustBodyHeight : function(h){ 1.16157 + return h; 1.16158 + }, 1.16159 + 1.16160 + adjustBodyWidth : function(w){ 1.16161 + return w; 1.16162 + }, 1.16163 + 1.16164 + onPosition : function(){ 1.16165 + this.syncShadow(); 1.16166 + }, 1.16167 + 1.16168 + onDestroy : function(){ 1.16169 + if(this.tools){ 1.16170 + for(var k in this.tools){ 1.16171 + Ext.destroy(this.tools[k]); 1.16172 + } 1.16173 + } 1.16174 + if(this.buttons){ 1.16175 + for(var b in this.buttons){ 1.16176 + Ext.destroy(this.buttons[b]); 1.16177 + } 1.16178 + } 1.16179 + Ext.destroy( 1.16180 + this.topToolbar, 1.16181 + this.bottomToolbar 1.16182 + ); 1.16183 + Ext.Panel.superclass.onDestroy.call(this); 1.16184 + }, 1.16185 + 1.16186 + 1.16187 + getFrameWidth : function(){ 1.16188 + var w = this.el.getFrameWidth('lr'); 1.16189 + 1.16190 + if(this.frame){ 1.16191 + var l = this.bwrap.dom.firstChild; 1.16192 + w += (Ext.fly(l).getFrameWidth('l') + Ext.fly(l.firstChild).getFrameWidth('r')); 1.16193 + var mc = this.bwrap.dom.firstChild.firstChild.firstChild; 1.16194 + w += Ext.fly(mc).getFrameWidth('lr'); 1.16195 + } 1.16196 + return w; 1.16197 + }, 1.16198 + 1.16199 + 1.16200 + getFrameHeight : function(){ 1.16201 + var h = this.el.getFrameWidth('tb'); 1.16202 + h += (this.tbar ? this.tbar.getHeight() : 0) + 1.16203 + (this.bbar ? this.bbar.getHeight() : 0); 1.16204 + 1.16205 + if(this.frame){ 1.16206 + var hd = this.el.dom.firstChild; 1.16207 + var ft = this.bwrap.dom.lastChild; 1.16208 + h += (hd.offsetHeight + ft.offsetHeight); 1.16209 + var mc = this.bwrap.dom.firstChild.firstChild.firstChild; 1.16210 + h += Ext.fly(mc).getFrameWidth('tb'); 1.16211 + }else{ 1.16212 + h += (this.header ? this.header.getHeight() : 0) + 1.16213 + (this.footer ? this.footer.getHeight() : 0); 1.16214 + } 1.16215 + return h; 1.16216 + }, 1.16217 + 1.16218 + 1.16219 + getInnerWidth : function(){ 1.16220 + return this.getSize().width - this.getFrameWidth(); 1.16221 + }, 1.16222 + 1.16223 + 1.16224 + getInnerHeight : function(){ 1.16225 + return this.getSize().height - this.getFrameHeight(); 1.16226 + }, 1.16227 + 1.16228 + syncShadow : function(){ 1.16229 + if(this.floating){ 1.16230 + this.el.sync(true); 1.16231 + } 1.16232 + }, 1.16233 + 1.16234 + getLayoutTarget : function(){ 1.16235 + return this.body; 1.16236 + }, 1.16237 + 1.16238 + 1.16239 + setTitle : function(title, iconCls){ 1.16240 + this.title = title; 1.16241 + if(this.header && this.headerAsText){ 1.16242 + this.header.child('span').update(title); 1.16243 + } 1.16244 + if(iconCls){ 1.16245 + this.setIconClass(iconCls); 1.16246 + } 1.16247 + this.fireEvent('titlechange', this, title); 1.16248 + return this; 1.16249 + }, 1.16250 + 1.16251 + 1.16252 + getUpdater : function(){ 1.16253 + return this.body.getUpdater(); 1.16254 + }, 1.16255 + 1.16256 + 1.16257 + load : function(){ 1.16258 + var um = this.body.getUpdater(); 1.16259 + um.update.apply(um, arguments); 1.16260 + return this; 1.16261 + }, 1.16262 + 1.16263 + beforeDestroy : function(){ 1.16264 + Ext.Element.uncache( 1.16265 + this.header, 1.16266 + this.tbar, 1.16267 + this.bbar, 1.16268 + this.footer, 1.16269 + this.body 1.16270 + ); 1.16271 + }, 1.16272 + 1.16273 + createClasses : function(){ 1.16274 + this.headerCls = this.baseCls + '-header'; 1.16275 + this.headerTextCls = this.baseCls + '-header-text'; 1.16276 + this.bwrapCls = this.baseCls + '-bwrap'; 1.16277 + this.tbarCls = this.baseCls + '-tbar'; 1.16278 + this.bodyCls = this.baseCls + '-body'; 1.16279 + this.bbarCls = this.baseCls + '-bbar'; 1.16280 + this.footerCls = this.baseCls + '-footer'; 1.16281 + }, 1.16282 + 1.16283 + createGhost : function(cls, useShim, appendTo){ 1.16284 + var el = document.createElement('div'); 1.16285 + el.className = 'x-panel-ghost ' + (cls ? cls : ''); 1.16286 + if(this.header){ 1.16287 + el.appendChild(this.el.dom.firstChild.cloneNode(true)); 1.16288 + } 1.16289 + Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight()); 1.16290 + el.style.width = this.el.dom.offsetWidth + 'px';; 1.16291 + if(!appendTo){ 1.16292 + this.container.dom.appendChild(el); 1.16293 + }else{ 1.16294 + Ext.getDom(appendTo).appendChild(el); 1.16295 + } 1.16296 + if(useShim !== false && this.el.useShim !== false){ 1.16297 + var layer = new Ext.Layer({shadow:false, useDisplay:true, constrain:false}, el); 1.16298 + layer.show(); 1.16299 + return layer; 1.16300 + }else{ 1.16301 + return new Ext.Element(el); 1.16302 + } 1.16303 + }, 1.16304 + 1.16305 + doAutoLoad : function(){ 1.16306 + this.body.load( 1.16307 + typeof this.autoLoad == 'object' ? 1.16308 + this.autoLoad : {url: this.autoLoad}); 1.16309 + } 1.16310 + 1.16311 + 1.16312 +}); 1.16313 +Ext.reg('panel', Ext.Panel); 1.16314 + 1.16315 + 1.16316 +Ext.Window = Ext.extend(Ext.Panel, { 1.16317 + 1.16318 + 1.16319 + 1.16320 + 1.16321 + 1.16322 + 1.16323 + 1.16324 + 1.16325 + 1.16326 + baseCls : 'x-window', 1.16327 + 1.16328 + resizable:true, 1.16329 + 1.16330 + draggable:true, 1.16331 + 1.16332 + closable : true, 1.16333 + 1.16334 + constrain:false, 1.16335 + 1.16336 + constrainHeader:false, 1.16337 + 1.16338 + plain:false, 1.16339 + 1.16340 + minimizable : false, 1.16341 + 1.16342 + maximizable : false, 1.16343 + 1.16344 + minHeight: 100, 1.16345 + 1.16346 + minWidth: 200, 1.16347 + 1.16348 + expandOnShow: true, 1.16349 + 1.16350 + closeAction: 'close', 1.16351 + 1.16352 + elements: 'header,body', 1.16353 + 1.16354 + collapsible:false, 1.16355 + 1.16356 + initHidden : true, 1.16357 + 1.16358 + monitorResize : true, 1.16359 + 1.16360 + frame:true, 1.16361 + 1.16362 + floating:true, 1.16363 + 1.16364 + initComponent : function(){ 1.16365 + Ext.Window.superclass.initComponent.call(this); 1.16366 + this.addEvents( 1.16367 + 1.16368 + 1.16369 + 1.16370 + 'resize', 1.16371 + 1.16372 + 'maximize', 1.16373 + 1.16374 + 'minimize', 1.16375 + 1.16376 + 'restore' 1.16377 + ); 1.16378 + }, 1.16379 + 1.16380 + getState : function(){ 1.16381 + return Ext.apply(Ext.Window.superclass.getState.call(this) || {}, this.getBox()); 1.16382 + }, 1.16383 + 1.16384 + onRender : function(ct, position){ 1.16385 + Ext.Window.superclass.onRender.call(this, ct, position); 1.16386 + 1.16387 + if(this.plain){ 1.16388 + this.el.addClass('x-window-plain'); 1.16389 + } 1.16390 + 1.16391 + this.focusEl = this.el.createChild({ 1.16392 + tag: "a", href:"#", cls:"x-dlg-focus", 1.16393 + tabIndex:"-1", html: " "}); 1.16394 + this.focusEl.swallowEvent('click', true); 1.16395 + 1.16396 + this.proxy = this.el.createProxy("x-window-proxy"); 1.16397 + this.proxy.enableDisplayMode('block'); 1.16398 + 1.16399 + if(this.modal){ 1.16400 + this.mask = this.container.createChild({cls:"ext-el-mask"}, this.el.dom); 1.16401 + this.mask.enableDisplayMode("block"); 1.16402 + this.mask.hide(); 1.16403 + } 1.16404 + }, 1.16405 + 1.16406 + initEvents : function(){ 1.16407 + Ext.Window.superclass.initEvents.call(this); 1.16408 + if(this.animateTarget){ 1.16409 + this.setAnimateTarget(this.animateTarget); 1.16410 + } 1.16411 + 1.16412 + if(this.resizable){ 1.16413 + this.resizer = new Ext.Resizable(this.el, { 1.16414 + minWidth: this.minWidth, 1.16415 + minHeight:this.minHeight, 1.16416 + handles: this.resizeHandles || "all", 1.16417 + pinned: true, 1.16418 + resizeElement : this.resizerAction 1.16419 + }); 1.16420 + this.resizer.window = this; 1.16421 + this.resizer.on("beforeresize", this.beforeResize, this); 1.16422 + } 1.16423 + 1.16424 + if(this.draggable){ 1.16425 + this.header.addClass("x-window-draggable"); 1.16426 + } 1.16427 + this.initTools(); 1.16428 + 1.16429 + this.el.on("mousedown", this.toFront, this); 1.16430 + this.manager = this.manager || Ext.WindowMgr; 1.16431 + this.manager.register(this); 1.16432 + this.hidden = true; 1.16433 + if(this.maximized){ 1.16434 + this.maximized = false; 1.16435 + this.maximize(); 1.16436 + } 1.16437 + if(this.closable){ 1.16438 + var km = this.getKeyMap(); 1.16439 + km.on(27, this.onEsc, this); 1.16440 + km.disable(); 1.16441 + } 1.16442 + }, 1.16443 + 1.16444 + initDraggable : function(){ 1.16445 + 1.16446 + this.dd = new Ext.Window.DD(this); 1.16447 + }, 1.16448 + 1.16449 + onEsc : function(){ 1.16450 + this[this.closeAction](); 1.16451 + }, 1.16452 + 1.16453 + beforeDestroy : function(){ 1.16454 + Ext.destroy( 1.16455 + this.resizer, 1.16456 + this.dd, 1.16457 + this.proxy, 1.16458 + this.mask 1.16459 + ); 1.16460 + Ext.Window.superclass.beforeDestroy.call(this); 1.16461 + }, 1.16462 + 1.16463 + onDestroy : function(){ 1.16464 + if(this.manager){ 1.16465 + this.manager.unregister(this); 1.16466 + } 1.16467 + Ext.Window.superclass.onDestroy.call(this); 1.16468 + }, 1.16469 + 1.16470 + initTools : function(){ 1.16471 + if(this.minimizable){ 1.16472 + this.addTool({ 1.16473 + id: 'minimize', 1.16474 + handler: this.minimize.createDelegate(this, []) 1.16475 + }); 1.16476 + } 1.16477 + if(this.maximizable){ 1.16478 + this.addTool({ 1.16479 + id: 'maximize', 1.16480 + handler: this.maximize.createDelegate(this, []) 1.16481 + }); 1.16482 + this.addTool({ 1.16483 + id: 'restore', 1.16484 + handler: this.restore.createDelegate(this, []), 1.16485 + hidden:true 1.16486 + }); 1.16487 + this.header.on('dblclick', this.toggleMaximize, this); 1.16488 + } 1.16489 + if(this.closable){ 1.16490 + this.addTool({ 1.16491 + id: 'close', 1.16492 + handler: this[this.closeAction].createDelegate(this, []) 1.16493 + }); 1.16494 + } 1.16495 + }, 1.16496 + 1.16497 + resizerAction : function(){ 1.16498 + var box = this.proxy.getBox(); 1.16499 + this.proxy.hide(); 1.16500 + this.window.handleResize(box); 1.16501 + return box; 1.16502 + }, 1.16503 + 1.16504 + beforeResize : function(){ 1.16505 + this.resizer.minHeight = Math.max(this.minHeight, this.getFrameHeight() + 40); this.resizer.minWidth = Math.max(this.minWidth, this.getFrameWidth() + 40); 1.16506 + this.resizeBox = this.el.getBox(); 1.16507 + }, 1.16508 + 1.16509 + updateHandles : function(){ 1.16510 + if(Ext.isIE && this.resizer){ 1.16511 + this.resizer.syncHandleHeight(); 1.16512 + this.el.repaint(); 1.16513 + } 1.16514 + }, 1.16515 + 1.16516 + handleResize : function(box){ 1.16517 + var rz = this.resizeBox; 1.16518 + if(rz.x != box.x || rz.y != box.y){ 1.16519 + this.updateBox(box); 1.16520 + }else{ 1.16521 + this.setSize(box); 1.16522 + } 1.16523 + this.focus(); 1.16524 + this.updateHandles(); 1.16525 + this.saveState(); 1.16526 + this.fireEvent("resize", this, box.width, box.height); 1.16527 + }, 1.16528 + 1.16529 + 1.16530 + focus : function(){ 1.16531 + var f = this.focusEl, db = this.defaultButton, t = typeof db; 1.16532 + if(t != 'undefined'){ 1.16533 + if(t == 'number'){ 1.16534 + f = this.buttons[db]; 1.16535 + }else if(t == 'string'){ 1.16536 + f = Ext.getCmp(db); 1.16537 + }else{ 1.16538 + f = db; 1.16539 + } 1.16540 + } 1.16541 + f.focus.defer(10, f); 1.16542 + }, 1.16543 + 1.16544 + 1.16545 + setAnimateTarget : function(el){ 1.16546 + el = Ext.get(el); 1.16547 + this.animateTarget = el; 1.16548 + }, 1.16549 + 1.16550 + beforeShow : function(){ 1.16551 + delete this.el.lastXY; 1.16552 + delete this.el.lastLT; 1.16553 + if(this.x === undefined || this.y === undefined){ 1.16554 + var xy = this.el.getAlignToXY(this.container, 'c-c'); 1.16555 + var pos = this.el.translatePoints(xy[0], xy[1]); 1.16556 + this.x = this.x === undefined? pos.left : this.x; 1.16557 + this.y = this.y === undefined? pos.top : this.y; 1.16558 + } 1.16559 + this.el.setLeftTop(this.x, this.y); 1.16560 + 1.16561 + if(this.expandOnShow){ 1.16562 + this.expand(false); 1.16563 + } 1.16564 + 1.16565 + if(this.modal){ 1.16566 + Ext.getBody().addClass("x-body-masked"); 1.16567 + this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); 1.16568 + this.mask.show(); 1.16569 + } 1.16570 + }, 1.16571 + 1.16572 + 1.16573 + show : function(animateTarget, cb, scope){ 1.16574 + if(!this.rendered){ 1.16575 + this.render(Ext.getBody()); 1.16576 + } 1.16577 + if(this.hidden === false){ 1.16578 + this.toFront(); 1.16579 + return; 1.16580 + } 1.16581 + if(this.fireEvent("beforeshow", this) === false){ 1.16582 + return; 1.16583 + } 1.16584 + if(cb){ 1.16585 + this.on('show', cb, scope, {single:true}); 1.16586 + } 1.16587 + this.hidden = false; 1.16588 + if(animateTarget !== undefined){ 1.16589 + this.setAnimateTarget(animateTarget); 1.16590 + } 1.16591 + this.beforeShow(); 1.16592 + if(this.animateTarget){ 1.16593 + this.animShow(); 1.16594 + }else{ 1.16595 + this.afterShow(); 1.16596 + } 1.16597 + }, 1.16598 + 1.16599 + afterShow : function(){ 1.16600 + this.proxy.hide(); 1.16601 + this.el.setStyle('display', 'block'); 1.16602 + this.el.show(); 1.16603 + if(this.maximized){ 1.16604 + this.fitContainer(); 1.16605 + } 1.16606 + if(Ext.isMac && Ext.isGecko){ this.cascade(this.setAutoScroll); 1.16607 + } 1.16608 + 1.16609 + if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){ 1.16610 + Ext.EventManager.onWindowResize(this.onWindowResize, this); 1.16611 + } 1.16612 + this.doConstrain(); 1.16613 + if(this.layout){ 1.16614 + this.doLayout(); 1.16615 + } 1.16616 + if(this.keyMap){ 1.16617 + this.keyMap.enable(); 1.16618 + } 1.16619 + this.toFront(); 1.16620 + this.updateHandles(); 1.16621 + this.fireEvent("show", this); 1.16622 + }, 1.16623 + 1.16624 + animShow : function(){ 1.16625 + this.proxy.show(); 1.16626 + this.proxy.setBox(this.animateTarget.getBox()); 1.16627 + this.proxy.setOpacity(0); 1.16628 + var b = this.getBox(false); 1.16629 + b.callback = this.afterShow; 1.16630 + b.scope = this; 1.16631 + b.duration = .25; 1.16632 + b.easing = 'easeNone'; 1.16633 + b.opacity = .5; 1.16634 + b.block = true; 1.16635 + this.el.setStyle('display', 'none'); 1.16636 + this.proxy.shift(b); 1.16637 + }, 1.16638 + 1.16639 + 1.16640 + hide : function(animateTarget, cb, scope){ 1.16641 + if(this.hidden || this.fireEvent("beforehide", this) === false){ 1.16642 + return; 1.16643 + } 1.16644 + if(cb){ 1.16645 + this.on('hide', cb, scope, {single:true}); 1.16646 + } 1.16647 + this.hidden = true; 1.16648 + if(animateTarget !== undefined){ 1.16649 + this.setAnimateTarget(animateTarget); 1.16650 + } 1.16651 + if(this.animateTarget){ 1.16652 + this.animHide(); 1.16653 + }else{ 1.16654 + this.el.hide(); 1.16655 + this.afterHide(); 1.16656 + } 1.16657 + }, 1.16658 + 1.16659 + afterHide : function(){ 1.16660 + this.proxy.hide(); 1.16661 + if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){ 1.16662 + Ext.EventManager.removeResizeListener(this.onWindowResize, this); 1.16663 + } 1.16664 + if(this.modal){ 1.16665 + this.mask.hide(); 1.16666 + Ext.getBody().removeClass("x-body-masked"); 1.16667 + } 1.16668 + if(this.keyMap){ 1.16669 + this.keyMap.disable(); 1.16670 + } 1.16671 + this.fireEvent("hide", this); 1.16672 + }, 1.16673 + 1.16674 + animHide : function(){ 1.16675 + this.proxy.setOpacity(.5); 1.16676 + this.proxy.show(); 1.16677 + var tb = this.getBox(false); 1.16678 + this.proxy.setBox(tb); 1.16679 + this.el.hide(); 1.16680 + var b = this.animateTarget.getBox(); 1.16681 + b.callback = this.afterHide; 1.16682 + b.scope = this; 1.16683 + b.duration = .25; 1.16684 + b.easing = 'easeNone'; 1.16685 + b.block = true; 1.16686 + b.opacity = 0; 1.16687 + this.proxy.shift(b); 1.16688 + }, 1.16689 + 1.16690 + onWindowResize : function(){ 1.16691 + if(this.maximized){ 1.16692 + this.fitContainer(); 1.16693 + } 1.16694 + if(this.modal){ 1.16695 + this.mask.setSize('100%', '100%'); 1.16696 + var force = this.mask.dom.offsetHeight; 1.16697 + this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); 1.16698 + } 1.16699 + this.doConstrain(); 1.16700 + }, 1.16701 + 1.16702 + doConstrain : function(){ 1.16703 + if(this.constrain || this.constrainHeader){ 1.16704 + var offsets; 1.16705 + if(this.constrain){ 1.16706 + offsets = { 1.16707 + right:this.el.shadowOffset, 1.16708 + left:this.el.shadowOffset, 1.16709 + bottom:this.el.shadowOffset 1.16710 + }; 1.16711 + }else { 1.16712 + var s = this.getSize(); 1.16713 + offsets = { 1.16714 + right:-(s.width - 100), 1.16715 + bottom:-(s.height - 25) 1.16716 + }; 1.16717 + } 1.16718 + 1.16719 + var xy = this.el.getConstrainToXY(this.container, true, offsets); 1.16720 + if(xy){ 1.16721 + this.setPosition(xy[0], xy[1]); 1.16722 + } 1.16723 + } 1.16724 + }, 1.16725 + 1.16726 + ghost : function(cls){ 1.16727 + var ghost = this.createGhost(cls); 1.16728 + var box = this.getBox(true); 1.16729 + ghost.setLeftTop(box.x, box.y); 1.16730 + ghost.setWidth(box.width); 1.16731 + this.el.hide(); 1.16732 + this.activeGhost = ghost; 1.16733 + return ghost; 1.16734 + }, 1.16735 + 1.16736 + unghost : function(show, matchPosition){ 1.16737 + if(show !== false){ 1.16738 + this.el.show(); 1.16739 + this.focus(); 1.16740 + if(Ext.isMac && Ext.isGecko){ this.cascade(this.setAutoScroll); 1.16741 + } 1.16742 + } 1.16743 + if(matchPosition !== false){ 1.16744 + this.setPosition(this.activeGhost.getLeft(true), this.activeGhost.getTop(true)); 1.16745 + } 1.16746 + this.activeGhost.hide(); 1.16747 + this.activeGhost.remove(); 1.16748 + delete this.activeGhost; 1.16749 + }, 1.16750 + 1.16751 + 1.16752 + minimize : function(){ 1.16753 + this.fireEvent('minimize', this); 1.16754 + }, 1.16755 + 1.16756 + 1.16757 + close : function(){ 1.16758 + if(this.fireEvent("beforeclose", this) !== false){ 1.16759 + this.hide(null, function(){ 1.16760 + this.fireEvent('close', this); 1.16761 + this.destroy(); 1.16762 + }, this); 1.16763 + } 1.16764 + }, 1.16765 + 1.16766 + 1.16767 + maximize : function(){ 1.16768 + if(!this.maximized){ 1.16769 + this.expand(false); 1.16770 + this.restoreSize = this.getSize(); 1.16771 + this.restorePos = this.getPosition(true); 1.16772 + if (this.maximizable){ 1.16773 + this.tools.maximize.hide(); 1.16774 + this.tools.restore.show(); 1.16775 + } 1.16776 + this.maximized = true; 1.16777 + this.el.disableShadow(); 1.16778 + 1.16779 + if(this.dd){ 1.16780 + this.dd.lock(); 1.16781 + } 1.16782 + if(this.collapsible){ 1.16783 + this.tools.toggle.hide(); 1.16784 + } 1.16785 + this.el.addClass('x-window-maximized'); 1.16786 + this.container.addClass('x-window-maximized-ct'); 1.16787 + 1.16788 + this.setPosition(0, 0); 1.16789 + this.fitContainer(); 1.16790 + this.fireEvent('maximize', this); 1.16791 + } 1.16792 + }, 1.16793 + 1.16794 + 1.16795 + restore : function(){ 1.16796 + if(this.maximized){ 1.16797 + this.el.removeClass('x-window-maximized'); 1.16798 + this.tools.restore.hide(); 1.16799 + this.tools.maximize.show(); 1.16800 + this.setPosition(this.restorePos[0], this.restorePos[1]); 1.16801 + this.setSize(this.restoreSize.width, this.restoreSize.height); 1.16802 + delete this.restorePos; 1.16803 + delete this.restoreSize; 1.16804 + this.maximized = false; 1.16805 + this.el.enableShadow(true); 1.16806 + 1.16807 + if(this.dd){ 1.16808 + this.dd.unlock(); 1.16809 + } 1.16810 + if(this.collapsible){ 1.16811 + this.tools.toggle.show(); 1.16812 + } 1.16813 + this.container.removeClass('x-window-maximized-ct'); 1.16814 + 1.16815 + this.doConstrain(); 1.16816 + this.fireEvent('restore', this); 1.16817 + } 1.16818 + }, 1.16819 + 1.16820 + 1.16821 + toggleMaximize : function(){ 1.16822 + this[this.maximized ? 'restore' : 'maximize'](); 1.16823 + }, 1.16824 + 1.16825 + fitContainer : function(){ 1.16826 + var vs = this.container.getViewSize(); 1.16827 + this.setSize(vs.width, vs.height); 1.16828 + }, 1.16829 + 1.16830 + setZIndex : function(index){ 1.16831 + if(this.modal){ 1.16832 + this.mask.setStyle("z-index", index); 1.16833 + } 1.16834 + this.el.setZIndex(++index); 1.16835 + index += 5; 1.16836 + 1.16837 + if(this.resizer){ 1.16838 + this.resizer.proxy.setStyle("z-index", ++index); 1.16839 + } 1.16840 + 1.16841 + this.lastZIndex = index; 1.16842 + }, 1.16843 + 1.16844 + 1.16845 + alignTo : function(element, position, offsets){ 1.16846 + var xy = this.el.getAlignToXY(element, position, offsets); 1.16847 + this.setPagePosition(xy[0], xy[1]); 1.16848 + return this; 1.16849 + }, 1.16850 + 1.16851 + 1.16852 + anchorTo : function(el, alignment, offsets, monitorScroll, _pname){ 1.16853 + var action = function(){ 1.16854 + this.alignTo(el, alignment, offsets); 1.16855 + }; 1.16856 + Ext.EventManager.onWindowResize(action, this); 1.16857 + var tm = typeof monitorScroll; 1.16858 + if(tm != 'undefined'){ 1.16859 + Ext.EventManager.on(window, 'scroll', action, this, 1.16860 + {buffer: tm == 'number' ? monitorScroll : 50}); 1.16861 + } 1.16862 + action.call(this); 1.16863 + this[_pname] = action; 1.16864 + return this; 1.16865 + }, 1.16866 + 1.16867 + 1.16868 + toFront : function(){ 1.16869 + if(this.manager.bringToFront(this)){ 1.16870 + this.focus(); 1.16871 + } 1.16872 + return this; 1.16873 + }, 1.16874 + 1.16875 + 1.16876 + setActive : function(active){ 1.16877 + if(active){ 1.16878 + if(!this.maximized){ 1.16879 + this.el.enableShadow(true); 1.16880 + } 1.16881 + this.fireEvent('activate', this); 1.16882 + }else{ 1.16883 + this.el.disableShadow(); 1.16884 + this.fireEvent('deactivate', this); 1.16885 + } 1.16886 + }, 1.16887 + 1.16888 + 1.16889 + toBack : function(){ 1.16890 + this.manager.sendToBack(this); 1.16891 + return this; 1.16892 + }, 1.16893 + 1.16894 + 1.16895 + center : function(){ 1.16896 + var xy = this.el.getAlignToXY(this.container, 'c-c'); 1.16897 + this.setPagePosition(xy[0], xy[1]); 1.16898 + return this; 1.16899 + } 1.16900 +}); 1.16901 +Ext.reg('window', Ext.Window); 1.16902 + 1.16903 +Ext.Window.DD = function(win){ 1.16904 + this.win = win; 1.16905 + Ext.Window.DD.superclass.constructor.call(this, win.el.id, 'WindowDD-'+win.id); 1.16906 + this.setHandleElId(win.header.id); 1.16907 + this.scroll = false; 1.16908 +}; 1.16909 + 1.16910 +Ext.extend(Ext.Window.DD, Ext.dd.DD, { 1.16911 + moveOnly:true, 1.16912 + headerOffsets:[100, 25], 1.16913 + startDrag : function(){ 1.16914 + var w = this.win; 1.16915 + this.proxy = w.ghost(); 1.16916 + if(w.constrain !== false){ 1.16917 + var so = w.el.shadowOffset; 1.16918 + this.constrainTo(w.container, {right: so, left: so, bottom: so}); 1.16919 + }else if(w.constrainHeader !== false){ 1.16920 + var s = this.proxy.getSize(); 1.16921 + this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])}); 1.16922 + } 1.16923 + }, 1.16924 + b4Drag : Ext.emptyFn, 1.16925 + 1.16926 + onDrag : function(e){ 1.16927 + this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY()); 1.16928 + }, 1.16929 + 1.16930 + endDrag : function(e){ 1.16931 + this.win.unghost(); 1.16932 + this.win.saveState(); 1.16933 + } 1.16934 +}); 1.16935 + 1.16936 + 1.16937 +Ext.WindowGroup = function(){ 1.16938 + var list = {}; 1.16939 + var accessList = []; 1.16940 + var front = null; 1.16941 + 1.16942 + var sortWindows = function(d1, d2){ 1.16943 + return (!d1._lastAccess || d1._lastAccess < d2._lastAccess) ? -1 : 1; 1.16944 + }; 1.16945 + 1.16946 + var orderWindows = function(){ 1.16947 + var a = accessList, len = a.length; 1.16948 + if(len > 0){ 1.16949 + a.sort(sortWindows); 1.16950 + var seed = a[0].manager.zseed; 1.16951 + for(var i = 0; i < len; i++){ 1.16952 + var win = a[i]; 1.16953 + if(win && !win.hidden){ 1.16954 + win.setZIndex(seed + (i*10)); 1.16955 + } 1.16956 + } 1.16957 + } 1.16958 + activateLast(); 1.16959 + }; 1.16960 + 1.16961 + var setActiveWin = function(win){ 1.16962 + if(win != front){ 1.16963 + if(front){ 1.16964 + front.setActive(false); 1.16965 + } 1.16966 + front = win; 1.16967 + if(win){ 1.16968 + win.setActive(true); 1.16969 + } 1.16970 + } 1.16971 + }; 1.16972 + 1.16973 + var activateLast = function(){ 1.16974 + for(var i = accessList.length-1; i >=0; --i) { 1.16975 + if(!accessList[i].hidden){ 1.16976 + setActiveWin(accessList[i]); 1.16977 + return; 1.16978 + } 1.16979 + } 1.16980 + setActiveWin(null); 1.16981 + }; 1.16982 + 1.16983 + return { 1.16984 + 1.16985 + zseed : 9000, 1.16986 + 1.16987 + register : function(win){ 1.16988 + list[win.id] = win; 1.16989 + accessList.push(win); 1.16990 + win.on('hide', activateLast); 1.16991 + }, 1.16992 + 1.16993 + unregister : function(win){ 1.16994 + delete list[win.id]; 1.16995 + win.un('hide', activateLast); 1.16996 + accessList.remove(win); 1.16997 + }, 1.16998 + 1.16999 + 1.17000 + get : function(id){ 1.17001 + return typeof id == "object" ? id : list[id]; 1.17002 + }, 1.17003 + 1.17004 + 1.17005 + bringToFront : function(win){ 1.17006 + win = this.get(win); 1.17007 + if(win != front){ 1.17008 + win._lastAccess = new Date().getTime(); 1.17009 + orderWindows(); 1.17010 + return true; 1.17011 + } 1.17012 + return false; 1.17013 + }, 1.17014 + 1.17015 + 1.17016 + sendToBack : function(win){ 1.17017 + win = this.get(win); 1.17018 + win._lastAccess = -(new Date().getTime()); 1.17019 + orderWindows(); 1.17020 + return win; 1.17021 + }, 1.17022 + 1.17023 + 1.17024 + hideAll : function(){ 1.17025 + for(var id in list){ 1.17026 + if(list[id] && typeof list[id] != "function" && list[id].isVisible()){ 1.17027 + list[id].hide(); 1.17028 + } 1.17029 + } 1.17030 + }, 1.17031 + 1.17032 + 1.17033 + getActive : function(){ 1.17034 + return front; 1.17035 + }, 1.17036 + 1.17037 + 1.17038 + getBy : function(fn, scope){ 1.17039 + var r = []; 1.17040 + for(var i = accessList.length-1; i >=0; --i) { 1.17041 + var win = accessList[i]; 1.17042 + if(fn.call(scope||win, win) !== false){ 1.17043 + r.push(win); 1.17044 + } 1.17045 + } 1.17046 + return r; 1.17047 + }, 1.17048 + 1.17049 + 1.17050 + each : function(fn, scope){ 1.17051 + for(var id in list){ 1.17052 + if(list[id] && typeof list[id] != "function"){ 1.17053 + if(fn.call(scope || list[id], list[id]) === false){ 1.17054 + return; 1.17055 + } 1.17056 + } 1.17057 + } 1.17058 + } 1.17059 + }; 1.17060 +}; 1.17061 + 1.17062 + 1.17063 + 1.17064 +Ext.WindowMgr = new Ext.WindowGroup(); 1.17065 + 1.17066 +Ext.dd.PanelProxy = function(panel, config){ 1.17067 + this.panel = panel; 1.17068 + this.id = this.panel.id +'-ddproxy'; 1.17069 + Ext.apply(this, config); 1.17070 +}; 1.17071 + 1.17072 +Ext.dd.PanelProxy.prototype = { 1.17073 + 1.17074 + insertProxy : true, 1.17075 + 1.17076 + 1.17077 + setStatus : Ext.emptyFn, 1.17078 + reset : Ext.emptyFn, 1.17079 + update : Ext.emptyFn, 1.17080 + stop : Ext.emptyFn, 1.17081 + sync: Ext.emptyFn, 1.17082 + 1.17083 + 1.17084 + getEl : function(){ 1.17085 + return this.ghost; 1.17086 + }, 1.17087 + 1.17088 + 1.17089 + getGhost : function(){ 1.17090 + return this.ghost; 1.17091 + }, 1.17092 + 1.17093 + 1.17094 + getProxy : function(){ 1.17095 + return this.proxy; 1.17096 + }, 1.17097 + 1.17098 + 1.17099 + hide : function(){ 1.17100 + if(this.ghost){ 1.17101 + if(this.proxy){ 1.17102 + this.proxy.remove(); 1.17103 + delete this.proxy; 1.17104 + } 1.17105 + this.panel.el.dom.style.display = ''; 1.17106 + this.ghost.remove(); 1.17107 + delete this.ghost; 1.17108 + } 1.17109 + }, 1.17110 + 1.17111 + 1.17112 + show : function(){ 1.17113 + if(!this.ghost){ 1.17114 + this.ghost = this.panel.createGhost(undefined, undefined, Ext.getBody()); 1.17115 + this.ghost.setXY(this.panel.el.getXY()) 1.17116 + if(this.insertProxy){ 1.17117 + this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'}); 1.17118 + this.proxy.setSize(this.panel.getSize()); 1.17119 + } 1.17120 + this.panel.el.dom.style.display = 'none'; 1.17121 + } 1.17122 + }, 1.17123 + 1.17124 + 1.17125 + repair : function(xy, callback, scope){ 1.17126 + this.hide(); 1.17127 + if(typeof callback == "function"){ 1.17128 + callback.call(scope || this); 1.17129 + } 1.17130 + }, 1.17131 + 1.17132 + 1.17133 + moveProxy : function(parentNode, before){ 1.17134 + if(this.proxy){ 1.17135 + parentNode.insertBefore(this.proxy.dom, before); 1.17136 + } 1.17137 + } 1.17138 +}; 1.17139 + 1.17140 + 1.17141 +Ext.Panel.DD = function(panel, cfg){ 1.17142 + this.panel = panel; 1.17143 + this.dragData = {panel: panel}; 1.17144 + this.proxy = new Ext.dd.PanelProxy(panel, cfg); 1.17145 + Ext.Panel.DD.superclass.constructor.call(this, panel.el, cfg); 1.17146 + var h = panel.header; 1.17147 + if(h){ 1.17148 + this.setHandleElId(h.id); 1.17149 + } 1.17150 + (h ? h : this.panel.body).setStyle('cursor', 'move'); 1.17151 + this.scroll = false; 1.17152 +}; 1.17153 + 1.17154 +Ext.extend(Ext.Panel.DD, Ext.dd.DragSource, { 1.17155 + showFrame: Ext.emptyFn, 1.17156 + startDrag: Ext.emptyFn, 1.17157 + b4StartDrag: function(x, y) { 1.17158 + this.proxy.show(); 1.17159 + }, 1.17160 + b4MouseDown: function(e) { 1.17161 + var x = e.getPageX(); 1.17162 + var y = e.getPageY(); 1.17163 + this.autoOffset(x, y); 1.17164 + }, 1.17165 + onInitDrag : function(x, y){ 1.17166 + this.onStartDrag(x, y); 1.17167 + return true; 1.17168 + }, 1.17169 + createFrame : Ext.emptyFn, 1.17170 + getDragEl : function(e){ 1.17171 + return this.proxy.ghost.dom; 1.17172 + }, 1.17173 + endDrag : function(e){ 1.17174 + this.proxy.hide(); 1.17175 + this.panel.saveState(); 1.17176 + }, 1.17177 + 1.17178 + autoOffset : function(x, y) { 1.17179 + x -= this.startPageX; 1.17180 + y -= this.startPageY; 1.17181 + this.setDelta(x, y); 1.17182 + } 1.17183 +}); 1.17184 + 1.17185 +Ext.state.Provider = function(){ 1.17186 + 1.17187 + this.addEvents("statechange"); 1.17188 + this.state = {}; 1.17189 + Ext.state.Provider.superclass.constructor.call(this); 1.17190 +}; 1.17191 +Ext.extend(Ext.state.Provider, Ext.util.Observable, { 1.17192 + 1.17193 + get : function(name, defaultValue){ 1.17194 + return typeof this.state[name] == "undefined" ? 1.17195 + defaultValue : this.state[name]; 1.17196 + }, 1.17197 + 1.17198 + 1.17199 + clear : function(name){ 1.17200 + delete this.state[name]; 1.17201 + this.fireEvent("statechange", this, name, null); 1.17202 + }, 1.17203 + 1.17204 + 1.17205 + set : function(name, value){ 1.17206 + this.state[name] = value; 1.17207 + this.fireEvent("statechange", this, name, value); 1.17208 + }, 1.17209 + 1.17210 + 1.17211 + decodeValue : function(cookie){ 1.17212 + var re = /^(a|n|d|b|s|o)\:(.*)$/; 1.17213 + var matches = re.exec(unescape(cookie)); 1.17214 + if(!matches || !matches[1]) return; 1.17215 + var type = matches[1]; 1.17216 + var v = matches[2]; 1.17217 + switch(type){ 1.17218 + case "n": 1.17219 + return parseFloat(v); 1.17220 + case "d": 1.17221 + return new Date(Date.parse(v)); 1.17222 + case "b": 1.17223 + return (v == "1"); 1.17224 + case "a": 1.17225 + var all = []; 1.17226 + var values = v.split("^"); 1.17227 + for(var i = 0, len = values.length; i < len; i++){ 1.17228 + all.push(this.decodeValue(values[i])); 1.17229 + } 1.17230 + return all; 1.17231 + case "o": 1.17232 + var all = {}; 1.17233 + var values = v.split("^"); 1.17234 + for(var i = 0, len = values.length; i < len; i++){ 1.17235 + var kv = values[i].split("="); 1.17236 + all[kv[0]] = this.decodeValue(kv[1]); 1.17237 + } 1.17238 + return all; 1.17239 + default: 1.17240 + return v; 1.17241 + } 1.17242 + }, 1.17243 + 1.17244 + 1.17245 + encodeValue : function(v){ 1.17246 + var enc; 1.17247 + if(typeof v == "number"){ 1.17248 + enc = "n:" + v; 1.17249 + }else if(typeof v == "boolean"){ 1.17250 + enc = "b:" + (v ? "1" : "0"); 1.17251 + }else if(Ext.isDate(v)){ 1.17252 + enc = "d:" + v.toGMTString(); 1.17253 + }else if(Ext.isArray(v)){ 1.17254 + var flat = ""; 1.17255 + for(var i = 0, len = v.length; i < len; i++){ 1.17256 + flat += this.encodeValue(v[i]); 1.17257 + if(i != len-1) flat += "^"; 1.17258 + } 1.17259 + enc = "a:" + flat; 1.17260 + }else if(typeof v == "object"){ 1.17261 + var flat = ""; 1.17262 + for(var key in v){ 1.17263 + if(typeof v[key] != "function" && v[key] !== undefined){ 1.17264 + flat += key + "=" + this.encodeValue(v[key]) + "^"; 1.17265 + } 1.17266 + } 1.17267 + enc = "o:" + flat.substring(0, flat.length-1); 1.17268 + }else{ 1.17269 + enc = "s:" + v; 1.17270 + } 1.17271 + return escape(enc); 1.17272 + } 1.17273 +}); 1.17274 + 1.17275 + 1.17276 +Ext.state.Manager = function(){ 1.17277 + var provider = new Ext.state.Provider(); 1.17278 + 1.17279 + return { 1.17280 + 1.17281 + setProvider : function(stateProvider){ 1.17282 + provider = stateProvider; 1.17283 + }, 1.17284 + 1.17285 + 1.17286 + get : function(key, defaultValue){ 1.17287 + return provider.get(key, defaultValue); 1.17288 + }, 1.17289 + 1.17290 + 1.17291 + set : function(key, value){ 1.17292 + provider.set(key, value); 1.17293 + }, 1.17294 + 1.17295 + 1.17296 + clear : function(key){ 1.17297 + provider.clear(key); 1.17298 + }, 1.17299 + 1.17300 + 1.17301 + getProvider : function(){ 1.17302 + return provider; 1.17303 + } 1.17304 + }; 1.17305 +}(); 1.17306 + 1.17307 + 1.17308 +Ext.state.CookieProvider = function(config){ 1.17309 + Ext.state.CookieProvider.superclass.constructor.call(this); 1.17310 + this.path = "/"; 1.17311 + this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); 1.17312 + this.domain = null; 1.17313 + this.secure = false; 1.17314 + Ext.apply(this, config); 1.17315 + this.state = this.readCookies(); 1.17316 +}; 1.17317 + 1.17318 +Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { 1.17319 + 1.17320 + set : function(name, value){ 1.17321 + if(typeof value == "undefined" || value === null){ 1.17322 + this.clear(name); 1.17323 + return; 1.17324 + } 1.17325 + this.setCookie(name, value); 1.17326 + Ext.state.CookieProvider.superclass.set.call(this, name, value); 1.17327 + }, 1.17328 + 1.17329 + 1.17330 + clear : function(name){ 1.17331 + this.clearCookie(name); 1.17332 + Ext.state.CookieProvider.superclass.clear.call(this, name); 1.17333 + }, 1.17334 + 1.17335 + 1.17336 + readCookies : function(){ 1.17337 + var cookies = {}; 1.17338 + var c = document.cookie + ";"; 1.17339 + var re = /\s?(.*?)=(.*?);/g; 1.17340 + var matches; 1.17341 + while((matches = re.exec(c)) != null){ 1.17342 + var name = matches[1]; 1.17343 + var value = matches[2]; 1.17344 + if(name && name.substring(0,3) == "ys-"){ 1.17345 + cookies[name.substr(3)] = this.decodeValue(value); 1.17346 + } 1.17347 + } 1.17348 + return cookies; 1.17349 + }, 1.17350 + 1.17351 + 1.17352 + setCookie : function(name, value){ 1.17353 + document.cookie = "ys-"+ name + "=" + this.encodeValue(value) + 1.17354 + ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) + 1.17355 + ((this.path == null) ? "" : ("; path=" + this.path)) + 1.17356 + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + 1.17357 + ((this.secure == true) ? "; secure" : ""); 1.17358 + }, 1.17359 + 1.17360 + 1.17361 + clearCookie : function(name){ 1.17362 + document.cookie = "ys-" + name + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" + 1.17363 + ((this.path == null) ? "" : ("; path=" + this.path)) + 1.17364 + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + 1.17365 + ((this.secure == true) ? "; secure" : ""); 1.17366 + } 1.17367 +}); 1.17368 + 1.17369 +Ext.DataView = Ext.extend(Ext.BoxComponent, { 1.17370 + 1.17371 + 1.17372 + 1.17373 + 1.17374 + 1.17375 + 1.17376 + 1.17377 + 1.17378 + 1.17379 + selectedClass : "x-view-selected", 1.17380 + 1.17381 + emptyText : "", 1.17382 + 1.17383 + 1.17384 + deferEmptyText: true, 1.17385 + 1.17386 + last: false, 1.17387 + 1.17388 + initComponent : function(){ 1.17389 + Ext.DataView.superclass.initComponent.call(this); 1.17390 + if(typeof this.tpl == "string"){ 1.17391 + this.tpl = new Ext.XTemplate(this.tpl); 1.17392 + } 1.17393 + 1.17394 + this.addEvents( 1.17395 + 1.17396 + "beforeclick", 1.17397 + 1.17398 + "click", 1.17399 + 1.17400 + "containerclick", 1.17401 + 1.17402 + "dblclick", 1.17403 + 1.17404 + "contextmenu", 1.17405 + 1.17406 + "selectionchange", 1.17407 + 1.17408 + 1.17409 + "beforeselect" 1.17410 + ); 1.17411 + 1.17412 + this.all = new Ext.CompositeElementLite(); 1.17413 + this.selected = new Ext.CompositeElementLite(); 1.17414 + }, 1.17415 + 1.17416 + onRender : function(){ 1.17417 + if(!this.el){ 1.17418 + this.el = document.createElement('div'); 1.17419 + this.el.id = this.id; 1.17420 + } 1.17421 + Ext.DataView.superclass.onRender.apply(this, arguments); 1.17422 + }, 1.17423 + 1.17424 + afterRender : function(){ 1.17425 + Ext.DataView.superclass.afterRender.call(this); 1.17426 + 1.17427 + this.el.on({ 1.17428 + "click": this.onClick, 1.17429 + "dblclick": this.onDblClick, 1.17430 + "contextmenu": this.onContextMenu, 1.17431 + scope:this 1.17432 + }); 1.17433 + 1.17434 + if(this.overClass){ 1.17435 + this.el.on({ 1.17436 + "mouseover": this.onMouseOver, 1.17437 + "mouseout": this.onMouseOut, 1.17438 + scope:this 1.17439 + }); 1.17440 + } 1.17441 + 1.17442 + if(this.store){ 1.17443 + this.setStore(this.store, true); 1.17444 + } 1.17445 + }, 1.17446 + 1.17447 + 1.17448 + refresh : function(){ 1.17449 + this.clearSelections(false, true); 1.17450 + this.el.update(""); 1.17451 + var html = []; 1.17452 + var records = this.store.getRange(); 1.17453 + if(records.length < 1){ 1.17454 + if(!this.deferEmptyText || this.hasSkippedEmptyText){ 1.17455 + this.el.update(this.emptyText); 1.17456 + } 1.17457 + this.hasSkippedEmptyText = true; 1.17458 + this.all.clear(); 1.17459 + return; 1.17460 + } 1.17461 + this.tpl.overwrite(this.el, this.collectData(records, 0)); 1.17462 + this.all.fill(Ext.query(this.itemSelector, this.el.dom)); 1.17463 + this.updateIndexes(0); 1.17464 + }, 1.17465 + 1.17466 + 1.17467 + prepareData : function(data){ 1.17468 + return data; 1.17469 + }, 1.17470 + 1.17471 + collectData : function(records, startIndex){ 1.17472 + var r = []; 1.17473 + for(var i = 0, len = records.length; i < len; i++){ 1.17474 + r[r.length] = this.prepareData(records[i].data, startIndex+i, records[i]); 1.17475 + } 1.17476 + return r; 1.17477 + }, 1.17478 + 1.17479 + bufferRender : function(records){ 1.17480 + var div = document.createElement('div'); 1.17481 + this.tpl.overwrite(div, this.collectData(records)); 1.17482 + return Ext.query(this.itemSelector, div); 1.17483 + }, 1.17484 + 1.17485 + onUpdate : function(ds, record){ 1.17486 + var index = this.store.indexOf(record); 1.17487 + var sel = this.isSelected(index); 1.17488 + var original = this.all.elements[index]; 1.17489 + var node = this.bufferRender([record], index)[0]; 1.17490 + 1.17491 + this.all.replaceElement(index, node, true); 1.17492 + if(sel){ 1.17493 + this.selected.replaceElement(original, node); 1.17494 + this.all.item(index).addClass(this.selectedClass); 1.17495 + } 1.17496 + this.updateIndexes(index, index); 1.17497 + }, 1.17498 + 1.17499 + onAdd : function(ds, records, index){ 1.17500 + if(this.all.getCount() == 0){ 1.17501 + this.refresh(); 1.17502 + return; 1.17503 + } 1.17504 + var nodes = this.bufferRender(records, index), n, a = this.all.elements; 1.17505 + if(index < this.all.getCount()){ 1.17506 + n = this.all.item(index).insertSibling(nodes, 'before', true); 1.17507 + a.splice.apply(a, [index, 0].concat(nodes)); 1.17508 + }else{ 1.17509 + n = this.all.last().insertSibling(nodes, 'after', true); 1.17510 + a.push.apply(a, nodes); 1.17511 + } 1.17512 + this.updateIndexes(index); 1.17513 + }, 1.17514 + 1.17515 + onRemove : function(ds, record, index){ 1.17516 + this.deselect(index); 1.17517 + this.all.removeElement(index, true); 1.17518 + this.updateIndexes(index); 1.17519 + }, 1.17520 + 1.17521 + 1.17522 + refreshNode : function(index){ 1.17523 + this.onUpdate(this.store, this.store.getAt(index)); 1.17524 + }, 1.17525 + 1.17526 + updateIndexes : function(startIndex, endIndex){ 1.17527 + var ns = this.all.elements; 1.17528 + startIndex = startIndex || 0; 1.17529 + endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1)); 1.17530 + for(var i = startIndex; i <= endIndex; i++){ 1.17531 + ns[i].viewIndex = i; 1.17532 + } 1.17533 + }, 1.17534 + 1.17535 + 1.17536 + setStore : function(store, initial){ 1.17537 + if(!initial && this.store){ 1.17538 + this.store.un("beforeload", this.onBeforeLoad, this); 1.17539 + this.store.un("datachanged", this.refresh, this); 1.17540 + this.store.un("add", this.onAdd, this); 1.17541 + this.store.un("remove", this.onRemove, this); 1.17542 + this.store.un("update", this.onUpdate, this); 1.17543 + this.store.un("clear", this.refresh, this); 1.17544 + } 1.17545 + if(store){ 1.17546 + store = Ext.StoreMgr.lookup(store); 1.17547 + store.on("beforeload", this.onBeforeLoad, this); 1.17548 + store.on("datachanged", this.refresh, this); 1.17549 + store.on("add", this.onAdd, this); 1.17550 + store.on("remove", this.onRemove, this); 1.17551 + store.on("update", this.onUpdate, this); 1.17552 + store.on("clear", this.refresh, this); 1.17553 + } 1.17554 + this.store = store; 1.17555 + if(store){ 1.17556 + this.refresh(); 1.17557 + } 1.17558 + }, 1.17559 + 1.17560 + 1.17561 + findItemFromChild : function(node){ 1.17562 + return Ext.fly(node).findParent(this.itemSelector, this.el); 1.17563 + }, 1.17564 + 1.17565 + onClick : function(e){ 1.17566 + var item = e.getTarget(this.itemSelector, this.el); 1.17567 + if(item){ 1.17568 + var index = this.indexOf(item); 1.17569 + if(this.onItemClick(item, index, e) !== false){ 1.17570 + this.fireEvent("click", this, index, item, e); 1.17571 + } 1.17572 + }else{ 1.17573 + if(this.fireEvent("containerclick", this, e) !== false){ 1.17574 + this.clearSelections(); 1.17575 + } 1.17576 + } 1.17577 + }, 1.17578 + 1.17579 + onContextMenu : function(e){ 1.17580 + var item = e.getTarget(this.itemSelector, this.el); 1.17581 + if(item){ 1.17582 + this.fireEvent("contextmenu", this, this.indexOf(item), item, e); 1.17583 + } 1.17584 + }, 1.17585 + 1.17586 + onDblClick : function(e){ 1.17587 + var item = e.getTarget(this.itemSelector, this.el); 1.17588 + if(item){ 1.17589 + this.fireEvent("dblclick", this, this.indexOf(item), item, e); 1.17590 + } 1.17591 + }, 1.17592 + 1.17593 + onMouseOver : function(e){ 1.17594 + var item = e.getTarget(this.itemSelector, this.el); 1.17595 + if(item && item !== this.lastItem){ 1.17596 + this.lastItem = item; 1.17597 + Ext.fly(item).addClass(this.overClass); 1.17598 + } 1.17599 + }, 1.17600 + 1.17601 + onMouseOut : function(e){ 1.17602 + if(this.lastItem){ 1.17603 + if(!e.within(this.lastItem, true)){ 1.17604 + Ext.fly(this.lastItem).removeClass(this.overClass); 1.17605 + delete this.lastItem; 1.17606 + } 1.17607 + } 1.17608 + }, 1.17609 + 1.17610 + onItemClick : function(item, index, e){ 1.17611 + if(this.fireEvent("beforeclick", this, index, item, e) === false){ 1.17612 + return false; 1.17613 + } 1.17614 + if(this.multiSelect){ 1.17615 + this.doMultiSelection(item, index, e); 1.17616 + e.preventDefault(); 1.17617 + }else if(this.singleSelect){ 1.17618 + this.doSingleSelection(item, index, e); 1.17619 + e.preventDefault(); 1.17620 + } 1.17621 + return true; 1.17622 + }, 1.17623 + 1.17624 + doSingleSelection : function(item, index, e){ 1.17625 + if(e.ctrlKey && this.isSelected(index)){ 1.17626 + this.deselect(index); 1.17627 + }else{ 1.17628 + this.select(index, false); 1.17629 + } 1.17630 + }, 1.17631 + 1.17632 + doMultiSelection : function(item, index, e){ 1.17633 + if(e.shiftKey && this.last !== false){ 1.17634 + var last = this.last; 1.17635 + this.selectRange(last, index, e.ctrlKey); 1.17636 + this.last = last; }else{ 1.17637 + if((e.ctrlKey||this.simpleSelect) && this.isSelected(index)){ 1.17638 + this.deselect(index); 1.17639 + }else{ 1.17640 + this.select(index, e.ctrlKey || e.shiftKey || this.simpleSelect); 1.17641 + } 1.17642 + } 1.17643 + }, 1.17644 + 1.17645 + 1.17646 + getSelectionCount : function(){ 1.17647 + return this.selected.getCount() 1.17648 + }, 1.17649 + 1.17650 + 1.17651 + getSelectedNodes : function(){ 1.17652 + return this.selected.elements; 1.17653 + }, 1.17654 + 1.17655 + 1.17656 + getSelectedIndexes : function(){ 1.17657 + var indexes = [], s = this.selected.elements; 1.17658 + for(var i = 0, len = s.length; i < len; i++){ 1.17659 + indexes.push(s[i].viewIndex); 1.17660 + } 1.17661 + return indexes; 1.17662 + }, 1.17663 + 1.17664 + 1.17665 + getSelectedRecords : function(){ 1.17666 + var r = [], s = this.selected.elements; 1.17667 + for(var i = 0, len = s.length; i < len; i++){ 1.17668 + r[r.length] = this.store.getAt(s[i].viewIndex); 1.17669 + } 1.17670 + return r; 1.17671 + }, 1.17672 + 1.17673 + 1.17674 + getRecords : function(nodes){ 1.17675 + var r = [], s = nodes; 1.17676 + for(var i = 0, len = s.length; i < len; i++){ 1.17677 + r[r.length] = this.store.getAt(s[i].viewIndex); 1.17678 + } 1.17679 + return r; 1.17680 + }, 1.17681 + 1.17682 + 1.17683 + getRecord : function(node){ 1.17684 + return this.store.getAt(node.viewIndex); 1.17685 + }, 1.17686 + 1.17687 + 1.17688 + clearSelections : function(suppressEvent, skipUpdate){ 1.17689 + if((this.multiSelect || this.singleSelect) && this.selected.getCount() > 0){ 1.17690 + if(!skipUpdate){ 1.17691 + this.selected.removeClass(this.selectedClass); 1.17692 + } 1.17693 + this.selected.clear(); 1.17694 + this.last = false; 1.17695 + if(!suppressEvent){ 1.17696 + this.fireEvent("selectionchange", this, this.selected.elements); 1.17697 + } 1.17698 + } 1.17699 + }, 1.17700 + 1.17701 + 1.17702 + isSelected : function(node){ 1.17703 + return this.selected.contains(this.getNode(node)); 1.17704 + }, 1.17705 + 1.17706 + 1.17707 + deselect : function(node){ 1.17708 + if(this.isSelected(node)){ 1.17709 + var node = this.getNode(node); 1.17710 + this.selected.removeElement(node); 1.17711 + if(this.last == node.viewIndex){ 1.17712 + this.last = false; 1.17713 + } 1.17714 + Ext.fly(node).removeClass(this.selectedClass); 1.17715 + this.fireEvent("selectionchange", this, this.selected.elements); 1.17716 + } 1.17717 + }, 1.17718 + 1.17719 + 1.17720 + select : function(nodeInfo, keepExisting, suppressEvent){ 1.17721 + if(Ext.isArray(nodeInfo)){ 1.17722 + if(!keepExisting){ 1.17723 + this.clearSelections(true); 1.17724 + } 1.17725 + for(var i = 0, len = nodeInfo.length; i < len; i++){ 1.17726 + this.select(nodeInfo[i], true, true); 1.17727 + } 1.17728 + if(!suppressEvent){ 1.17729 + this.fireEvent("selectionchange", this, this.selected.elements); 1.17730 + } 1.17731 + } else{ 1.17732 + var node = this.getNode(nodeInfo); 1.17733 + if(!keepExisting){ 1.17734 + this.clearSelections(true); 1.17735 + } 1.17736 + if(node && !this.isSelected(node)){ 1.17737 + if(this.fireEvent("beforeselect", this, node, this.selected.elements) !== false){ 1.17738 + Ext.fly(node).addClass(this.selectedClass); 1.17739 + this.selected.add(node); 1.17740 + this.last = node.viewIndex; 1.17741 + if(!suppressEvent){ 1.17742 + this.fireEvent("selectionchange", this, this.selected.elements); 1.17743 + } 1.17744 + } 1.17745 + } 1.17746 + } 1.17747 + }, 1.17748 + 1.17749 + 1.17750 + selectRange : function(start, end, keepExisting){ 1.17751 + if(!keepExisting){ 1.17752 + this.clearSelections(true); 1.17753 + } 1.17754 + this.select(this.getNodes(start, end), true); 1.17755 + }, 1.17756 + 1.17757 + 1.17758 + getNode : function(nodeInfo){ 1.17759 + if(typeof nodeInfo == "string"){ 1.17760 + return document.getElementById(nodeInfo); 1.17761 + }else if(typeof nodeInfo == "number"){ 1.17762 + return this.all.elements[nodeInfo]; 1.17763 + } 1.17764 + return nodeInfo; 1.17765 + }, 1.17766 + 1.17767 + 1.17768 + getNodes : function(start, end){ 1.17769 + var ns = this.all.elements; 1.17770 + start = start || 0; 1.17771 + end = typeof end == "undefined" ? ns.length - 1 : end; 1.17772 + var nodes = [], i; 1.17773 + if(start <= end){ 1.17774 + for(i = start; i <= end; i++){ 1.17775 + nodes.push(ns[i]); 1.17776 + } 1.17777 + } else{ 1.17778 + for(i = start; i >= end; i--){ 1.17779 + nodes.push(ns[i]); 1.17780 + } 1.17781 + } 1.17782 + return nodes; 1.17783 + }, 1.17784 + 1.17785 + 1.17786 + indexOf : function(node){ 1.17787 + node = this.getNode(node); 1.17788 + if(typeof node.viewIndex == "number"){ 1.17789 + return node.viewIndex; 1.17790 + } 1.17791 + return this.all.indexOf(node); 1.17792 + }, 1.17793 + 1.17794 + onBeforeLoad : function(){ 1.17795 + if(this.loadingText){ 1.17796 + this.clearSelections(false, true); 1.17797 + this.el.update('<div class="loading-indicator">'+this.loadingText+'</div>'); 1.17798 + this.all.clear(); 1.17799 + } 1.17800 + }, 1.17801 + 1.17802 + onDestroy : function(){ 1.17803 + Ext.DataView.superclass.onDestroy.call(this); 1.17804 + this.setStore(null); 1.17805 + } 1.17806 +}); 1.17807 + 1.17808 +Ext.reg('dataview', Ext.DataView); 1.17809 + 1.17810 +Ext.ColorPalette = function(config){ 1.17811 + Ext.ColorPalette.superclass.constructor.call(this, config); 1.17812 + this.addEvents( 1.17813 + 1.17814 + 'select' 1.17815 + ); 1.17816 + 1.17817 + if(this.handler){ 1.17818 + this.on("select", this.handler, this.scope, true); 1.17819 + } 1.17820 +}; 1.17821 +Ext.extend(Ext.ColorPalette, Ext.Component, { 1.17822 + 1.17823 + 1.17824 + itemCls : "x-color-palette", 1.17825 + 1.17826 + value : null, 1.17827 + clickEvent:'click', 1.17828 + ctype: "Ext.ColorPalette", 1.17829 + 1.17830 + 1.17831 + allowReselect : false, 1.17832 + 1.17833 + 1.17834 + colors : [ 1.17835 + "000000", "993300", "333300", "003300", "003366", "000080", "333399", "333333", 1.17836 + "800000", "FF6600", "808000", "008000", "008080", "0000FF", "666699", "808080", 1.17837 + "FF0000", "FF9900", "99CC00", "339966", "33CCCC", "3366FF", "800080", "969696", 1.17838 + "FF00FF", "FFCC00", "FFFF00", "00FF00", "00FFFF", "00CCFF", "993366", "C0C0C0", 1.17839 + "FF99CC", "FFCC99", "FFFF99", "CCFFCC", "CCFFFF", "99CCFF", "CC99FF", "FFFFFF" 1.17840 + ], 1.17841 + 1.17842 + onRender : function(container, position){ 1.17843 + var t = this.tpl || new Ext.XTemplate( 1.17844 + '<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on"> </span></em></a></tpl>' 1.17845 + ); 1.17846 + var el = document.createElement("div"); 1.17847 + el.className = this.itemCls; 1.17848 + t.overwrite(el, this.colors); 1.17849 + container.dom.insertBefore(el, position); 1.17850 + this.el = Ext.get(el); 1.17851 + this.el.on(this.clickEvent, this.handleClick, this, {delegate: "a"}); 1.17852 + if(this.clickEvent != 'click'){ 1.17853 + this.el.on('click', Ext.emptyFn, this, {delegate: "a", preventDefault:true}); 1.17854 + } 1.17855 + }, 1.17856 + 1.17857 + afterRender : function(){ 1.17858 + Ext.ColorPalette.superclass.afterRender.call(this); 1.17859 + if(this.value){ 1.17860 + var s = this.value; 1.17861 + this.value = null; 1.17862 + this.select(s); 1.17863 + } 1.17864 + }, 1.17865 + 1.17866 + handleClick : function(e, t){ 1.17867 + e.preventDefault(); 1.17868 + if(!this.disabled){ 1.17869 + var c = t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1]; 1.17870 + this.select(c.toUpperCase()); 1.17871 + } 1.17872 + }, 1.17873 + 1.17874 + 1.17875 + select : function(color){ 1.17876 + color = color.replace("#", ""); 1.17877 + if(color != this.value || this.allowReselect){ 1.17878 + var el = this.el; 1.17879 + if(this.value){ 1.17880 + el.child("a.color-"+this.value).removeClass("x-color-palette-sel"); 1.17881 + } 1.17882 + el.child("a.color-"+color).addClass("x-color-palette-sel"); 1.17883 + this.value = color; 1.17884 + this.fireEvent("select", this, color); 1.17885 + } 1.17886 + } 1.17887 + 1.17888 + 1.17889 +}); 1.17890 +Ext.reg('colorpalette', Ext.ColorPalette); 1.17891 + 1.17892 +Ext.DatePicker = Ext.extend(Ext.Component, { 1.17893 + 1.17894 + todayText : "Today", 1.17895 + 1.17896 + okText : " OK ", 1.17897 + 1.17898 + cancelText : "Cancel", 1.17899 + 1.17900 + todayTip : "{0} (Spacebar)", 1.17901 + 1.17902 + minDate : null, 1.17903 + 1.17904 + maxDate : null, 1.17905 + 1.17906 + minText : "This date is before the minimum date", 1.17907 + 1.17908 + maxText : "This date is after the maximum date", 1.17909 + 1.17910 + format : "m/d/y", 1.17911 + 1.17912 + disabledDays : null, 1.17913 + 1.17914 + disabledDaysText : "", 1.17915 + 1.17916 + disabledDatesRE : null, 1.17917 + 1.17918 + disabledDatesText : "", 1.17919 + 1.17920 + constrainToViewport : true, 1.17921 + 1.17922 + monthNames : Date.monthNames, 1.17923 + 1.17924 + dayNames : Date.dayNames, 1.17925 + 1.17926 + nextText: 'Next Month (Control+Right)', 1.17927 + 1.17928 + prevText: 'Previous Month (Control+Left)', 1.17929 + 1.17930 + monthYearText: 'Choose a month (Control+Up/Down to move years)', 1.17931 + 1.17932 + startDay : 0, 1.17933 + 1.17934 + initComponent : function(){ 1.17935 + Ext.DatePicker.superclass.initComponent.call(this); 1.17936 + 1.17937 + this.value = this.value ? 1.17938 + this.value.clearTime() : new Date().clearTime(); 1.17939 + 1.17940 + this.addEvents( 1.17941 + 1.17942 + 'select' 1.17943 + ); 1.17944 + 1.17945 + if(this.handler){ 1.17946 + this.on("select", this.handler, this.scope || this); 1.17947 + } 1.17948 + 1.17949 + this.initDisabledDays(); 1.17950 + }, 1.17951 + 1.17952 + 1.17953 + initDisabledDays : function(){ 1.17954 + if(!this.disabledDatesRE && this.disabledDates){ 1.17955 + var dd = this.disabledDates; 1.17956 + var re = "(?:"; 1.17957 + for(var i = 0; i < dd.length; i++){ 1.17958 + re += dd[i]; 1.17959 + if(i != dd.length-1) re += "|"; 1.17960 + } 1.17961 + this.disabledDatesRE = new RegExp(re + ")"); 1.17962 + } 1.17963 + }, 1.17964 + 1.17965 + 1.17966 + setValue : function(value){ 1.17967 + var old = this.value; 1.17968 + this.value = value.clearTime(true); 1.17969 + if(this.el){ 1.17970 + this.update(this.value); 1.17971 + } 1.17972 + }, 1.17973 + 1.17974 + 1.17975 + getValue : function(){ 1.17976 + return this.value; 1.17977 + }, 1.17978 + 1.17979 + 1.17980 + focus : function(){ 1.17981 + if(this.el){ 1.17982 + this.update(this.activeDate); 1.17983 + } 1.17984 + }, 1.17985 + 1.17986 + 1.17987 + onRender : function(container, position){ 1.17988 + var m = [ 1.17989 + '<table cellspacing="0">', 1.17990 + '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'"> </a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'"> </a></td></tr>', 1.17991 + '<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>']; 1.17992 + var dn = this.dayNames; 1.17993 + for(var i = 0; i < 7; i++){ 1.17994 + var d = this.startDay+i; 1.17995 + if(d > 6){ 1.17996 + d = d-7; 1.17997 + } 1.17998 + m.push("<th><span>", dn[d].substr(0,1), "</span></th>"); 1.17999 + } 1.18000 + m[m.length] = "</tr></thead><tbody><tr>"; 1.18001 + for(var i = 0; i < 42; i++) { 1.18002 + if(i % 7 == 0 && i != 0){ 1.18003 + m[m.length] = "</tr><tr>"; 1.18004 + } 1.18005 + m[m.length] = '<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'; 1.18006 + } 1.18007 + m[m.length] = '</tr></tbody></table></td></tr><tr><td colspan="3" class="x-date-bottom" align="center"></td></tr></table><div class="x-date-mp"></div>'; 1.18008 + 1.18009 + var el = document.createElement("div"); 1.18010 + el.className = "x-date-picker"; 1.18011 + el.innerHTML = m.join(""); 1.18012 + 1.18013 + container.dom.insertBefore(el, position); 1.18014 + 1.18015 + this.el = Ext.get(el); 1.18016 + this.eventEl = Ext.get(el.firstChild); 1.18017 + 1.18018 + new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"), { 1.18019 + handler: this.showPrevMonth, 1.18020 + scope: this, 1.18021 + preventDefault:true, 1.18022 + stopDefault:true 1.18023 + }); 1.18024 + 1.18025 + new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"), { 1.18026 + handler: this.showNextMonth, 1.18027 + scope: this, 1.18028 + preventDefault:true, 1.18029 + stopDefault:true 1.18030 + }); 1.18031 + 1.18032 + this.eventEl.on("mousewheel", this.handleMouseWheel, this); 1.18033 + 1.18034 + this.monthPicker = this.el.down('div.x-date-mp'); 1.18035 + this.monthPicker.enableDisplayMode('block'); 1.18036 + 1.18037 + var kn = new Ext.KeyNav(this.eventEl, { 1.18038 + "left" : function(e){ 1.18039 + e.ctrlKey ? 1.18040 + this.showPrevMonth() : 1.18041 + this.update(this.activeDate.add("d", -1)); 1.18042 + }, 1.18043 + 1.18044 + "right" : function(e){ 1.18045 + e.ctrlKey ? 1.18046 + this.showNextMonth() : 1.18047 + this.update(this.activeDate.add("d", 1)); 1.18048 + }, 1.18049 + 1.18050 + "up" : function(e){ 1.18051 + e.ctrlKey ? 1.18052 + this.showNextYear() : 1.18053 + this.update(this.activeDate.add("d", -7)); 1.18054 + }, 1.18055 + 1.18056 + "down" : function(e){ 1.18057 + e.ctrlKey ? 1.18058 + this.showPrevYear() : 1.18059 + this.update(this.activeDate.add("d", 7)); 1.18060 + }, 1.18061 + 1.18062 + "pageUp" : function(e){ 1.18063 + this.showNextMonth(); 1.18064 + }, 1.18065 + 1.18066 + "pageDown" : function(e){ 1.18067 + this.showPrevMonth(); 1.18068 + }, 1.18069 + 1.18070 + "enter" : function(e){ 1.18071 + e.stopPropagation(); 1.18072 + return true; 1.18073 + }, 1.18074 + 1.18075 + scope : this 1.18076 + }); 1.18077 + 1.18078 + this.eventEl.on("click", this.handleDateClick, this, {delegate: "a.x-date-date"}); 1.18079 + 1.18080 + this.eventEl.addKeyListener(Ext.EventObject.SPACE, this.selectToday, this); 1.18081 + 1.18082 + this.el.unselectable(); 1.18083 + 1.18084 + this.cells = this.el.select("table.x-date-inner tbody td"); 1.18085 + this.textNodes = this.el.query("table.x-date-inner tbody span"); 1.18086 + 1.18087 + this.mbtn = new Ext.Button({ 1.18088 + text: " ", 1.18089 + tooltip: this.monthYearText, 1.18090 + renderTo: this.el.child("td.x-date-middle", true) 1.18091 + }); 1.18092 + 1.18093 + this.mbtn.on('click', this.showMonthPicker, this); 1.18094 + this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu"); 1.18095 + 1.18096 + 1.18097 + var today = (new Date()).dateFormat(this.format); 1.18098 + this.todayBtn = new Ext.Button({ 1.18099 + renderTo: this.el.child("td.x-date-bottom", true), 1.18100 + text: String.format(this.todayText, today), 1.18101 + tooltip: String.format(this.todayTip, today), 1.18102 + handler: this.selectToday, 1.18103 + scope: this 1.18104 + }); 1.18105 + 1.18106 + if(Ext.isIE){ 1.18107 + this.el.repaint(); 1.18108 + } 1.18109 + this.update(this.value); 1.18110 + }, 1.18111 + 1.18112 + createMonthPicker : function(){ 1.18113 + if(!this.monthPicker.dom.firstChild){ 1.18114 + var buf = ['<table border="0" cellspacing="0">']; 1.18115 + for(var i = 0; i < 6; i++){ 1.18116 + buf.push( 1.18117 + '<tr><td class="x-date-mp-month"><a href="#">', this.monthNames[i].substr(0, 3), '</a></td>', 1.18118 + '<td class="x-date-mp-month x-date-mp-sep"><a href="#">', this.monthNames[i+6].substr(0, 3), '</a></td>', 1.18119 + i == 0 ? 1.18120 + '<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>' : 1.18121 + '<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>' 1.18122 + ); 1.18123 + } 1.18124 + buf.push( 1.18125 + '<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">', 1.18126 + this.okText, 1.18127 + '</button><button type="button" class="x-date-mp-cancel">', 1.18128 + this.cancelText, 1.18129 + '</button></td></tr>', 1.18130 + '</table>' 1.18131 + ); 1.18132 + this.monthPicker.update(buf.join('')); 1.18133 + this.monthPicker.on('click', this.onMonthClick, this); 1.18134 + this.monthPicker.on('dblclick', this.onMonthDblClick, this); 1.18135 + 1.18136 + this.mpMonths = this.monthPicker.select('td.x-date-mp-month'); 1.18137 + this.mpYears = this.monthPicker.select('td.x-date-mp-year'); 1.18138 + 1.18139 + this.mpMonths.each(function(m, a, i){ 1.18140 + i += 1; 1.18141 + if((i%2) == 0){ 1.18142 + m.dom.xmonth = 5 + Math.round(i * .5); 1.18143 + }else{ 1.18144 + m.dom.xmonth = Math.round((i-1) * .5); 1.18145 + } 1.18146 + }); 1.18147 + } 1.18148 + }, 1.18149 + 1.18150 + showMonthPicker : function(){ 1.18151 + this.createMonthPicker(); 1.18152 + var size = this.el.getSize(); 1.18153 + this.monthPicker.setSize(size); 1.18154 + this.monthPicker.child('table').setSize(size); 1.18155 + 1.18156 + this.mpSelMonth = (this.activeDate || this.value).getMonth(); 1.18157 + this.updateMPMonth(this.mpSelMonth); 1.18158 + this.mpSelYear = (this.activeDate || this.value).getFullYear(); 1.18159 + this.updateMPYear(this.mpSelYear); 1.18160 + 1.18161 + this.monthPicker.slideIn('t', {duration:.2}); 1.18162 + }, 1.18163 + 1.18164 + updateMPYear : function(y){ 1.18165 + this.mpyear = y; 1.18166 + var ys = this.mpYears.elements; 1.18167 + for(var i = 1; i <= 10; i++){ 1.18168 + var td = ys[i-1], y2; 1.18169 + if((i%2) == 0){ 1.18170 + y2 = y + Math.round(i * .5); 1.18171 + td.firstChild.innerHTML = y2; 1.18172 + td.xyear = y2; 1.18173 + }else{ 1.18174 + y2 = y - (5-Math.round(i * .5)); 1.18175 + td.firstChild.innerHTML = y2; 1.18176 + td.xyear = y2; 1.18177 + } 1.18178 + this.mpYears.item(i-1)[y2 == this.mpSelYear ? 'addClass' : 'removeClass']('x-date-mp-sel'); 1.18179 + } 1.18180 + }, 1.18181 + 1.18182 + updateMPMonth : function(sm){ 1.18183 + this.mpMonths.each(function(m, a, i){ 1.18184 + m[m.dom.xmonth == sm ? 'addClass' : 'removeClass']('x-date-mp-sel'); 1.18185 + }); 1.18186 + }, 1.18187 + 1.18188 + selectMPMonth: function(m){ 1.18189 + 1.18190 + }, 1.18191 + 1.18192 + onMonthClick : function(e, t){ 1.18193 + e.stopEvent(); 1.18194 + var el = new Ext.Element(t), pn; 1.18195 + if(el.is('button.x-date-mp-cancel')){ 1.18196 + this.hideMonthPicker(); 1.18197 + } 1.18198 + else if(el.is('button.x-date-mp-ok')){ 1.18199 + var d = new Date(this.mpSelYear, this.mpSelMonth, (this.activeDate || this.value).getDate()); 1.18200 + if(d.getMonth() != this.mpSelMonth){ 1.18201 + 1.18202 + d = new Date(this.mpSelYear, this.mpSelMonth, 1).getLastDateOfMonth(); 1.18203 + } 1.18204 + this.update(d); 1.18205 + this.hideMonthPicker(); 1.18206 + } 1.18207 + else if(pn = el.up('td.x-date-mp-month', 2)){ 1.18208 + this.mpMonths.removeClass('x-date-mp-sel'); 1.18209 + pn.addClass('x-date-mp-sel'); 1.18210 + this.mpSelMonth = pn.dom.xmonth; 1.18211 + } 1.18212 + else if(pn = el.up('td.x-date-mp-year', 2)){ 1.18213 + this.mpYears.removeClass('x-date-mp-sel'); 1.18214 + pn.addClass('x-date-mp-sel'); 1.18215 + this.mpSelYear = pn.dom.xyear; 1.18216 + } 1.18217 + else if(el.is('a.x-date-mp-prev')){ 1.18218 + this.updateMPYear(this.mpyear-10); 1.18219 + } 1.18220 + else if(el.is('a.x-date-mp-next')){ 1.18221 + this.updateMPYear(this.mpyear+10); 1.18222 + } 1.18223 + }, 1.18224 + 1.18225 + onMonthDblClick : function(e, t){ 1.18226 + e.stopEvent(); 1.18227 + var el = new Ext.Element(t), pn; 1.18228 + if(pn = el.up('td.x-date-mp-month', 2)){ 1.18229 + this.update(new Date(this.mpSelYear, pn.dom.xmonth, (this.activeDate || this.value).getDate())); 1.18230 + this.hideMonthPicker(); 1.18231 + } 1.18232 + else if(pn = el.up('td.x-date-mp-year', 2)){ 1.18233 + this.update(new Date(pn.dom.xyear, this.mpSelMonth, (this.activeDate || this.value).getDate())); 1.18234 + this.hideMonthPicker(); 1.18235 + } 1.18236 + }, 1.18237 + 1.18238 + hideMonthPicker : function(disableAnim){ 1.18239 + if(this.monthPicker){ 1.18240 + if(disableAnim === true){ 1.18241 + this.monthPicker.hide(); 1.18242 + }else{ 1.18243 + this.monthPicker.slideOut('t', {duration:.2}); 1.18244 + } 1.18245 + } 1.18246 + }, 1.18247 + 1.18248 + 1.18249 + showPrevMonth : function(e){ 1.18250 + this.update(this.activeDate.add("mo", -1)); 1.18251 + }, 1.18252 + 1.18253 + 1.18254 + showNextMonth : function(e){ 1.18255 + this.update(this.activeDate.add("mo", 1)); 1.18256 + }, 1.18257 + 1.18258 + 1.18259 + showPrevYear : function(){ 1.18260 + this.update(this.activeDate.add("y", -1)); 1.18261 + }, 1.18262 + 1.18263 + 1.18264 + showNextYear : function(){ 1.18265 + this.update(this.activeDate.add("y", 1)); 1.18266 + }, 1.18267 + 1.18268 + 1.18269 + handleMouseWheel : function(e){ 1.18270 + var delta = e.getWheelDelta(); 1.18271 + if(delta > 0){ 1.18272 + this.showPrevMonth(); 1.18273 + e.stopEvent(); 1.18274 + } else if(delta < 0){ 1.18275 + this.showNextMonth(); 1.18276 + e.stopEvent(); 1.18277 + } 1.18278 + }, 1.18279 + 1.18280 + 1.18281 + handleDateClick : function(e, t){ 1.18282 + e.stopEvent(); 1.18283 + if(t.dateValue && !Ext.fly(t.parentNode).hasClass("x-date-disabled")){ 1.18284 + this.setValue(new Date(t.dateValue)); 1.18285 + this.fireEvent("select", this, this.value); 1.18286 + } 1.18287 + }, 1.18288 + 1.18289 + 1.18290 + selectToday : function(){ 1.18291 + this.setValue(new Date().clearTime()); 1.18292 + this.fireEvent("select", this, this.value); 1.18293 + }, 1.18294 + 1.18295 + 1.18296 + update : function(date){ 1.18297 + var vd = this.activeDate; 1.18298 + this.activeDate = date; 1.18299 + if(vd && this.el){ 1.18300 + var t = date.getTime(); 1.18301 + if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){ 1.18302 + this.cells.removeClass("x-date-selected"); 1.18303 + this.cells.each(function(c){ 1.18304 + if(c.dom.firstChild.dateValue == t){ 1.18305 + c.addClass("x-date-selected"); 1.18306 + setTimeout(function(){ 1.18307 + try{c.dom.firstChild.focus();}catch(e){} 1.18308 + }, 50); 1.18309 + return false; 1.18310 + } 1.18311 + }); 1.18312 + return; 1.18313 + } 1.18314 + } 1.18315 + var days = date.getDaysInMonth(); 1.18316 + var firstOfMonth = date.getFirstDateOfMonth(); 1.18317 + var startingPos = firstOfMonth.getDay()-this.startDay; 1.18318 + 1.18319 + if(startingPos <= this.startDay){ 1.18320 + startingPos += 7; 1.18321 + } 1.18322 + 1.18323 + var pm = date.add("mo", -1); 1.18324 + var prevStart = pm.getDaysInMonth()-startingPos; 1.18325 + 1.18326 + var cells = this.cells.elements; 1.18327 + var textEls = this.textNodes; 1.18328 + days += startingPos; 1.18329 + 1.18330 + 1.18331 + var day = 86400000; 1.18332 + var d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart)).clearTime(); 1.18333 + var today = new Date().clearTime().getTime(); 1.18334 + var sel = date.clearTime().getTime(); 1.18335 + var min = this.minDate ? this.minDate.clearTime() : Number.NEGATIVE_INFINITY; 1.18336 + var max = this.maxDate ? this.maxDate.clearTime() : Number.POSITIVE_INFINITY; 1.18337 + var ddMatch = this.disabledDatesRE; 1.18338 + var ddText = this.disabledDatesText; 1.18339 + var ddays = this.disabledDays ? this.disabledDays.join("") : false; 1.18340 + var ddaysText = this.disabledDaysText; 1.18341 + var format = this.format; 1.18342 + 1.18343 + var setCellClass = function(cal, cell){ 1.18344 + cell.title = ""; 1.18345 + var t = d.getTime(); 1.18346 + cell.firstChild.dateValue = t; 1.18347 + if(t == today){ 1.18348 + cell.className += " x-date-today"; 1.18349 + cell.title = cal.todayText; 1.18350 + } 1.18351 + if(t == sel){ 1.18352 + cell.className += " x-date-selected"; 1.18353 + setTimeout(function(){ 1.18354 + try{cell.firstChild.focus();}catch(e){} 1.18355 + }, 50); 1.18356 + } 1.18357 + 1.18358 + if(t < min) { 1.18359 + cell.className = " x-date-disabled"; 1.18360 + cell.title = cal.minText; 1.18361 + return; 1.18362 + } 1.18363 + if(t > max) { 1.18364 + cell.className = " x-date-disabled"; 1.18365 + cell.title = cal.maxText; 1.18366 + return; 1.18367 + } 1.18368 + if(ddays){ 1.18369 + if(ddays.indexOf(d.getDay()) != -1){ 1.18370 + cell.title = ddaysText; 1.18371 + cell.className = " x-date-disabled"; 1.18372 + } 1.18373 + } 1.18374 + if(ddMatch && format){ 1.18375 + var fvalue = d.dateFormat(format); 1.18376 + if(ddMatch.test(fvalue)){ 1.18377 + cell.title = ddText.replace("%0", fvalue); 1.18378 + cell.className = " x-date-disabled"; 1.18379 + } 1.18380 + } 1.18381 + }; 1.18382 + 1.18383 + var i = 0; 1.18384 + for(; i < startingPos; i++) { 1.18385 + textEls[i].innerHTML = (++prevStart); 1.18386 + d.setDate(d.getDate()+1); 1.18387 + cells[i].className = "x-date-prevday"; 1.18388 + setCellClass(this, cells[i]); 1.18389 + } 1.18390 + for(; i < days; i++){ 1.18391 + intDay = i - startingPos + 1; 1.18392 + textEls[i].innerHTML = (intDay); 1.18393 + d.setDate(d.getDate()+1); 1.18394 + cells[i].className = "x-date-active"; 1.18395 + setCellClass(this, cells[i]); 1.18396 + } 1.18397 + var extraDays = 0; 1.18398 + for(; i < 42; i++) { 1.18399 + textEls[i].innerHTML = (++extraDays); 1.18400 + d.setDate(d.getDate()+1); 1.18401 + cells[i].className = "x-date-nextday"; 1.18402 + setCellClass(this, cells[i]); 1.18403 + } 1.18404 + 1.18405 + this.mbtn.setText(this.monthNames[date.getMonth()] + " " + date.getFullYear()); 1.18406 + 1.18407 + if(!this.internalRender){ 1.18408 + var main = this.el.dom.firstChild; 1.18409 + var w = main.offsetWidth; 1.18410 + this.el.setWidth(w + this.el.getBorderWidth("lr")); 1.18411 + Ext.fly(main).setWidth(w); 1.18412 + this.internalRender = true; 1.18413 + 1.18414 + 1.18415 + 1.18416 + if(Ext.isOpera && !this.secondPass){ 1.18417 + main.rows[0].cells[1].style.width = (w - (main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth)) + "px"; 1.18418 + this.secondPass = true; 1.18419 + this.update.defer(10, this, [date]); 1.18420 + } 1.18421 + } 1.18422 + }, 1.18423 + 1.18424 + 1.18425 + beforeDestroy : function() { 1.18426 + if(this.rendered){ 1.18427 + this.mbtn.destroy(); 1.18428 + this.todayBtn.destroy(); 1.18429 + } 1.18430 + } 1.18431 + 1.18432 + 1.18433 +}); 1.18434 +Ext.reg('datepicker', Ext.DatePicker); 1.18435 + 1.18436 +Ext.TabPanel = Ext.extend(Ext.Panel, { 1.18437 + 1.18438 + 1.18439 + monitorResize : true, 1.18440 + 1.18441 + deferredRender : true, 1.18442 + 1.18443 + tabWidth: 120, 1.18444 + 1.18445 + minTabWidth: 30, 1.18446 + 1.18447 + resizeTabs:false, 1.18448 + 1.18449 + enableTabScroll: false, 1.18450 + 1.18451 + scrollIncrement : 0, 1.18452 + 1.18453 + scrollRepeatInterval : 400, 1.18454 + 1.18455 + scrollDuration : .35, 1.18456 + 1.18457 + animScroll : true, 1.18458 + 1.18459 + tabPosition: 'top', 1.18460 + 1.18461 + baseCls: 'x-tab-panel', 1.18462 + 1.18463 + autoTabs : false, 1.18464 + 1.18465 + autoTabSelector:'div.x-tab', 1.18466 + 1.18467 + activeTab : null, 1.18468 + 1.18469 + tabMargin : 2, 1.18470 + 1.18471 + plain: false, 1.18472 + 1.18473 + wheelIncrement : 20, 1.18474 + 1.18475 + 1.18476 + idDelimiter : '__', 1.18477 + 1.18478 + itemCls : 'x-tab-item', 1.18479 + 1.18480 + elements: 'body', 1.18481 + headerAsText: false, 1.18482 + frame: false, 1.18483 + hideBorders:true, 1.18484 + 1.18485 + initComponent : function(){ 1.18486 + this.frame = false; 1.18487 + Ext.TabPanel.superclass.initComponent.call(this); 1.18488 + this.addEvents( 1.18489 + 1.18490 + 'beforetabchange', 1.18491 + 1.18492 + 'tabchange', 1.18493 + 1.18494 + 'contextmenu' 1.18495 + ); 1.18496 + this.setLayout(new Ext.layout.CardLayout({ 1.18497 + deferredRender: this.deferredRender 1.18498 + })); 1.18499 + if(this.tabPosition == 'top'){ 1.18500 + this.elements += ',header'; 1.18501 + this.stripTarget = 'header'; 1.18502 + }else { 1.18503 + this.elements += ',footer'; 1.18504 + this.stripTarget = 'footer'; 1.18505 + } 1.18506 + if(!this.stack){ 1.18507 + this.stack = Ext.TabPanel.AccessStack(); 1.18508 + } 1.18509 + this.initItems(); 1.18510 + }, 1.18511 + 1.18512 + render : function(){ 1.18513 + Ext.TabPanel.superclass.render.apply(this, arguments); 1.18514 + if(this.activeTab !== undefined){ 1.18515 + var item = this.activeTab; 1.18516 + delete this.activeTab; 1.18517 + this.setActiveTab(item); 1.18518 + } 1.18519 + }, 1.18520 + 1.18521 + onRender : function(ct, position){ 1.18522 + Ext.TabPanel.superclass.onRender.call(this, ct, position); 1.18523 + 1.18524 + if(this.plain){ 1.18525 + var pos = this.tabPosition == 'top' ? 'header' : 'footer'; 1.18526 + this[pos].addClass('x-tab-panel-'+pos+'-plain'); 1.18527 + } 1.18528 + 1.18529 + var st = this[this.stripTarget]; 1.18530 + 1.18531 + this.stripWrap = st.createChild({cls:'x-tab-strip-wrap', cn:{ 1.18532 + tag:'ul', cls:'x-tab-strip x-tab-strip-'+this.tabPosition}}); 1.18533 + this.stripSpacer = st.createChild({cls:'x-tab-strip-spacer'}); 1.18534 + this.strip = new Ext.Element(this.stripWrap.dom.firstChild); 1.18535 + 1.18536 + this.edge = this.strip.createChild({tag:'li', cls:'x-tab-edge'}); 1.18537 + this.strip.createChild({cls:'x-clear'}); 1.18538 + 1.18539 + this.body.addClass('x-tab-panel-body-'+this.tabPosition); 1.18540 + 1.18541 + if(!this.itemTpl){ 1.18542 + var tt = new Ext.Template( 1.18543 + '<li class="{cls}" id="{id}"><a class="x-tab-strip-close" onclick="return false;"></a>', 1.18544 + '<a class="x-tab-right" href="#" onclick="return false;"><em class="x-tab-left">', 1.18545 + '<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>', 1.18546 + '</em></a></li>' 1.18547 + ); 1.18548 + tt.disableFormats = true; 1.18549 + tt.compile(); 1.18550 + Ext.TabPanel.prototype.itemTpl = tt; 1.18551 + } 1.18552 + 1.18553 + this.items.each(this.initTab, this); 1.18554 + }, 1.18555 + 1.18556 + afterRender : function(){ 1.18557 + Ext.TabPanel.superclass.afterRender.call(this); 1.18558 + if(this.autoTabs){ 1.18559 + this.readTabs(false); 1.18560 + } 1.18561 + }, 1.18562 + 1.18563 + initEvents : function(){ 1.18564 + Ext.TabPanel.superclass.initEvents.call(this); 1.18565 + this.on('add', this.onAdd, this); 1.18566 + this.on('remove', this.onRemove, this); 1.18567 + 1.18568 + this.strip.on('mousedown', this.onStripMouseDown, this); 1.18569 + this.strip.on('click', this.onStripClick, this); 1.18570 + this.strip.on('contextmenu', this.onStripContextMenu, this); 1.18571 + if(this.enableTabScroll){ 1.18572 + this.strip.on('mousewheel', this.onWheel, this); 1.18573 + } 1.18574 + }, 1.18575 + 1.18576 + findTargets : function(e){ 1.18577 + var item = null; 1.18578 + var itemEl = e.getTarget('li', this.strip); 1.18579 + if(itemEl){ 1.18580 + item = this.getComponent(itemEl.id.split(this.idDelimiter)[1]); 1.18581 + if(item.disabled){ 1.18582 + return { 1.18583 + close : null, 1.18584 + item : null, 1.18585 + el : null 1.18586 + }; 1.18587 + } 1.18588 + } 1.18589 + return { 1.18590 + close : e.getTarget('.x-tab-strip-close', this.strip), 1.18591 + item : item, 1.18592 + el : itemEl 1.18593 + }; 1.18594 + }, 1.18595 + 1.18596 + onStripMouseDown : function(e){ 1.18597 + e.preventDefault(); 1.18598 + if(e.button != 0){ 1.18599 + return; 1.18600 + } 1.18601 + var t = this.findTargets(e); 1.18602 + if(t.close){ 1.18603 + this.remove(t.item); 1.18604 + return; 1.18605 + } 1.18606 + if(t.item && t.item != this.activeTab){ 1.18607 + this.setActiveTab(t.item); 1.18608 + } 1.18609 + }, 1.18610 + 1.18611 + onStripClick : function(e){ 1.18612 + var t = this.findTargets(e); 1.18613 + if(!t.close && t.item && t.item != this.activeTab){ 1.18614 + this.setActiveTab(t.item); 1.18615 + } 1.18616 + }, 1.18617 + 1.18618 + onStripContextMenu : function(e){ 1.18619 + e.preventDefault(); 1.18620 + var t = this.findTargets(e); 1.18621 + if(t.item){ 1.18622 + this.fireEvent('contextmenu', this, t.item, e); 1.18623 + } 1.18624 + }, 1.18625 + 1.18626 + 1.18627 + readTabs : function(removeExisting){ 1.18628 + if(removeExisting === true){ 1.18629 + this.items.each(function(item){ 1.18630 + this.remove(item); 1.18631 + }, this); 1.18632 + } 1.18633 + var tabs = this.el.query(this.autoTabSelector); 1.18634 + for(var i = 0, len = tabs.length; i < len; i++){ 1.18635 + var tab = tabs[i]; 1.18636 + var title = tab.getAttribute('title'); 1.18637 + tab.removeAttribute('title'); 1.18638 + this.add({ 1.18639 + title: title, 1.18640 + el: tab 1.18641 + }); 1.18642 + } 1.18643 + }, 1.18644 + 1.18645 + initTab : function(item, index){ 1.18646 + var before = this.strip.dom.childNodes[index]; 1.18647 + var cls = item.closable ? 'x-tab-strip-closable' : ''; 1.18648 + if(item.disabled){ 1.18649 + cls += ' x-item-disabled'; 1.18650 + } 1.18651 + if(item.iconCls){ 1.18652 + cls += ' x-tab-with-icon'; 1.18653 + } 1.18654 + if(item.tabCls){ 1.18655 + cls += ' ' + item.tabCls; 1.18656 + } 1.18657 + 1.18658 + var p = { 1.18659 + id: this.id + this.idDelimiter + item.getItemId(), 1.18660 + text: item.title, 1.18661 + cls: cls, 1.18662 + iconCls: item.iconCls || '' 1.18663 + }; 1.18664 + var el = before ? 1.18665 + this.itemTpl.insertBefore(before, p) : 1.18666 + this.itemTpl.append(this.strip, p); 1.18667 + 1.18668 + Ext.fly(el).addClassOnOver('x-tab-strip-over'); 1.18669 + 1.18670 + if(item.tabTip){ 1.18671 + Ext.fly(el).child('span.x-tab-strip-text', true).qtip = item.tabTip; 1.18672 + } 1.18673 + item.on('disable', this.onItemDisabled, this); 1.18674 + item.on('enable', this.onItemEnabled, this); 1.18675 + item.on('titlechange', this.onItemTitleChanged, this); 1.18676 + item.on('beforeshow', this.onBeforeShowItem, this); 1.18677 + }, 1.18678 + 1.18679 + onAdd : function(tp, item, index){ 1.18680 + this.initTab(item, index); 1.18681 + if(this.items.getCount() == 1){ 1.18682 + this.syncSize(); 1.18683 + } 1.18684 + this.delegateUpdates(); 1.18685 + }, 1.18686 + 1.18687 + onBeforeAdd : function(item){ 1.18688 + var existing = item.events ? (this.items.containsKey(item.getItemId()) ? item : null) : this.items.get(item); 1.18689 + if(existing){ 1.18690 + this.setActiveTab(item); 1.18691 + return false; 1.18692 + } 1.18693 + Ext.TabPanel.superclass.onBeforeAdd.apply(this, arguments); 1.18694 + var es = item.elements; 1.18695 + item.elements = es ? es.replace(',header', '') : es; 1.18696 + item.border = (item.border === true); 1.18697 + }, 1.18698 + 1.18699 + onRemove : function(tp, item){ 1.18700 + Ext.removeNode(this.getTabEl(item)); 1.18701 + this.stack.remove(item); 1.18702 + item.un('disable', this.onItemDisabled, this); 1.18703 + item.un('enable', this.onItemEnabled, this); 1.18704 + item.un('titlechange', this.onItemTitleChanged, this); 1.18705 + item.un('beforeshow', this.onBeforeShowItem, this); 1.18706 + if(item == this.activeTab){ 1.18707 + var next = this.stack.next(); 1.18708 + if(next){ 1.18709 + this.setActiveTab(next); 1.18710 + }else{ 1.18711 + this.setActiveTab(0); 1.18712 + } 1.18713 + } 1.18714 + this.delegateUpdates(); 1.18715 + }, 1.18716 + 1.18717 + onBeforeShowItem : function(item){ 1.18718 + if(item != this.activeTab){ 1.18719 + this.setActiveTab(item); 1.18720 + return false; 1.18721 + } 1.18722 + }, 1.18723 + 1.18724 + onItemDisabled : function(item){ 1.18725 + var el = this.getTabEl(item); 1.18726 + if(el){ 1.18727 + Ext.fly(el).addClass('x-item-disabled'); 1.18728 + } 1.18729 + this.stack.remove(item); 1.18730 + }, 1.18731 + 1.18732 + onItemEnabled : function(item){ 1.18733 + var el = this.getTabEl(item); 1.18734 + if(el){ 1.18735 + Ext.fly(el).removeClass('x-item-disabled'); 1.18736 + } 1.18737 + }, 1.18738 + 1.18739 + onItemTitleChanged : function(item){ 1.18740 + var el = this.getTabEl(item); 1.18741 + if(el){ 1.18742 + Ext.fly(el).child('span.x-tab-strip-text', true).innerHTML = item.title; 1.18743 + } 1.18744 + }, 1.18745 + 1.18746 + 1.18747 + getTabEl : function(item){ 1.18748 + var itemId = (typeof item === 'number')?this.items.items[item].getItemId() : item.getItemId(); 1.18749 + return document.getElementById(this.id+this.idDelimiter+itemId); 1.18750 + }, 1.18751 + 1.18752 + onResize : function(){ 1.18753 + Ext.TabPanel.superclass.onResize.apply(this, arguments); 1.18754 + this.delegateUpdates(); 1.18755 + }, 1.18756 + 1.18757 + 1.18758 + beginUpdate : function(){ 1.18759 + this.suspendUpdates = true; 1.18760 + }, 1.18761 + 1.18762 + 1.18763 + endUpdate : function(){ 1.18764 + this.suspendUpdates = false; 1.18765 + this.delegateUpdates(); 1.18766 + }, 1.18767 + 1.18768 + 1.18769 + hideTabStripItem : function(item){ 1.18770 + item = this.getComponent(item); 1.18771 + var el = this.getTabEl(item); 1.18772 + if(el){ 1.18773 + el.style.display = 'none'; 1.18774 + this.delegateUpdates(); 1.18775 + } 1.18776 + this.stack.remove(item); 1.18777 + }, 1.18778 + 1.18779 + 1.18780 + unhideTabStripItem : function(item){ 1.18781 + item = this.getComponent(item); 1.18782 + var el = this.getTabEl(item); 1.18783 + if(el){ 1.18784 + el.style.display = ''; 1.18785 + this.delegateUpdates(); 1.18786 + } 1.18787 + }, 1.18788 + 1.18789 + delegateUpdates : function(){ 1.18790 + if(this.suspendUpdates){ 1.18791 + return; 1.18792 + } 1.18793 + if(this.resizeTabs && this.rendered){ 1.18794 + this.autoSizeTabs(); 1.18795 + } 1.18796 + if(this.enableTabScroll && this.rendered){ 1.18797 + this.autoScrollTabs(); 1.18798 + } 1.18799 + }, 1.18800 + 1.18801 + autoSizeTabs : function(){ 1.18802 + var count = this.items.length; 1.18803 + var ce = this.tabPosition != 'bottom' ? 'header' : 'footer'; 1.18804 + var ow = this[ce].dom.offsetWidth; 1.18805 + var aw = this[ce].dom.clientWidth; 1.18806 + 1.18807 + if(!this.resizeTabs || count < 1 || !aw){ return; 1.18808 + } 1.18809 + 1.18810 + var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); this.lastTabWidth = each; 1.18811 + var lis = this.stripWrap.dom.getElementsByTagName('li'); 1.18812 + for(var i = 0, len = lis.length-1; i < len; i++) { var li = lis[i]; 1.18813 + var inner = li.childNodes[1].firstChild.firstChild; 1.18814 + var tw = li.offsetWidth; 1.18815 + var iw = inner.offsetWidth; 1.18816 + inner.style.width = (each - (tw-iw)) + 'px'; 1.18817 + } 1.18818 + }, 1.18819 + 1.18820 + adjustBodyWidth : function(w){ 1.18821 + if(this.header){ 1.18822 + this.header.setWidth(w); 1.18823 + } 1.18824 + if(this.footer){ 1.18825 + this.footer.setWidth(w); 1.18826 + } 1.18827 + return w; 1.18828 + }, 1.18829 + 1.18830 + 1.18831 + setActiveTab : function(item){ 1.18832 + item = this.getComponent(item); 1.18833 + if(!item || this.fireEvent('beforetabchange', this, item, this.activeTab) === false){ 1.18834 + return; 1.18835 + } 1.18836 + if(!this.rendered){ 1.18837 + this.activeTab = item; 1.18838 + return; 1.18839 + } 1.18840 + if(this.activeTab != item){ 1.18841 + if(this.activeTab){ 1.18842 + var oldEl = this.getTabEl(this.activeTab); 1.18843 + if(oldEl){ 1.18844 + Ext.fly(oldEl).removeClass('x-tab-strip-active'); 1.18845 + } 1.18846 + this.activeTab.fireEvent('deactivate', this.activeTab); 1.18847 + } 1.18848 + var el = this.getTabEl(item); 1.18849 + Ext.fly(el).addClass('x-tab-strip-active'); 1.18850 + this.activeTab = item; 1.18851 + this.stack.add(item); 1.18852 + 1.18853 + this.layout.setActiveItem(item); 1.18854 + if(this.layoutOnTabChange && item.doLayout){ 1.18855 + item.doLayout(); 1.18856 + } 1.18857 + if(this.scrolling){ 1.18858 + this.scrollToTab(item, this.animScroll); 1.18859 + } 1.18860 + 1.18861 + item.fireEvent('activate', item); 1.18862 + this.fireEvent('tabchange', this, item); 1.18863 + } 1.18864 + }, 1.18865 + 1.18866 + 1.18867 + getActiveTab : function(){ 1.18868 + return this.activeTab || null; 1.18869 + }, 1.18870 + 1.18871 + 1.18872 + getItem : function(item){ 1.18873 + return this.getComponent(item); 1.18874 + }, 1.18875 + 1.18876 + autoScrollTabs : function(){ 1.18877 + var count = this.items.length; 1.18878 + var ow = this.header.dom.offsetWidth; 1.18879 + var tw = this.header.dom.clientWidth; 1.18880 + 1.18881 + var wrap = this.stripWrap; 1.18882 + var wd = wrap.dom; 1.18883 + var cw = wd.offsetWidth; 1.18884 + var pos = this.getScrollPos(); 1.18885 + var l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos; 1.18886 + 1.18887 + if(!this.enableTabScroll || count < 1 || cw < 20){ return; 1.18888 + } 1.18889 + if(l <= tw){ 1.18890 + wd.scrollLeft = 0; 1.18891 + wrap.setWidth(tw); 1.18892 + if(this.scrolling){ 1.18893 + this.scrolling = false; 1.18894 + this.header.removeClass('x-tab-scrolling'); 1.18895 + this.scrollLeft.hide(); 1.18896 + this.scrollRight.hide(); 1.18897 + if(Ext.isAir){ 1.18898 + wd.style.marginLeft = ''; 1.18899 + wd.style.marginRight = ''; 1.18900 + } 1.18901 + } 1.18902 + }else{ 1.18903 + if(!this.scrolling){ 1.18904 + this.header.addClass('x-tab-scrolling'); 1.18905 + if(Ext.isAir){ 1.18906 + wd.style.marginLeft = '18px'; 1.18907 + wd.style.marginRight = '18px'; 1.18908 + } 1.18909 + } 1.18910 + tw -= wrap.getMargins('lr'); 1.18911 + wrap.setWidth(tw > 20 ? tw : 20); 1.18912 + if(!this.scrolling){ 1.18913 + if(!this.scrollLeft){ 1.18914 + this.createScrollers(); 1.18915 + }else{ 1.18916 + this.scrollLeft.show(); 1.18917 + this.scrollRight.show(); 1.18918 + } 1.18919 + } 1.18920 + this.scrolling = true; 1.18921 + if(pos > (l-tw)){ wd.scrollLeft = l-tw; 1.18922 + }else{ this.scrollToTab(this.activeTab, false); 1.18923 + } 1.18924 + this.updateScrollButtons(); 1.18925 + } 1.18926 + }, 1.18927 + 1.18928 + createScrollers : function(){ 1.18929 + var h = this.stripWrap.dom.offsetHeight; 1.18930 + 1.18931 + var sl = this.header.insertFirst({ 1.18932 + cls:'x-tab-scroller-left' 1.18933 + }); 1.18934 + sl.setHeight(h); 1.18935 + sl.addClassOnOver('x-tab-scroller-left-over'); 1.18936 + this.leftRepeater = new Ext.util.ClickRepeater(sl, { 1.18937 + interval : this.scrollRepeatInterval, 1.18938 + handler: this.onScrollLeft, 1.18939 + scope: this 1.18940 + }); 1.18941 + this.scrollLeft = sl; 1.18942 + 1.18943 + var sr = this.header.insertFirst({ 1.18944 + cls:'x-tab-scroller-right' 1.18945 + }); 1.18946 + sr.setHeight(h); 1.18947 + sr.addClassOnOver('x-tab-scroller-right-over'); 1.18948 + this.rightRepeater = new Ext.util.ClickRepeater(sr, { 1.18949 + interval : this.scrollRepeatInterval, 1.18950 + handler: this.onScrollRight, 1.18951 + scope: this 1.18952 + }); 1.18953 + this.scrollRight = sr; 1.18954 + }, 1.18955 + 1.18956 + getScrollWidth : function(){ 1.18957 + return this.edge.getOffsetsTo(this.stripWrap)[0] + this.getScrollPos(); 1.18958 + }, 1.18959 + 1.18960 + getScrollPos : function(){ 1.18961 + return parseInt(this.stripWrap.dom.scrollLeft, 10) || 0; 1.18962 + }, 1.18963 + 1.18964 + getScrollArea : function(){ 1.18965 + return parseInt(this.stripWrap.dom.clientWidth, 10) || 0; 1.18966 + }, 1.18967 + 1.18968 + getScrollAnim : function(){ 1.18969 + return {duration:this.scrollDuration, callback: this.updateScrollButtons, scope: this}; 1.18970 + }, 1.18971 + 1.18972 + getScrollIncrement : function(){ 1.18973 + return this.scrollIncrement || (this.resizeTabs ? this.lastTabWidth+2 : 100); 1.18974 + }, 1.18975 + 1.18976 + 1.18977 + 1.18978 + scrollToTab : function(item, animate){ 1.18979 + if(!item){ return; } 1.18980 + var el = this.getTabEl(item); 1.18981 + var pos = this.getScrollPos(), area = this.getScrollArea(); 1.18982 + var left = Ext.fly(el).getOffsetsTo(this.stripWrap)[0] + pos; 1.18983 + var right = left + el.offsetWidth; 1.18984 + if(left < pos){ 1.18985 + this.scrollTo(left, animate); 1.18986 + }else if(right > (pos + area)){ 1.18987 + this.scrollTo(right - area, animate); 1.18988 + } 1.18989 + }, 1.18990 + 1.18991 + scrollTo : function(pos, animate){ 1.18992 + this.stripWrap.scrollTo('left', pos, animate ? this.getScrollAnim() : false); 1.18993 + if(!animate){ 1.18994 + this.updateScrollButtons(); 1.18995 + } 1.18996 + }, 1.18997 + 1.18998 + onWheel : function(e){ 1.18999 + var d = e.getWheelDelta()*this.wheelIncrement*-1; 1.19000 + e.stopEvent(); 1.19001 + 1.19002 + var pos = this.getScrollPos(); 1.19003 + var newpos = pos + d; 1.19004 + var sw = this.getScrollWidth()-this.getScrollArea(); 1.19005 + 1.19006 + var s = Math.max(0, Math.min(sw, newpos)); 1.19007 + if(s != pos){ 1.19008 + this.scrollTo(s, false); 1.19009 + } 1.19010 + }, 1.19011 + 1.19012 + onScrollRight : function(){ 1.19013 + var sw = this.getScrollWidth()-this.getScrollArea(); 1.19014 + var pos = this.getScrollPos(); 1.19015 + var s = Math.min(sw, pos + this.getScrollIncrement()); 1.19016 + if(s != pos){ 1.19017 + this.scrollTo(s, this.animScroll); 1.19018 + } 1.19019 + }, 1.19020 + 1.19021 + onScrollLeft : function(){ 1.19022 + var pos = this.getScrollPos(); 1.19023 + var s = Math.max(0, pos - this.getScrollIncrement()); 1.19024 + if(s != pos){ 1.19025 + this.scrollTo(s, this.animScroll); 1.19026 + } 1.19027 + }, 1.19028 + 1.19029 + updateScrollButtons : function(){ 1.19030 + var pos = this.getScrollPos(); 1.19031 + this.scrollLeft[pos == 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled'); 1.19032 + this.scrollRight[pos >= (this.getScrollWidth()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled'); 1.19033 + } 1.19034 + 1.19035 + 1.19036 + 1.19037 + 1.19038 + 1.19039 + 1.19040 + 1.19041 + 1.19042 + 1.19043 + 1.19044 + 1.19045 + 1.19046 + 1.19047 +}); 1.19048 +Ext.reg('tabpanel', Ext.TabPanel); 1.19049 + 1.19050 + 1.19051 +Ext.TabPanel.prototype.activate = Ext.TabPanel.prototype.setActiveTab; 1.19052 + 1.19053 +Ext.TabPanel.AccessStack = function(){ 1.19054 + var items = []; 1.19055 + return { 1.19056 + add : function(item){ 1.19057 + items.push(item); 1.19058 + if(items.length > 10){ 1.19059 + items.shift(); 1.19060 + } 1.19061 + }, 1.19062 + 1.19063 + remove : function(item){ 1.19064 + var s = []; 1.19065 + for(var i = 0, len = items.length; i < len; i++) { 1.19066 + if(items[i] != item){ 1.19067 + s.push(items[i]); 1.19068 + } 1.19069 + } 1.19070 + items = s; 1.19071 + }, 1.19072 + 1.19073 + next : function(){ 1.19074 + return items.pop(); 1.19075 + } 1.19076 + }; 1.19077 +}; 1.19078 + 1.19079 + 1.19080 + 1.19081 + 1.19082 +Ext.Button = Ext.extend(Ext.Component, { 1.19083 + 1.19084 + hidden : false, 1.19085 + 1.19086 + disabled : false, 1.19087 + 1.19088 + pressed : false, 1.19089 + 1.19090 + 1.19091 + 1.19092 + 1.19093 + 1.19094 + 1.19095 + 1.19096 + enableToggle: false, 1.19097 + 1.19098 + 1.19099 + 1.19100 + menuAlign : "tl-bl?", 1.19101 + 1.19102 + 1.19103 + 1.19104 + type : 'button', 1.19105 + 1.19106 + menuClassTarget: 'tr', 1.19107 + 1.19108 + 1.19109 + clickEvent : 'click', 1.19110 + 1.19111 + 1.19112 + handleMouseEvents : true, 1.19113 + 1.19114 + 1.19115 + tooltipType : 'qtip', 1.19116 + 1.19117 + buttonSelector : "button:first", 1.19118 + 1.19119 + 1.19120 + 1.19121 + 1.19122 + initComponent : function(){ 1.19123 + Ext.Button.superclass.initComponent.call(this); 1.19124 + 1.19125 + this.addEvents( 1.19126 + 1.19127 + "click", 1.19128 + 1.19129 + "toggle", 1.19130 + 1.19131 + 'mouseover', 1.19132 + 1.19133 + 'mouseout', 1.19134 + 1.19135 + 'menushow', 1.19136 + 1.19137 + 'menuhide', 1.19138 + 1.19139 + 'menutriggerover', 1.19140 + 1.19141 + 'menutriggerout' 1.19142 + ); 1.19143 + if(this.menu){ 1.19144 + this.menu = Ext.menu.MenuMgr.get(this.menu); 1.19145 + } 1.19146 + if(typeof this.toggleGroup === 'string'){ 1.19147 + this.enableToggle = true; 1.19148 + } 1.19149 + }, 1.19150 + 1.19151 + onRender : function(ct, position){ 1.19152 + if(!this.template){ 1.19153 + if(!Ext.Button.buttonTemplate){ 1.19154 + Ext.Button.buttonTemplate = new Ext.Template( 1.19155 + '<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>', 1.19156 + '<td class="x-btn-left"><i> </i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i> </i></td>', 1.19157 + "</tr></tbody></table>"); 1.19158 + } 1.19159 + this.template = Ext.Button.buttonTemplate; 1.19160 + } 1.19161 + var btn, targs = [this.text || ' ', this.type]; 1.19162 + 1.19163 + if(position){ 1.19164 + btn = this.template.insertBefore(position, targs, true); 1.19165 + }else{ 1.19166 + btn = this.template.append(ct, targs, true); 1.19167 + } 1.19168 + var btnEl = btn.child(this.buttonSelector); 1.19169 + btnEl.on('focus', this.onFocus, this); 1.19170 + btnEl.on('blur', this.onBlur, this); 1.19171 + 1.19172 + this.initButtonEl(btn, btnEl); 1.19173 + 1.19174 + if(this.menu){ 1.19175 + this.el.child(this.menuClassTarget).addClass("x-btn-with-menu"); 1.19176 + } 1.19177 + Ext.ButtonToggleMgr.register(this); 1.19178 + }, 1.19179 + 1.19180 + initButtonEl : function(btn, btnEl){ 1.19181 + 1.19182 + this.el = btn; 1.19183 + btn.addClass("x-btn"); 1.19184 + 1.19185 + if(this.icon){ 1.19186 + btnEl.setStyle('background-image', 'url(' +this.icon +')'); 1.19187 + } 1.19188 + if(this.iconCls){ 1.19189 + btnEl.addClass(this.iconCls); 1.19190 + if(!this.cls){ 1.19191 + btn.addClass(this.text ? 'x-btn-text-icon' : 'x-btn-icon'); 1.19192 + } 1.19193 + } 1.19194 + if(this.tabIndex !== undefined){ 1.19195 + btnEl.dom.tabIndex = this.tabIndex; 1.19196 + } 1.19197 + if(this.tooltip){ 1.19198 + if(typeof this.tooltip == 'object'){ 1.19199 + Ext.QuickTips.register(Ext.apply({ 1.19200 + target: btnEl.id 1.19201 + }, this.tooltip)); 1.19202 + } else { 1.19203 + btnEl.dom[this.tooltipType] = this.tooltip; 1.19204 + } 1.19205 + } 1.19206 + 1.19207 + if(this.pressed){ 1.19208 + this.el.addClass("x-btn-pressed"); 1.19209 + } 1.19210 + 1.19211 + if(this.handleMouseEvents){ 1.19212 + btn.on("mouseover", this.onMouseOver, this); 1.19213 + btn.on("mousedown", this.onMouseDown, this); 1.19214 + } 1.19215 + 1.19216 + if(this.menu){ 1.19217 + this.menu.on("show", this.onMenuShow, this); 1.19218 + this.menu.on("hide", this.onMenuHide, this); 1.19219 + } 1.19220 + 1.19221 + if(this.id){ 1.19222 + this.el.dom.id = this.el.id = this.id; 1.19223 + } 1.19224 + 1.19225 + if(this.repeat){ 1.19226 + var repeater = new Ext.util.ClickRepeater(btn, 1.19227 + typeof this.repeat == "object" ? this.repeat : {} 1.19228 + ); 1.19229 + repeater.on("click", this.onClick, this); 1.19230 + } 1.19231 + 1.19232 + btn.on(this.clickEvent, this.onClick, this); 1.19233 + }, 1.19234 + 1.19235 + afterRender : function(){ 1.19236 + Ext.Button.superclass.afterRender.call(this); 1.19237 + if(Ext.isIE6){ 1.19238 + this.autoWidth.defer(1, this); 1.19239 + }else{ 1.19240 + this.autoWidth(); 1.19241 + } 1.19242 + }, 1.19243 + 1.19244 + 1.19245 + setIconClass : function(cls){ 1.19246 + if(this.el){ 1.19247 + this.el.child(this.buttonSelector).replaceClass(this.iconCls, cls); 1.19248 + } 1.19249 + this.iconCls = cls; 1.19250 + }, 1.19251 + 1.19252 + beforeDestroy: function(){ 1.19253 + if(this.rendered){ 1.19254 + var btn = this.el.child(this.buttonSelector); 1.19255 + if(btn){ 1.19256 + btn.removeAllListeners(); 1.19257 + } 1.19258 + } 1.19259 + if(this.menu){ 1.19260 + Ext.destroy(this.menu); 1.19261 + } 1.19262 + }, 1.19263 + 1.19264 + onDestroy : function(){ 1.19265 + if(this.rendered){ 1.19266 + Ext.ButtonToggleMgr.unregister(this); 1.19267 + } 1.19268 + }, 1.19269 + 1.19270 + autoWidth : function(){ 1.19271 + if(this.el){ 1.19272 + this.el.setWidth("auto"); 1.19273 + if(Ext.isIE7 && Ext.isStrict){ 1.19274 + var ib = this.el.child(this.buttonSelector); 1.19275 + if(ib && ib.getWidth() > 20){ 1.19276 + ib.clip(); 1.19277 + ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr')); 1.19278 + } 1.19279 + } 1.19280 + if(this.minWidth){ 1.19281 + if(this.el.getWidth() < this.minWidth){ 1.19282 + this.el.setWidth(this.minWidth); 1.19283 + } 1.19284 + } 1.19285 + } 1.19286 + }, 1.19287 + 1.19288 + 1.19289 + setHandler : function(handler, scope){ 1.19290 + this.handler = handler; 1.19291 + this.scope = scope; 1.19292 + }, 1.19293 + 1.19294 + 1.19295 + setText : function(text){ 1.19296 + this.text = text; 1.19297 + if(this.el){ 1.19298 + this.el.child("td.x-btn-center " + this.buttonSelector).update(text); 1.19299 + } 1.19300 + this.autoWidth(); 1.19301 + }, 1.19302 + 1.19303 + 1.19304 + getText : function(){ 1.19305 + return this.text; 1.19306 + }, 1.19307 + 1.19308 + 1.19309 + toggle : function(state){ 1.19310 + state = state === undefined ? !this.pressed : state; 1.19311 + if(state != this.pressed){ 1.19312 + if(state){ 1.19313 + this.el.addClass("x-btn-pressed"); 1.19314 + this.pressed = true; 1.19315 + this.fireEvent("toggle", this, true); 1.19316 + }else{ 1.19317 + this.el.removeClass("x-btn-pressed"); 1.19318 + this.pressed = false; 1.19319 + this.fireEvent("toggle", this, false); 1.19320 + } 1.19321 + if(this.toggleHandler){ 1.19322 + this.toggleHandler.call(this.scope || this, this, state); 1.19323 + } 1.19324 + } 1.19325 + }, 1.19326 + 1.19327 + 1.19328 + focus : function(){ 1.19329 + this.el.child(this.buttonSelector).focus(); 1.19330 + }, 1.19331 + 1.19332 + onDisable : function(){ 1.19333 + if(this.el){ 1.19334 + if(!Ext.isIE6 || !this.text){ 1.19335 + this.el.addClass(this.disabledClass); 1.19336 + } 1.19337 + this.el.dom.disabled = true; 1.19338 + } 1.19339 + this.disabled = true; 1.19340 + }, 1.19341 + 1.19342 + onEnable : function(){ 1.19343 + if(this.el){ 1.19344 + if(!Ext.isIE6 || !this.text){ 1.19345 + this.el.removeClass(this.disabledClass); 1.19346 + } 1.19347 + this.el.dom.disabled = false; 1.19348 + } 1.19349 + this.disabled = false; 1.19350 + }, 1.19351 + 1.19352 + 1.19353 + showMenu : function(){ 1.19354 + if(this.menu){ 1.19355 + this.menu.show(this.el, this.menuAlign); 1.19356 + } 1.19357 + return this; 1.19358 + }, 1.19359 + 1.19360 + 1.19361 + hideMenu : function(){ 1.19362 + if(this.menu){ 1.19363 + this.menu.hide(); 1.19364 + } 1.19365 + return this; 1.19366 + }, 1.19367 + 1.19368 + 1.19369 + hasVisibleMenu : function(){ 1.19370 + return this.menu && this.menu.isVisible(); 1.19371 + }, 1.19372 + 1.19373 + onClick : function(e){ 1.19374 + if(e){ 1.19375 + e.preventDefault(); 1.19376 + } 1.19377 + if(e.button != 0){ 1.19378 + return; 1.19379 + } 1.19380 + if(!this.disabled){ 1.19381 + if(this.enableToggle && (this.allowDepress !== false || !this.pressed)){ 1.19382 + this.toggle(); 1.19383 + } 1.19384 + if(this.menu && !this.menu.isVisible() && !this.ignoreNextClick){ 1.19385 + this.showMenu(); 1.19386 + } 1.19387 + this.fireEvent("click", this, e); 1.19388 + if(this.handler){ 1.19389 + this.handler.call(this.scope || this, this, e); 1.19390 + } 1.19391 + } 1.19392 + }, 1.19393 + 1.19394 + isMenuTriggerOver : function(e, internal){ 1.19395 + return this.menu && !internal; 1.19396 + }, 1.19397 + 1.19398 + isMenuTriggerOut : function(e, internal){ 1.19399 + return this.menu && !internal; 1.19400 + }, 1.19401 + 1.19402 + onMouseOver : function(e){ 1.19403 + if(!this.disabled){ 1.19404 + var internal = e.within(this.el, true); 1.19405 + if(!internal){ 1.19406 + this.el.addClass("x-btn-over"); 1.19407 + Ext.getDoc().on('mouseover', this.monitorMouseOver, this); 1.19408 + this.fireEvent('mouseover', this, e); 1.19409 + } 1.19410 + if(this.isMenuTriggerOver(e, internal)){ 1.19411 + this.fireEvent('menutriggerover', this, this.menu, e); 1.19412 + } 1.19413 + } 1.19414 + }, 1.19415 + 1.19416 + monitorMouseOver : function(e){ 1.19417 + if(e.target != this.el.dom && !e.within(this.el)){ 1.19418 + Ext.getDoc().un('mouseover', this.monitorMouseOver, this); 1.19419 + this.onMouseOut(e); 1.19420 + } 1.19421 + }, 1.19422 + 1.19423 + onMouseOut : function(e){ 1.19424 + var internal = e.within(this.el) && e.target != this.el.dom; 1.19425 + this.el.removeClass("x-btn-over"); 1.19426 + this.fireEvent('mouseout', this, e); 1.19427 + if(this.isMenuTriggerOut(e, internal)){ 1.19428 + this.fireEvent('menutriggerout', this, this.menu, e); 1.19429 + } 1.19430 + }, 1.19431 + onFocus : function(e){ 1.19432 + if(!this.disabled){ 1.19433 + this.el.addClass("x-btn-focus"); 1.19434 + } 1.19435 + }, 1.19436 + onBlur : function(e){ 1.19437 + this.el.removeClass("x-btn-focus"); 1.19438 + }, 1.19439 + 1.19440 + getClickEl : function(e, isUp){ 1.19441 + return this.el; 1.19442 + }, 1.19443 + 1.19444 + onMouseDown : function(e){ 1.19445 + if(!this.disabled && e.button == 0){ 1.19446 + this.getClickEl(e).addClass("x-btn-click"); 1.19447 + Ext.getDoc().on('mouseup', this.onMouseUp, this); 1.19448 + } 1.19449 + }, 1.19450 + onMouseUp : function(e){ 1.19451 + if(e.button == 0){ 1.19452 + this.getClickEl(e, true).removeClass("x-btn-click"); 1.19453 + Ext.getDoc().un('mouseup', this.onMouseUp, this); 1.19454 + } 1.19455 + }, 1.19456 + onMenuShow : function(e){ 1.19457 + this.ignoreNextClick = 0; 1.19458 + this.el.addClass("x-btn-menu-active"); 1.19459 + this.fireEvent('menushow', this, this.menu); 1.19460 + }, 1.19461 + onMenuHide : function(e){ 1.19462 + this.el.removeClass("x-btn-menu-active"); 1.19463 + this.ignoreNextClick = this.restoreClick.defer(250, this); 1.19464 + this.fireEvent('menuhide', this, this.menu); 1.19465 + }, 1.19466 + 1.19467 + restoreClick : function(){ 1.19468 + this.ignoreNextClick = 0; 1.19469 + } 1.19470 + 1.19471 + 1.19472 + 1.19473 + 1.19474 +}); 1.19475 +Ext.reg('button', Ext.Button); 1.19476 + 1.19477 +Ext.ButtonToggleMgr = function(){ 1.19478 + var groups = {}; 1.19479 + 1.19480 + function toggleGroup(btn, state){ 1.19481 + if(state){ 1.19482 + var g = groups[btn.toggleGroup]; 1.19483 + for(var i = 0, l = g.length; i < l; i++){ 1.19484 + if(g[i] != btn){ 1.19485 + g[i].toggle(false); 1.19486 + } 1.19487 + } 1.19488 + } 1.19489 + } 1.19490 + 1.19491 + return { 1.19492 + register : function(btn){ 1.19493 + if(!btn.toggleGroup){ 1.19494 + return; 1.19495 + } 1.19496 + var g = groups[btn.toggleGroup]; 1.19497 + if(!g){ 1.19498 + g = groups[btn.toggleGroup] = []; 1.19499 + } 1.19500 + g.push(btn); 1.19501 + btn.on("toggle", toggleGroup); 1.19502 + }, 1.19503 + 1.19504 + unregister : function(btn){ 1.19505 + if(!btn.toggleGroup){ 1.19506 + return; 1.19507 + } 1.19508 + var g = groups[btn.toggleGroup]; 1.19509 + if(g){ 1.19510 + g.remove(btn); 1.19511 + btn.un("toggle", toggleGroup); 1.19512 + } 1.19513 + } 1.19514 + }; 1.19515 +}(); 1.19516 + 1.19517 +Ext.SplitButton = Ext.extend(Ext.Button, { 1.19518 + 1.19519 + arrowSelector : 'button:last', 1.19520 + 1.19521 + 1.19522 + initComponent : function(){ 1.19523 + Ext.SplitButton.superclass.initComponent.call(this); 1.19524 + 1.19525 + this.addEvents("arrowclick"); 1.19526 + }, 1.19527 + 1.19528 + 1.19529 + onRender : function(ct, position){ 1.19530 + 1.19531 + var tpl = new Ext.Template( 1.19532 + '<table cellspacing="0" class="x-btn-menu-wrap x-btn"><tr><td>', 1.19533 + '<table cellspacing="0" class="x-btn-wrap x-btn-menu-text-wrap"><tbody>', 1.19534 + '<tr><td class="x-btn-left"><i> </i></td><td class="x-btn-center"><button class="x-btn-text" type="{1}">{0}</button></td></tr>', 1.19535 + "</tbody></table></td><td>", 1.19536 + '<table cellspacing="0" class="x-btn-wrap x-btn-menu-arrow-wrap"><tbody>', 1.19537 + '<tr><td class="x-btn-center"><button class="x-btn-menu-arrow-el" type="button"> </button></td><td class="x-btn-right"><i> </i></td></tr>', 1.19538 + "</tbody></table></td></tr></table>" 1.19539 + ); 1.19540 + var btn, targs = [this.text || ' ', this.type]; 1.19541 + if(position){ 1.19542 + btn = tpl.insertBefore(position, targs, true); 1.19543 + }else{ 1.19544 + btn = tpl.append(ct, targs, true); 1.19545 + } 1.19546 + var btnEl = btn.child(this.buttonSelector); 1.19547 + 1.19548 + this.initButtonEl(btn, btnEl); 1.19549 + this.arrowBtnTable = btn.child("table:last"); 1.19550 + if(this.arrowTooltip){ 1.19551 + btn.child(this.arrowSelector).dom[this.tooltipType] = this.arrowTooltip; 1.19552 + } 1.19553 + }, 1.19554 + 1.19555 + 1.19556 + autoWidth : function(){ 1.19557 + if(this.el){ 1.19558 + var tbl = this.el.child("table:first"); 1.19559 + var tbl2 = this.el.child("table:last"); 1.19560 + this.el.setWidth("auto"); 1.19561 + tbl.setWidth("auto"); 1.19562 + if(Ext.isIE7 && Ext.isStrict){ 1.19563 + var ib = this.el.child(this.buttonSelector); 1.19564 + if(ib && ib.getWidth() > 20){ 1.19565 + ib.clip(); 1.19566 + ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr')); 1.19567 + } 1.19568 + } 1.19569 + if(this.minWidth){ 1.19570 + if((tbl.getWidth()+tbl2.getWidth()) < this.minWidth){ 1.19571 + tbl.setWidth(this.minWidth-tbl2.getWidth()); 1.19572 + } 1.19573 + } 1.19574 + this.el.setWidth(tbl.getWidth()+tbl2.getWidth()); 1.19575 + } 1.19576 + }, 1.19577 + 1.19578 + 1.19579 + setArrowHandler : function(handler, scope){ 1.19580 + this.arrowHandler = handler; 1.19581 + this.scope = scope; 1.19582 + }, 1.19583 + 1.19584 + 1.19585 + onClick : function(e){ 1.19586 + e.preventDefault(); 1.19587 + if(!this.disabled){ 1.19588 + if(e.getTarget(".x-btn-menu-arrow-wrap")){ 1.19589 + if(this.menu && !this.menu.isVisible() && !this.ignoreNextClick){ 1.19590 + this.showMenu(); 1.19591 + } 1.19592 + this.fireEvent("arrowclick", this, e); 1.19593 + if(this.arrowHandler){ 1.19594 + this.arrowHandler.call(this.scope || this, this, e); 1.19595 + } 1.19596 + }else{ 1.19597 + if(this.enableToggle){ 1.19598 + this.toggle(); 1.19599 + } 1.19600 + this.fireEvent("click", this, e); 1.19601 + if(this.handler){ 1.19602 + this.handler.call(this.scope || this, this, e); 1.19603 + } 1.19604 + } 1.19605 + } 1.19606 + }, 1.19607 + 1.19608 + 1.19609 + getClickEl : function(e, isUp){ 1.19610 + if(!isUp){ 1.19611 + return (this.lastClickEl = e.getTarget("table", 10, true)); 1.19612 + } 1.19613 + return this.lastClickEl; 1.19614 + }, 1.19615 + 1.19616 + 1.19617 + onDisable : function(){ 1.19618 + if(this.el){ 1.19619 + if(!Ext.isIE6){ 1.19620 + this.el.addClass("x-item-disabled"); 1.19621 + } 1.19622 + this.el.child(this.buttonSelector).dom.disabled = true; 1.19623 + this.el.child(this.arrowSelector).dom.disabled = true; 1.19624 + } 1.19625 + this.disabled = true; 1.19626 + }, 1.19627 + 1.19628 + 1.19629 + onEnable : function(){ 1.19630 + if(this.el){ 1.19631 + if(!Ext.isIE6){ 1.19632 + this.el.removeClass("x-item-disabled"); 1.19633 + } 1.19634 + this.el.child(this.buttonSelector).dom.disabled = false; 1.19635 + this.el.child(this.arrowSelector).dom.disabled = false; 1.19636 + } 1.19637 + this.disabled = false; 1.19638 + }, 1.19639 + 1.19640 + 1.19641 + isMenuTriggerOver : function(e){ 1.19642 + return this.menu && e.within(this.arrowBtnTable) && !e.within(this.arrowBtnTable, true); 1.19643 + }, 1.19644 + 1.19645 + 1.19646 + isMenuTriggerOut : function(e, internal){ 1.19647 + return this.menu && !e.within(this.arrowBtnTable); 1.19648 + }, 1.19649 + 1.19650 + 1.19651 + onDestroy : function(){ 1.19652 + Ext.destroy(this.arrowBtnTable); 1.19653 + Ext.SplitButton.superclass.onDestroy.call(this); 1.19654 + } 1.19655 +}); 1.19656 + 1.19657 + 1.19658 +Ext.MenuButton = Ext.SplitButton; 1.19659 + 1.19660 + 1.19661 +Ext.reg('splitbutton', Ext.SplitButton); 1.19662 + 1.19663 +Ext.CycleButton = Ext.extend(Ext.SplitButton, { 1.19664 + 1.19665 + 1.19666 + 1.19667 + 1.19668 + 1.19669 + 1.19670 + 1.19671 + getItemText : function(item){ 1.19672 + if(item && this.showText === true){ 1.19673 + var text = ''; 1.19674 + if(this.prependText){ 1.19675 + text += this.prependText; 1.19676 + } 1.19677 + text += item.text; 1.19678 + return text; 1.19679 + } 1.19680 + return undefined; 1.19681 + }, 1.19682 + 1.19683 + 1.19684 + setActiveItem : function(item, suppressEvent){ 1.19685 + if(typeof item != 'object'){ 1.19686 + item = this.menu.items.get(item); 1.19687 + } 1.19688 + if(item){ 1.19689 + if(!this.rendered){ 1.19690 + this.text = this.getItemText(item); 1.19691 + this.iconCls = item.iconCls; 1.19692 + }else{ 1.19693 + var t = this.getItemText(item); 1.19694 + if(t){ 1.19695 + this.setText(t); 1.19696 + } 1.19697 + this.setIconClass(item.iconCls); 1.19698 + } 1.19699 + this.activeItem = item; 1.19700 + if(!item.checked){ 1.19701 + item.setChecked(true, true); 1.19702 + } 1.19703 + if(this.forceIcon){ 1.19704 + this.setIconClass(this.forceIcon); 1.19705 + } 1.19706 + if(!suppressEvent){ 1.19707 + this.fireEvent('change', this, item); 1.19708 + } 1.19709 + } 1.19710 + }, 1.19711 + 1.19712 + 1.19713 + getActiveItem : function(){ 1.19714 + return this.activeItem; 1.19715 + }, 1.19716 + 1.19717 + 1.19718 + initComponent : function(){ 1.19719 + this.addEvents( 1.19720 + 1.19721 + "change" 1.19722 + ); 1.19723 + 1.19724 + if(this.changeHandler){ 1.19725 + this.on('change', this.changeHandler, this.scope||this); 1.19726 + delete this.changeHandler; 1.19727 + } 1.19728 + 1.19729 + this.itemCount = this.items.length; 1.19730 + 1.19731 + this.menu = {cls:'x-cycle-menu', items:[]}; 1.19732 + var checked; 1.19733 + for(var i = 0, len = this.itemCount; i < len; i++){ 1.19734 + var item = this.items[i]; 1.19735 + item.group = item.group || this.id; 1.19736 + item.itemIndex = i; 1.19737 + item.checkHandler = this.checkHandler; 1.19738 + item.scope = this; 1.19739 + item.checked = item.checked || false; 1.19740 + this.menu.items.push(item); 1.19741 + if(item.checked){ 1.19742 + checked = item; 1.19743 + } 1.19744 + } 1.19745 + this.setActiveItem(checked, true); 1.19746 + Ext.CycleButton.superclass.initComponent.call(this); 1.19747 + 1.19748 + this.on('click', this.toggleSelected, this); 1.19749 + }, 1.19750 + 1.19751 + 1.19752 + checkHandler : function(item, pressed){ 1.19753 + if(pressed){ 1.19754 + this.setActiveItem(item); 1.19755 + } 1.19756 + }, 1.19757 + 1.19758 + 1.19759 + toggleSelected : function(){ 1.19760 + this.menu.render(); 1.19761 + 1.19762 + var nextIdx, checkItem; 1.19763 + for (var i = 1; i < this.itemCount; i++) { 1.19764 + nextIdx = (this.activeItem.itemIndex + i) % this.itemCount; 1.19765 + 1.19766 + checkItem = this.menu.items.itemAt(nextIdx); 1.19767 + 1.19768 + if (!checkItem.disabled) { 1.19769 + checkItem.setChecked(true); 1.19770 + break; 1.19771 + } 1.19772 + } 1.19773 + } 1.19774 +}); 1.19775 +Ext.reg('cycle', Ext.CycleButton); 1.19776 + 1.19777 + Ext.Toolbar = function(config){ 1.19778 + if(Ext.isArray(config)){ 1.19779 + config = {buttons:config}; 1.19780 + } 1.19781 + Ext.Toolbar.superclass.constructor.call(this, config); 1.19782 +}; 1.19783 + 1.19784 +(function(){ 1.19785 + 1.19786 +var T = Ext.Toolbar; 1.19787 + 1.19788 +Ext.extend(T, Ext.BoxComponent, { 1.19789 + 1.19790 + trackMenus : true, 1.19791 + 1.19792 + 1.19793 + initComponent : function(){ 1.19794 + T.superclass.initComponent.call(this); 1.19795 + 1.19796 + if(this.items){ 1.19797 + this.buttons = this.items; 1.19798 + } 1.19799 + 1.19800 + this.items = new Ext.util.MixedCollection(false, function(o){ 1.19801 + return o.itemId || o.id || Ext.id(); 1.19802 + }); 1.19803 + }, 1.19804 + 1.19805 + 1.19806 + autoCreate: { 1.19807 + cls:'x-toolbar x-small-editor', 1.19808 + html:'<table cellspacing="0"><tr></tr></table>' 1.19809 + }, 1.19810 + 1.19811 + 1.19812 + onRender : function(ct, position){ 1.19813 + this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position); 1.19814 + this.tr = this.el.child("tr", true); 1.19815 + }, 1.19816 + 1.19817 + 1.19818 + afterRender : function(){ 1.19819 + T.superclass.afterRender.call(this); 1.19820 + if(this.buttons){ 1.19821 + this.add.apply(this, this.buttons); 1.19822 + delete this.buttons; 1.19823 + } 1.19824 + }, 1.19825 + 1.19826 + 1.19827 + add : function(){ 1.19828 + var a = arguments, l = a.length; 1.19829 + for(var i = 0; i < l; i++){ 1.19830 + var el = a[i]; 1.19831 + if(el.isFormField){ 1.19832 + this.addField(el); 1.19833 + }else if(el.render){ 1.19834 + this.addItem(el); 1.19835 + }else if(typeof el == "string"){ 1.19836 + if(el == "separator" || el == "-"){ 1.19837 + this.addSeparator(); 1.19838 + }else if(el == " "){ 1.19839 + this.addSpacer(); 1.19840 + }else if(el == "->"){ 1.19841 + this.addFill(); 1.19842 + }else{ 1.19843 + this.addText(el); 1.19844 + } 1.19845 + }else if(el.tagName){ 1.19846 + this.addElement(el); 1.19847 + }else if(typeof el == "object"){ 1.19848 + if(el.xtype){ 1.19849 + this.addField(Ext.ComponentMgr.create(el, 'button')); 1.19850 + }else{ 1.19851 + this.addButton(el); 1.19852 + } 1.19853 + } 1.19854 + } 1.19855 + }, 1.19856 + 1.19857 + 1.19858 + addSeparator : function(){ 1.19859 + return this.addItem(new T.Separator()); 1.19860 + }, 1.19861 + 1.19862 + 1.19863 + addSpacer : function(){ 1.19864 + return this.addItem(new T.Spacer()); 1.19865 + }, 1.19866 + 1.19867 + 1.19868 + addFill : function(){ 1.19869 + return this.addItem(new T.Fill()); 1.19870 + }, 1.19871 + 1.19872 + 1.19873 + addElement : function(el){ 1.19874 + return this.addItem(new T.Item(el)); 1.19875 + }, 1.19876 + 1.19877 + 1.19878 + addItem : function(item){ 1.19879 + var td = this.nextBlock(); 1.19880 + this.initMenuTracking(item); 1.19881 + item.render(td); 1.19882 + this.items.add(item); 1.19883 + return item; 1.19884 + }, 1.19885 + 1.19886 + 1.19887 + addButton : function(config){ 1.19888 + if(Ext.isArray(config)){ 1.19889 + var buttons = []; 1.19890 + for(var i = 0, len = config.length; i < len; i++) { 1.19891 + buttons.push(this.addButton(config[i])); 1.19892 + } 1.19893 + return buttons; 1.19894 + } 1.19895 + var b = config; 1.19896 + if(!(config instanceof T.Button)){ 1.19897 + b = config.split ? 1.19898 + new T.SplitButton(config) : 1.19899 + new T.Button(config); 1.19900 + } 1.19901 + var td = this.nextBlock(); 1.19902 + this.initMenuTracking(b); 1.19903 + b.render(td); 1.19904 + this.items.add(b); 1.19905 + return b; 1.19906 + }, 1.19907 + 1.19908 + 1.19909 + initMenuTracking : function(item){ 1.19910 + if(this.trackMenus && item.menu){ 1.19911 + item.on({ 1.19912 + 'menutriggerover' : this.onButtonTriggerOver, 1.19913 + 'menushow' : this.onButtonMenuShow, 1.19914 + 'menuhide' : this.onButtonMenuHide, 1.19915 + scope: this 1.19916 + }) 1.19917 + } 1.19918 + }, 1.19919 + 1.19920 + 1.19921 + addText : function(text){ 1.19922 + return this.addItem(new T.TextItem(text)); 1.19923 + }, 1.19924 + 1.19925 + 1.19926 + insertButton : function(index, item){ 1.19927 + if(Ext.isArray(item)){ 1.19928 + var buttons = []; 1.19929 + for(var i = 0, len = item.length; i < len; i++) { 1.19930 + buttons.push(this.insertButton(index + i, item[i])); 1.19931 + } 1.19932 + return buttons; 1.19933 + } 1.19934 + if (!(item instanceof T.Button)){ 1.19935 + item = new T.Button(item); 1.19936 + } 1.19937 + var td = document.createElement("td"); 1.19938 + this.tr.insertBefore(td, this.tr.childNodes[index]); 1.19939 + this.initMenuTracking(item); 1.19940 + item.render(td); 1.19941 + this.items.insert(index, item); 1.19942 + return item; 1.19943 + }, 1.19944 + 1.19945 + 1.19946 + addDom : function(config, returnEl){ 1.19947 + var td = this.nextBlock(); 1.19948 + Ext.DomHelper.overwrite(td, config); 1.19949 + var ti = new T.Item(td.firstChild); 1.19950 + ti.render(td); 1.19951 + this.items.add(ti); 1.19952 + return ti; 1.19953 + }, 1.19954 + 1.19955 + 1.19956 + addField : function(field){ 1.19957 + var td = this.nextBlock(); 1.19958 + field.render(td); 1.19959 + var ti = new T.Item(td.firstChild); 1.19960 + ti.render(td); 1.19961 + this.items.add(ti); 1.19962 + return ti; 1.19963 + }, 1.19964 + 1.19965 + 1.19966 + nextBlock : function(){ 1.19967 + var td = document.createElement("td"); 1.19968 + this.tr.appendChild(td); 1.19969 + return td; 1.19970 + }, 1.19971 + 1.19972 + 1.19973 + onDestroy : function(){ 1.19974 + Ext.Toolbar.superclass.onDestroy.call(this); 1.19975 + if(this.rendered){ 1.19976 + if(this.items){ 1.19977 + Ext.destroy.apply(Ext, this.items.items); 1.19978 + } 1.19979 + Ext.Element.uncache(this.tr); 1.19980 + } 1.19981 + }, 1.19982 + 1.19983 + 1.19984 + onDisable : function(){ 1.19985 + this.items.each(function(item){ 1.19986 + if(item.disable){ 1.19987 + item.disable(); 1.19988 + } 1.19989 + }); 1.19990 + }, 1.19991 + 1.19992 + 1.19993 + onEnable : function(){ 1.19994 + this.items.each(function(item){ 1.19995 + if(item.enable){ 1.19996 + item.enable(); 1.19997 + } 1.19998 + }); 1.19999 + }, 1.20000 + 1.20001 + 1.20002 + onButtonTriggerOver : function(btn){ 1.20003 + if(this.activeMenuBtn && this.activeMenuBtn != btn){ 1.20004 + this.activeMenuBtn.hideMenu(); 1.20005 + btn.showMenu(); 1.20006 + this.activeMenuBtn = btn; 1.20007 + } 1.20008 + }, 1.20009 + 1.20010 + 1.20011 + onButtonMenuShow : function(btn){ 1.20012 + this.activeMenuBtn = btn; 1.20013 + }, 1.20014 + 1.20015 + 1.20016 + onButtonMenuHide : function(btn){ 1.20017 + delete this.activeMenuBtn; 1.20018 + } 1.20019 + 1.20020 + 1.20021 +}); 1.20022 +Ext.reg('toolbar', Ext.Toolbar); 1.20023 + 1.20024 + 1.20025 +T.Item = function(el){ 1.20026 + this.el = Ext.getDom(el); 1.20027 + this.id = Ext.id(this.el); 1.20028 + this.hidden = false; 1.20029 +}; 1.20030 + 1.20031 +T.Item.prototype = { 1.20032 + 1.20033 + 1.20034 + getEl : function(){ 1.20035 + return this.el; 1.20036 + }, 1.20037 + 1.20038 + 1.20039 + render : function(td){ 1.20040 + this.td = td; 1.20041 + td.appendChild(this.el); 1.20042 + }, 1.20043 + 1.20044 + 1.20045 + destroy : function(){ 1.20046 + if(this.td && this.td.parentNode){ 1.20047 + this.td.parentNode.removeChild(this.td); 1.20048 + } 1.20049 + }, 1.20050 + 1.20051 + 1.20052 + show: function(){ 1.20053 + this.hidden = false; 1.20054 + this.td.style.display = ""; 1.20055 + }, 1.20056 + 1.20057 + 1.20058 + hide: function(){ 1.20059 + this.hidden = true; 1.20060 + this.td.style.display = "none"; 1.20061 + }, 1.20062 + 1.20063 + 1.20064 + setVisible: function(visible){ 1.20065 + if(visible) { 1.20066 + this.show(); 1.20067 + }else{ 1.20068 + this.hide(); 1.20069 + } 1.20070 + }, 1.20071 + 1.20072 + 1.20073 + focus : function(){ 1.20074 + Ext.fly(this.el).focus(); 1.20075 + }, 1.20076 + 1.20077 + 1.20078 + disable : function(){ 1.20079 + Ext.fly(this.td).addClass("x-item-disabled"); 1.20080 + this.disabled = true; 1.20081 + this.el.disabled = true; 1.20082 + }, 1.20083 + 1.20084 + 1.20085 + enable : function(){ 1.20086 + Ext.fly(this.td).removeClass("x-item-disabled"); 1.20087 + this.disabled = false; 1.20088 + this.el.disabled = false; 1.20089 + } 1.20090 +}; 1.20091 +Ext.reg('tbitem', T.Item); 1.20092 + 1.20093 + 1.20094 + 1.20095 +T.Separator = function(){ 1.20096 + var s = document.createElement("span"); 1.20097 + s.className = "ytb-sep"; 1.20098 + T.Separator.superclass.constructor.call(this, s); 1.20099 +}; 1.20100 +Ext.extend(T.Separator, T.Item, { 1.20101 + enable:Ext.emptyFn, 1.20102 + disable:Ext.emptyFn, 1.20103 + focus:Ext.emptyFn 1.20104 +}); 1.20105 +Ext.reg('tbseparator', T.Separator); 1.20106 + 1.20107 + 1.20108 +T.Spacer = function(){ 1.20109 + var s = document.createElement("div"); 1.20110 + s.className = "ytb-spacer"; 1.20111 + T.Spacer.superclass.constructor.call(this, s); 1.20112 +}; 1.20113 +Ext.extend(T.Spacer, T.Item, { 1.20114 + enable:Ext.emptyFn, 1.20115 + disable:Ext.emptyFn, 1.20116 + focus:Ext.emptyFn 1.20117 +}); 1.20118 + 1.20119 +Ext.reg('tbspacer', T.Spacer); 1.20120 + 1.20121 + 1.20122 +T.Fill = Ext.extend(T.Spacer, { 1.20123 + 1.20124 + render : function(td){ 1.20125 + td.style.width = '100%'; 1.20126 + T.Fill.superclass.render.call(this, td); 1.20127 + } 1.20128 +}); 1.20129 +Ext.reg('tbfill', T.Fill); 1.20130 + 1.20131 + 1.20132 +T.TextItem = function(t){ 1.20133 + var s = document.createElement("span"); 1.20134 + s.className = "ytb-text"; 1.20135 + s.innerHTML = t.text ? t.text : t; 1.20136 + T.TextItem.superclass.constructor.call(this, s); 1.20137 +}; 1.20138 +Ext.extend(T.TextItem, T.Item, { 1.20139 + enable:Ext.emptyFn, 1.20140 + disable:Ext.emptyFn, 1.20141 + focus:Ext.emptyFn 1.20142 +}); 1.20143 +Ext.reg('tbtext', T.TextItem); 1.20144 + 1.20145 + 1.20146 + 1.20147 +T.Button = Ext.extend(Ext.Button, { 1.20148 + hideParent : true, 1.20149 + 1.20150 + onDestroy : function(){ 1.20151 + T.Button.superclass.onDestroy.call(this); 1.20152 + if(this.container){ 1.20153 + this.container.remove(); 1.20154 + } 1.20155 + } 1.20156 +}); 1.20157 +Ext.reg('tbbutton', T.Button); 1.20158 + 1.20159 + 1.20160 +T.SplitButton = Ext.extend(Ext.SplitButton, { 1.20161 + hideParent : true, 1.20162 + 1.20163 + onDestroy : function(){ 1.20164 + T.SplitButton.superclass.onDestroy.call(this); 1.20165 + if(this.container){ 1.20166 + this.container.remove(); 1.20167 + } 1.20168 + } 1.20169 +}); 1.20170 + 1.20171 +Ext.reg('tbsplit', T.SplitButton); 1.20172 + 1.20173 +T.MenuButton = T.SplitButton; 1.20174 + 1.20175 +})(); 1.20176 + 1.20177 + 1.20178 +Ext.PagingToolbar = Ext.extend(Ext.Toolbar, { 1.20179 + 1.20180 + 1.20181 + 1.20182 + pageSize: 20, 1.20183 + 1.20184 + displayMsg : 'Displaying {0} - {1} of {2}', 1.20185 + 1.20186 + emptyMsg : 'No data to display', 1.20187 + 1.20188 + beforePageText : "Page", 1.20189 + 1.20190 + afterPageText : "of {0}", 1.20191 + 1.20192 + firstText : "First Page", 1.20193 + 1.20194 + prevText : "Previous Page", 1.20195 + 1.20196 + nextText : "Next Page", 1.20197 + 1.20198 + lastText : "Last Page", 1.20199 + 1.20200 + refreshText : "Refresh", 1.20201 + 1.20202 + 1.20203 + paramNames : {start: 'start', limit: 'limit'}, 1.20204 + 1.20205 + initComponent : function(){ 1.20206 + Ext.PagingToolbar.superclass.initComponent.call(this); 1.20207 + this.cursor = 0; 1.20208 + this.bind(this.store); 1.20209 + }, 1.20210 + 1.20211 + onRender : function(ct, position){ 1.20212 + Ext.PagingToolbar.superclass.onRender.call(this, ct, position); 1.20213 + this.first = this.addButton({ 1.20214 + tooltip: this.firstText, 1.20215 + iconCls: "x-tbar-page-first", 1.20216 + disabled: true, 1.20217 + handler: this.onClick.createDelegate(this, ["first"]) 1.20218 + }); 1.20219 + this.prev = this.addButton({ 1.20220 + tooltip: this.prevText, 1.20221 + iconCls: "x-tbar-page-prev", 1.20222 + disabled: true, 1.20223 + handler: this.onClick.createDelegate(this, ["prev"]) 1.20224 + }); 1.20225 + this.addSeparator(); 1.20226 + this.add(this.beforePageText); 1.20227 + this.field = Ext.get(this.addDom({ 1.20228 + tag: "input", 1.20229 + type: "text", 1.20230 + size: "3", 1.20231 + value: "1", 1.20232 + cls: "x-tbar-page-number" 1.20233 + }).el); 1.20234 + this.field.on("keydown", this.onPagingKeydown, this); 1.20235 + this.field.on("focus", function(){this.dom.select();}); 1.20236 + this.afterTextEl = this.addText(String.format(this.afterPageText, 1)); 1.20237 + this.field.setHeight(18); 1.20238 + this.addSeparator(); 1.20239 + this.next = this.addButton({ 1.20240 + tooltip: this.nextText, 1.20241 + iconCls: "x-tbar-page-next", 1.20242 + disabled: true, 1.20243 + handler: this.onClick.createDelegate(this, ["next"]) 1.20244 + }); 1.20245 + this.last = this.addButton({ 1.20246 + tooltip: this.lastText, 1.20247 + iconCls: "x-tbar-page-last", 1.20248 + disabled: true, 1.20249 + handler: this.onClick.createDelegate(this, ["last"]) 1.20250 + }); 1.20251 + this.addSeparator(); 1.20252 + this.loading = this.addButton({ 1.20253 + tooltip: this.refreshText, 1.20254 + iconCls: "x-tbar-loading", 1.20255 + handler: this.onClick.createDelegate(this, ["refresh"]) 1.20256 + }); 1.20257 + 1.20258 + if(this.displayInfo){ 1.20259 + this.displayEl = Ext.fly(this.el.dom).createChild({cls:'x-paging-info'}); 1.20260 + } 1.20261 + if(this.dsLoaded){ 1.20262 + this.onLoad.apply(this, this.dsLoaded); 1.20263 + } 1.20264 + }, 1.20265 + 1.20266 + updateInfo : function(){ 1.20267 + if(this.displayEl){ 1.20268 + var count = this.store.getCount(); 1.20269 + var msg = count == 0 ? 1.20270 + this.emptyMsg : 1.20271 + String.format( 1.20272 + this.displayMsg, 1.20273 + this.cursor+1, this.cursor+count, this.store.getTotalCount() 1.20274 + ); 1.20275 + this.displayEl.update(msg); 1.20276 + } 1.20277 + }, 1.20278 + 1.20279 + onLoad : function(store, r, o){ 1.20280 + if(!this.rendered){ 1.20281 + this.dsLoaded = [store, r, o]; 1.20282 + return; 1.20283 + } 1.20284 + this.cursor = o.params ? o.params[this.paramNames.start] : 0; 1.20285 + var d = this.getPageData(), ap = d.activePage, ps = d.pages; 1.20286 + 1.20287 + this.afterTextEl.el.innerHTML = String.format(this.afterPageText, d.pages); 1.20288 + this.field.dom.value = ap; 1.20289 + this.first.setDisabled(ap == 1); 1.20290 + this.prev.setDisabled(ap == 1); 1.20291 + this.next.setDisabled(ap == ps); 1.20292 + this.last.setDisabled(ap == ps); 1.20293 + this.loading.enable(); 1.20294 + this.updateInfo(); 1.20295 + }, 1.20296 + 1.20297 + getPageData : function(){ 1.20298 + var total = this.store.getTotalCount(); 1.20299 + return { 1.20300 + total : total, 1.20301 + activePage : Math.ceil((this.cursor+this.pageSize)/this.pageSize), 1.20302 + pages : total < this.pageSize ? 1 : Math.ceil(total/this.pageSize) 1.20303 + }; 1.20304 + }, 1.20305 + 1.20306 + onLoadError : function(){ 1.20307 + if(!this.rendered){ 1.20308 + return; 1.20309 + } 1.20310 + this.loading.enable(); 1.20311 + }, 1.20312 + 1.20313 + readPage : function(d){ 1.20314 + var v = this.field.dom.value, pageNum; 1.20315 + if (!v || isNaN(pageNum = parseInt(v, 10))) { 1.20316 + this.field.dom.value = d.activePage; 1.20317 + return false; 1.20318 + } 1.20319 + return pageNum; 1.20320 + }, 1.20321 + 1.20322 + onPagingKeydown : function(e){ 1.20323 + var k = e.getKey(), d = this.getPageData(), pageNum; 1.20324 + if (k == e.RETURN) { 1.20325 + e.stopEvent(); 1.20326 + if(pageNum = this.readPage(d)){ 1.20327 + pageNum = Math.min(Math.max(1, pageNum), d.pages) - 1; 1.20328 + this.doLoad(pageNum * this.pageSize); 1.20329 + } 1.20330 + }else if (k == e.HOME || k == e.END){ 1.20331 + e.stopEvent(); 1.20332 + pageNum = k == e.HOME ? 1 : d.pages; 1.20333 + this.field.dom.value = pageNum; 1.20334 + }else if (k == e.UP || k == e.PAGEUP || k == e.DOWN || k == e.PAGEDOWN){ 1.20335 + e.stopEvent(); 1.20336 + if(pageNum = this.readPage(d)){ 1.20337 + var increment = e.shiftKey ? 10 : 1; 1.20338 + if(k == e.DOWN || k == e.PAGEDOWN){ 1.20339 + increment *= -1; 1.20340 + } 1.20341 + pageNum += increment; 1.20342 + if(pageNum >= 1 & pageNum <= d.pages){ 1.20343 + this.field.dom.value = pageNum; 1.20344 + } 1.20345 + } 1.20346 + } 1.20347 + }, 1.20348 + 1.20349 + beforeLoad : function(){ 1.20350 + if(this.rendered && this.loading){ 1.20351 + this.loading.disable(); 1.20352 + } 1.20353 + }, 1.20354 + 1.20355 + doLoad : function(start){ 1.20356 + var o = {}, pn = this.paramNames; 1.20357 + o[pn.start] = start; 1.20358 + o[pn.limit] = this.pageSize; 1.20359 + this.store.load({params:o}); 1.20360 + }, 1.20361 + 1.20362 + onClick : function(which){ 1.20363 + var store = this.store; 1.20364 + switch(which){ 1.20365 + case "first": 1.20366 + this.doLoad(0); 1.20367 + break; 1.20368 + case "prev": 1.20369 + this.doLoad(Math.max(0, this.cursor-this.pageSize)); 1.20370 + break; 1.20371 + case "next": 1.20372 + this.doLoad(this.cursor+this.pageSize); 1.20373 + break; 1.20374 + case "last": 1.20375 + var total = store.getTotalCount(); 1.20376 + var extra = total % this.pageSize; 1.20377 + var lastStart = extra ? (total - extra) : total-this.pageSize; 1.20378 + this.doLoad(lastStart); 1.20379 + break; 1.20380 + case "refresh": 1.20381 + this.doLoad(this.cursor); 1.20382 + break; 1.20383 + } 1.20384 + }, 1.20385 + 1.20386 + 1.20387 + unbind : function(store){ 1.20388 + store = Ext.StoreMgr.lookup(store); 1.20389 + store.un("beforeload", this.beforeLoad, this); 1.20390 + store.un("load", this.onLoad, this); 1.20391 + store.un("loadexception", this.onLoadError, this); 1.20392 + this.store = undefined; 1.20393 + }, 1.20394 + 1.20395 + 1.20396 + bind : function(store){ 1.20397 + store = Ext.StoreMgr.lookup(store); 1.20398 + store.on("beforeload", this.beforeLoad, this); 1.20399 + store.on("load", this.onLoad, this); 1.20400 + store.on("loadexception", this.onLoadError, this); 1.20401 + this.store = store; 1.20402 + } 1.20403 +}); 1.20404 +Ext.reg('paging', Ext.PagingToolbar); 1.20405 + 1.20406 +Ext.Resizable = function(el, config){ 1.20407 + this.el = Ext.get(el); 1.20408 + 1.20409 + if(config && config.wrap){ 1.20410 + config.resizeChild = this.el; 1.20411 + this.el = this.el.wrap(typeof config.wrap == "object" ? config.wrap : {cls:"xresizable-wrap"}); 1.20412 + this.el.id = this.el.dom.id = config.resizeChild.id + "-rzwrap"; 1.20413 + this.el.setStyle("overflow", "hidden"); 1.20414 + this.el.setPositioning(config.resizeChild.getPositioning()); 1.20415 + config.resizeChild.clearPositioning(); 1.20416 + if(!config.width || !config.height){ 1.20417 + var csize = config.resizeChild.getSize(); 1.20418 + this.el.setSize(csize.width, csize.height); 1.20419 + } 1.20420 + if(config.pinned && !config.adjustments){ 1.20421 + config.adjustments = "auto"; 1.20422 + } 1.20423 + } 1.20424 + 1.20425 + 1.20426 + this.proxy = this.el.createProxy({tag: "div", cls: "x-resizable-proxy", id: this.el.id + "-rzproxy"}); 1.20427 + this.proxy.unselectable(); 1.20428 + this.proxy.enableDisplayMode('block'); 1.20429 + 1.20430 + Ext.apply(this, config); 1.20431 + 1.20432 + if(this.pinned){ 1.20433 + this.disableTrackOver = true; 1.20434 + this.el.addClass("x-resizable-pinned"); 1.20435 + } 1.20436 + 1.20437 + var position = this.el.getStyle("position"); 1.20438 + if(position != "absolute" && position != "fixed"){ 1.20439 + this.el.setStyle("position", "relative"); 1.20440 + } 1.20441 + if(!this.handles){ 1.20442 + this.handles = 's,e,se'; 1.20443 + if(this.multiDirectional){ 1.20444 + this.handles += ',n,w'; 1.20445 + } 1.20446 + } 1.20447 + if(this.handles == "all"){ 1.20448 + this.handles = "n s e w ne nw se sw"; 1.20449 + } 1.20450 + var hs = this.handles.split(/\s*?[,;]\s*?| /); 1.20451 + var ps = Ext.Resizable.positions; 1.20452 + for(var i = 0, len = hs.length; i < len; i++){ 1.20453 + if(hs[i] && ps[hs[i]]){ 1.20454 + var pos = ps[hs[i]]; 1.20455 + this[pos] = new Ext.Resizable.Handle(this, pos, this.disableTrackOver, this.transparent); 1.20456 + } 1.20457 + } 1.20458 + 1.20459 + this.corner = this.southeast; 1.20460 + 1.20461 + if(this.handles.indexOf("n") != -1 || this.handles.indexOf("w") != -1){ 1.20462 + this.updateBox = true; 1.20463 + } 1.20464 + 1.20465 + this.activeHandle = null; 1.20466 + 1.20467 + if(this.resizeChild){ 1.20468 + if(typeof this.resizeChild == "boolean"){ 1.20469 + this.resizeChild = Ext.get(this.el.dom.firstChild, true); 1.20470 + }else{ 1.20471 + this.resizeChild = Ext.get(this.resizeChild, true); 1.20472 + } 1.20473 + } 1.20474 + 1.20475 + if(this.adjustments == "auto"){ 1.20476 + var rc = this.resizeChild; 1.20477 + var hw = this.west, he = this.east, hn = this.north, hs = this.south; 1.20478 + if(rc && (hw || hn)){ 1.20479 + rc.position("relative"); 1.20480 + rc.setLeft(hw ? hw.el.getWidth() : 0); 1.20481 + rc.setTop(hn ? hn.el.getHeight() : 0); 1.20482 + } 1.20483 + this.adjustments = [ 1.20484 + (he ? -he.el.getWidth() : 0) + (hw ? -hw.el.getWidth() : 0), 1.20485 + (hn ? -hn.el.getHeight() : 0) + (hs ? -hs.el.getHeight() : 0) -1 1.20486 + ]; 1.20487 + } 1.20488 + 1.20489 + if(this.draggable){ 1.20490 + this.dd = this.dynamic ? 1.20491 + this.el.initDD(null) : this.el.initDDProxy(null, {dragElId: this.proxy.id}); 1.20492 + this.dd.setHandleElId(this.resizeChild ? this.resizeChild.id : this.el.id); 1.20493 + } 1.20494 + 1.20495 + 1.20496 + this.addEvents( 1.20497 + "beforeresize", 1.20498 + "resize" 1.20499 + ); 1.20500 + 1.20501 + if(this.width !== null && this.height !== null){ 1.20502 + this.resizeTo(this.width, this.height); 1.20503 + }else{ 1.20504 + this.updateChildSize(); 1.20505 + } 1.20506 + if(Ext.isIE){ 1.20507 + this.el.dom.style.zoom = 1; 1.20508 + } 1.20509 + Ext.Resizable.superclass.constructor.call(this); 1.20510 +}; 1.20511 + 1.20512 +Ext.extend(Ext.Resizable, Ext.util.Observable, { 1.20513 + resizeChild : false, 1.20514 + adjustments : [0, 0], 1.20515 + minWidth : 5, 1.20516 + minHeight : 5, 1.20517 + maxWidth : 10000, 1.20518 + maxHeight : 10000, 1.20519 + enabled : true, 1.20520 + animate : false, 1.20521 + duration : .35, 1.20522 + dynamic : false, 1.20523 + handles : false, 1.20524 + multiDirectional : false, 1.20525 + disableTrackOver : false, 1.20526 + easing : 'easeOutStrong', 1.20527 + widthIncrement : 0, 1.20528 + heightIncrement : 0, 1.20529 + pinned : false, 1.20530 + width : null, 1.20531 + height : null, 1.20532 + preserveRatio : false, 1.20533 + transparent: false, 1.20534 + minX: 0, 1.20535 + minY: 0, 1.20536 + draggable: false, 1.20537 + 1.20538 + 1.20539 + 1.20540 + 1.20541 + 1.20542 + 1.20543 + 1.20544 + 1.20545 + resizeTo : function(width, height){ 1.20546 + this.el.setSize(width, height); 1.20547 + this.updateChildSize(); 1.20548 + this.fireEvent("resize", this, width, height, null); 1.20549 + }, 1.20550 + 1.20551 + 1.20552 + startSizing : function(e, handle){ 1.20553 + this.fireEvent("beforeresize", this, e); 1.20554 + if(this.enabled){ 1.20555 + 1.20556 + if(!this.overlay){ 1.20557 + this.overlay = this.el.createProxy({tag: "div", cls: "x-resizable-overlay", html: " "}, Ext.getBody()); 1.20558 + this.overlay.unselectable(); 1.20559 + this.overlay.enableDisplayMode("block"); 1.20560 + this.overlay.on("mousemove", this.onMouseMove, this); 1.20561 + this.overlay.on("mouseup", this.onMouseUp, this); 1.20562 + } 1.20563 + this.overlay.setStyle("cursor", handle.el.getStyle("cursor")); 1.20564 + 1.20565 + this.resizing = true; 1.20566 + this.startBox = this.el.getBox(); 1.20567 + this.startPoint = e.getXY(); 1.20568 + this.offsets = [(this.startBox.x + this.startBox.width) - this.startPoint[0], 1.20569 + (this.startBox.y + this.startBox.height) - this.startPoint[1]]; 1.20570 + 1.20571 + this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)); 1.20572 + this.overlay.show(); 1.20573 + 1.20574 + if(this.constrainTo) { 1.20575 + var ct = Ext.get(this.constrainTo); 1.20576 + this.resizeRegion = ct.getRegion().adjust( 1.20577 + ct.getFrameWidth('t'), 1.20578 + ct.getFrameWidth('l'), 1.20579 + -ct.getFrameWidth('b'), 1.20580 + -ct.getFrameWidth('r') 1.20581 + ); 1.20582 + } 1.20583 + 1.20584 + this.proxy.setStyle('visibility', 'hidden'); 1.20585 + this.proxy.show(); 1.20586 + this.proxy.setBox(this.startBox); 1.20587 + if(!this.dynamic){ 1.20588 + this.proxy.setStyle('visibility', 'visible'); 1.20589 + } 1.20590 + } 1.20591 + }, 1.20592 + 1.20593 + 1.20594 + onMouseDown : function(handle, e){ 1.20595 + if(this.enabled){ 1.20596 + e.stopEvent(); 1.20597 + this.activeHandle = handle; 1.20598 + this.startSizing(e, handle); 1.20599 + } 1.20600 + }, 1.20601 + 1.20602 + 1.20603 + onMouseUp : function(e){ 1.20604 + var size = this.resizeElement(); 1.20605 + this.resizing = false; 1.20606 + this.handleOut(); 1.20607 + this.overlay.hide(); 1.20608 + this.proxy.hide(); 1.20609 + this.fireEvent("resize", this, size.width, size.height, e); 1.20610 + }, 1.20611 + 1.20612 + 1.20613 + updateChildSize : function(){ 1.20614 + if(this.resizeChild){ 1.20615 + var el = this.el; 1.20616 + var child = this.resizeChild; 1.20617 + var adj = this.adjustments; 1.20618 + if(el.dom.offsetWidth){ 1.20619 + var b = el.getSize(true); 1.20620 + child.setSize(b.width+adj[0], b.height+adj[1]); 1.20621 + } 1.20622 + 1.20623 + 1.20624 + 1.20625 + 1.20626 + if(Ext.isIE){ 1.20627 + setTimeout(function(){ 1.20628 + if(el.dom.offsetWidth){ 1.20629 + var b = el.getSize(true); 1.20630 + child.setSize(b.width+adj[0], b.height+adj[1]); 1.20631 + } 1.20632 + }, 10); 1.20633 + } 1.20634 + } 1.20635 + }, 1.20636 + 1.20637 + 1.20638 + snap : function(value, inc, min){ 1.20639 + if(!inc || !value) return value; 1.20640 + var newValue = value; 1.20641 + var m = value % inc; 1.20642 + if(m > 0){ 1.20643 + if(m > (inc/2)){ 1.20644 + newValue = value + (inc-m); 1.20645 + }else{ 1.20646 + newValue = value - m; 1.20647 + } 1.20648 + } 1.20649 + return Math.max(min, newValue); 1.20650 + }, 1.20651 + 1.20652 + 1.20653 + resizeElement : function(){ 1.20654 + var box = this.proxy.getBox(); 1.20655 + if(this.updateBox){ 1.20656 + this.el.setBox(box, false, this.animate, this.duration, null, this.easing); 1.20657 + }else{ 1.20658 + this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing); 1.20659 + } 1.20660 + this.updateChildSize(); 1.20661 + if(!this.dynamic){ 1.20662 + this.proxy.hide(); 1.20663 + } 1.20664 + return box; 1.20665 + }, 1.20666 + 1.20667 + 1.20668 + constrain : function(v, diff, m, mx){ 1.20669 + if(v - diff < m){ 1.20670 + diff = v - m; 1.20671 + }else if(v - diff > mx){ 1.20672 + diff = mx - v; 1.20673 + } 1.20674 + return diff; 1.20675 + }, 1.20676 + 1.20677 + 1.20678 + onMouseMove : function(e){ 1.20679 + if(this.enabled){ 1.20680 + try{ 1.20681 + 1.20682 + if(this.resizeRegion && !this.resizeRegion.contains(e.getPoint())) { 1.20683 + return; 1.20684 + } 1.20685 + 1.20686 + 1.20687 + var curSize = this.curSize || this.startBox; 1.20688 + var x = this.startBox.x, y = this.startBox.y; 1.20689 + var ox = x, oy = y; 1.20690 + var w = curSize.width, h = curSize.height; 1.20691 + var ow = w, oh = h; 1.20692 + var mw = this.minWidth, mh = this.minHeight; 1.20693 + var mxw = this.maxWidth, mxh = this.maxHeight; 1.20694 + var wi = this.widthIncrement; 1.20695 + var hi = this.heightIncrement; 1.20696 + 1.20697 + var eventXY = e.getXY(); 1.20698 + var diffX = -(this.startPoint[0] - Math.max(this.minX, eventXY[0])); 1.20699 + var diffY = -(this.startPoint[1] - Math.max(this.minY, eventXY[1])); 1.20700 + 1.20701 + var pos = this.activeHandle.position; 1.20702 + 1.20703 + switch(pos){ 1.20704 + case "east": 1.20705 + w += diffX; 1.20706 + w = Math.min(Math.max(mw, w), mxw); 1.20707 + break; 1.20708 + case "south": 1.20709 + h += diffY; 1.20710 + h = Math.min(Math.max(mh, h), mxh); 1.20711 + break; 1.20712 + case "southeast": 1.20713 + w += diffX; 1.20714 + h += diffY; 1.20715 + w = Math.min(Math.max(mw, w), mxw); 1.20716 + h = Math.min(Math.max(mh, h), mxh); 1.20717 + break; 1.20718 + case "north": 1.20719 + diffY = this.constrain(h, diffY, mh, mxh); 1.20720 + y += diffY; 1.20721 + h -= diffY; 1.20722 + break; 1.20723 + case "west": 1.20724 + diffX = this.constrain(w, diffX, mw, mxw); 1.20725 + x += diffX; 1.20726 + w -= diffX; 1.20727 + break; 1.20728 + case "northeast": 1.20729 + w += diffX; 1.20730 + w = Math.min(Math.max(mw, w), mxw); 1.20731 + diffY = this.constrain(h, diffY, mh, mxh); 1.20732 + y += diffY; 1.20733 + h -= diffY; 1.20734 + break; 1.20735 + case "northwest": 1.20736 + diffX = this.constrain(w, diffX, mw, mxw); 1.20737 + diffY = this.constrain(h, diffY, mh, mxh); 1.20738 + y += diffY; 1.20739 + h -= diffY; 1.20740 + x += diffX; 1.20741 + w -= diffX; 1.20742 + break; 1.20743 + case "southwest": 1.20744 + diffX = this.constrain(w, diffX, mw, mxw); 1.20745 + h += diffY; 1.20746 + h = Math.min(Math.max(mh, h), mxh); 1.20747 + x += diffX; 1.20748 + w -= diffX; 1.20749 + break; 1.20750 + } 1.20751 + 1.20752 + var sw = this.snap(w, wi, mw); 1.20753 + var sh = this.snap(h, hi, mh); 1.20754 + if(sw != w || sh != h){ 1.20755 + switch(pos){ 1.20756 + case "northeast": 1.20757 + y -= sh - h; 1.20758 + break; 1.20759 + case "north": 1.20760 + y -= sh - h; 1.20761 + break; 1.20762 + case "southwest": 1.20763 + x -= sw - w; 1.20764 + break; 1.20765 + case "west": 1.20766 + x -= sw - w; 1.20767 + break; 1.20768 + case "northwest": 1.20769 + x -= sw - w; 1.20770 + y -= sh - h; 1.20771 + break; 1.20772 + } 1.20773 + w = sw; 1.20774 + h = sh; 1.20775 + } 1.20776 + 1.20777 + if(this.preserveRatio){ 1.20778 + switch(pos){ 1.20779 + case "southeast": 1.20780 + case "east": 1.20781 + h = oh * (w/ow); 1.20782 + h = Math.min(Math.max(mh, h), mxh); 1.20783 + w = ow * (h/oh); 1.20784 + break; 1.20785 + case "south": 1.20786 + w = ow * (h/oh); 1.20787 + w = Math.min(Math.max(mw, w), mxw); 1.20788 + h = oh * (w/ow); 1.20789 + break; 1.20790 + case "northeast": 1.20791 + w = ow * (h/oh); 1.20792 + w = Math.min(Math.max(mw, w), mxw); 1.20793 + h = oh * (w/ow); 1.20794 + break; 1.20795 + case "north": 1.20796 + var tw = w; 1.20797 + w = ow * (h/oh); 1.20798 + w = Math.min(Math.max(mw, w), mxw); 1.20799 + h = oh * (w/ow); 1.20800 + x += (tw - w) / 2; 1.20801 + break; 1.20802 + case "southwest": 1.20803 + h = oh * (w/ow); 1.20804 + h = Math.min(Math.max(mh, h), mxh); 1.20805 + var tw = w; 1.20806 + w = ow * (h/oh); 1.20807 + x += tw - w; 1.20808 + break; 1.20809 + case "west": 1.20810 + var th = h; 1.20811 + h = oh * (w/ow); 1.20812 + h = Math.min(Math.max(mh, h), mxh); 1.20813 + y += (th - h) / 2; 1.20814 + var tw = w; 1.20815 + w = ow * (h/oh); 1.20816 + x += tw - w; 1.20817 + break; 1.20818 + case "northwest": 1.20819 + var tw = w; 1.20820 + var th = h; 1.20821 + h = oh * (w/ow); 1.20822 + h = Math.min(Math.max(mh, h), mxh); 1.20823 + w = ow * (h/oh); 1.20824 + y += th - h; 1.20825 + x += tw - w; 1.20826 + break; 1.20827 + 1.20828 + } 1.20829 + } 1.20830 + this.proxy.setBounds(x, y, w, h); 1.20831 + if(this.dynamic){ 1.20832 + this.resizeElement(); 1.20833 + } 1.20834 + }catch(e){} 1.20835 + } 1.20836 + }, 1.20837 + 1.20838 + 1.20839 + handleOver : function(){ 1.20840 + if(this.enabled){ 1.20841 + this.el.addClass("x-resizable-over"); 1.20842 + } 1.20843 + }, 1.20844 + 1.20845 + 1.20846 + handleOut : function(){ 1.20847 + if(!this.resizing){ 1.20848 + this.el.removeClass("x-resizable-over"); 1.20849 + } 1.20850 + }, 1.20851 + 1.20852 + 1.20853 + getEl : function(){ 1.20854 + return this.el; 1.20855 + }, 1.20856 + 1.20857 + 1.20858 + getResizeChild : function(){ 1.20859 + return this.resizeChild; 1.20860 + }, 1.20861 + 1.20862 + 1.20863 + destroy : function(removeEl){ 1.20864 + this.proxy.remove(); 1.20865 + if(this.overlay){ 1.20866 + this.overlay.removeAllListeners(); 1.20867 + this.overlay.remove(); 1.20868 + } 1.20869 + var ps = Ext.Resizable.positions; 1.20870 + for(var k in ps){ 1.20871 + if(typeof ps[k] != "function" && this[ps[k]]){ 1.20872 + var h = this[ps[k]]; 1.20873 + h.el.removeAllListeners(); 1.20874 + h.el.remove(); 1.20875 + } 1.20876 + } 1.20877 + if(removeEl){ 1.20878 + this.el.update(""); 1.20879 + this.el.remove(); 1.20880 + } 1.20881 + }, 1.20882 + 1.20883 + syncHandleHeight : function(){ 1.20884 + var h = this.el.getHeight(true); 1.20885 + if(this.west){ 1.20886 + this.west.el.setHeight(h); 1.20887 + } 1.20888 + if(this.east){ 1.20889 + this.east.el.setHeight(h); 1.20890 + } 1.20891 + } 1.20892 +}); 1.20893 + 1.20894 + 1.20895 + 1.20896 +Ext.Resizable.positions = { 1.20897 + n: "north", s: "south", e: "east", w: "west", se: "southeast", sw: "southwest", nw: "northwest", ne: "northeast" 1.20898 +}; 1.20899 + 1.20900 + 1.20901 +Ext.Resizable.Handle = function(rz, pos, disableTrackOver, transparent){ 1.20902 + if(!this.tpl){ 1.20903 + 1.20904 + var tpl = Ext.DomHelper.createTemplate( 1.20905 + {tag: "div", cls: "x-resizable-handle x-resizable-handle-{0}"} 1.20906 + ); 1.20907 + tpl.compile(); 1.20908 + Ext.Resizable.Handle.prototype.tpl = tpl; 1.20909 + } 1.20910 + this.position = pos; 1.20911 + this.rz = rz; 1.20912 + this.el = this.tpl.append(rz.el.dom, [this.position], true); 1.20913 + this.el.unselectable(); 1.20914 + if(transparent){ 1.20915 + this.el.setOpacity(0); 1.20916 + } 1.20917 + this.el.on("mousedown", this.onMouseDown, this); 1.20918 + if(!disableTrackOver){ 1.20919 + this.el.on("mouseover", this.onMouseOver, this); 1.20920 + this.el.on("mouseout", this.onMouseOut, this); 1.20921 + } 1.20922 +}; 1.20923 + 1.20924 + 1.20925 +Ext.Resizable.Handle.prototype = { 1.20926 + afterResize : function(rz){ 1.20927 + 1.20928 + }, 1.20929 + 1.20930 + onMouseDown : function(e){ 1.20931 + this.rz.onMouseDown(this, e); 1.20932 + }, 1.20933 + 1.20934 + onMouseOver : function(e){ 1.20935 + this.rz.handleOver(this, e); 1.20936 + }, 1.20937 + 1.20938 + onMouseOut : function(e){ 1.20939 + this.rz.handleOut(this, e); 1.20940 + } 1.20941 +}; 1.20942 + 1.20943 + 1.20944 + 1.20945 + 1.20946 + 1.20947 +Ext.Editor = function(field, config){ 1.20948 + this.field = field; 1.20949 + Ext.Editor.superclass.constructor.call(this, config); 1.20950 +}; 1.20951 + 1.20952 +Ext.extend(Ext.Editor, Ext.Component, { 1.20953 + 1.20954 + 1.20955 + 1.20956 + 1.20957 + 1.20958 + value : "", 1.20959 + 1.20960 + alignment: "c-c?", 1.20961 + 1.20962 + shadow : "frame", 1.20963 + 1.20964 + constrain : false, 1.20965 + 1.20966 + swallowKeys : true, 1.20967 + 1.20968 + completeOnEnter : false, 1.20969 + 1.20970 + cancelOnEsc : false, 1.20971 + 1.20972 + updateEl : false, 1.20973 + 1.20974 + initComponent : function(){ 1.20975 + Ext.Editor.superclass.initComponent.call(this); 1.20976 + this.addEvents( 1.20977 + 1.20978 + "beforestartedit", 1.20979 + 1.20980 + "startedit", 1.20981 + 1.20982 + "beforecomplete", 1.20983 + 1.20984 + "complete", 1.20985 + 1.20986 + "specialkey" 1.20987 + ); 1.20988 + }, 1.20989 + 1.20990 + onRender : function(ct, position){ 1.20991 + this.el = new Ext.Layer({ 1.20992 + shadow: this.shadow, 1.20993 + cls: "x-editor", 1.20994 + parentEl : ct, 1.20995 + shim : this.shim, 1.20996 + shadowOffset:4, 1.20997 + id: this.id, 1.20998 + constrain: this.constrain 1.20999 + }); 1.21000 + this.el.setStyle("overflow", Ext.isGecko ? "auto" : "hidden"); 1.21001 + if(this.field.msgTarget != 'title'){ 1.21002 + this.field.msgTarget = 'qtip'; 1.21003 + } 1.21004 + this.field.inEditor = true; 1.21005 + this.field.render(this.el); 1.21006 + if(Ext.isGecko){ 1.21007 + this.field.el.dom.setAttribute('autocomplete', 'off'); 1.21008 + } 1.21009 + this.field.on("specialkey", this.onSpecialKey, this); 1.21010 + if(this.swallowKeys){ 1.21011 + this.field.el.swallowEvent(['keydown','keypress']); 1.21012 + } 1.21013 + this.field.show(); 1.21014 + this.field.on("blur", this.onBlur, this); 1.21015 + if(this.field.grow){ 1.21016 + this.field.on("autosize", this.el.sync, this.el, {delay:1}); 1.21017 + } 1.21018 + }, 1.21019 + 1.21020 + onSpecialKey : function(field, e){ 1.21021 + if(this.completeOnEnter && e.getKey() == e.ENTER){ 1.21022 + e.stopEvent(); 1.21023 + this.completeEdit(); 1.21024 + }else if(this.cancelOnEsc && e.getKey() == e.ESC){ 1.21025 + this.cancelEdit(); 1.21026 + }else{ 1.21027 + this.fireEvent('specialkey', field, e); 1.21028 + } 1.21029 + }, 1.21030 + 1.21031 + 1.21032 + startEdit : function(el, value){ 1.21033 + if(this.editing){ 1.21034 + this.completeEdit(); 1.21035 + } 1.21036 + this.boundEl = Ext.get(el); 1.21037 + var v = value !== undefined ? value : this.boundEl.dom.innerHTML; 1.21038 + if(!this.rendered){ 1.21039 + this.render(this.parentEl || document.body); 1.21040 + } 1.21041 + if(this.fireEvent("beforestartedit", this, this.boundEl, v) === false){ 1.21042 + return; 1.21043 + } 1.21044 + this.startValue = v; 1.21045 + this.field.setValue(v); 1.21046 + this.doAutoSize(); 1.21047 + this.el.alignTo(this.boundEl, this.alignment); 1.21048 + this.editing = true; 1.21049 + this.show(); 1.21050 + }, 1.21051 + 1.21052 + doAutoSize : function(){ 1.21053 + if(this.autoSize){ 1.21054 + var sz = this.boundEl.getSize(); 1.21055 + switch(this.autoSize){ 1.21056 + case "width": 1.21057 + this.setSize(sz.width, ""); 1.21058 + break; 1.21059 + case "height": 1.21060 + this.setSize("", sz.height); 1.21061 + break; 1.21062 + default: 1.21063 + this.setSize(sz.width, sz.height); 1.21064 + } 1.21065 + } 1.21066 + }, 1.21067 + 1.21068 + 1.21069 + setSize : function(w, h){ 1.21070 + delete this.field.lastSize; 1.21071 + this.field.setSize(w, h); 1.21072 + if(this.el){ 1.21073 + this.el.sync(); 1.21074 + } 1.21075 + }, 1.21076 + 1.21077 + 1.21078 + realign : function(){ 1.21079 + this.el.alignTo(this.boundEl, this.alignment); 1.21080 + }, 1.21081 + 1.21082 + 1.21083 + completeEdit : function(remainVisible){ 1.21084 + if(!this.editing){ 1.21085 + return; 1.21086 + } 1.21087 + var v = this.getValue(); 1.21088 + if(this.revertInvalid !== false && !this.field.isValid()){ 1.21089 + v = this.startValue; 1.21090 + this.cancelEdit(true); 1.21091 + } 1.21092 + if(String(v) === String(this.startValue) && this.ignoreNoChange){ 1.21093 + this.editing = false; 1.21094 + this.hide(); 1.21095 + return; 1.21096 + } 1.21097 + if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){ 1.21098 + this.editing = false; 1.21099 + if(this.updateEl && this.boundEl){ 1.21100 + this.boundEl.update(v); 1.21101 + } 1.21102 + if(remainVisible !== true){ 1.21103 + this.hide(); 1.21104 + } 1.21105 + this.fireEvent("complete", this, v, this.startValue); 1.21106 + } 1.21107 + }, 1.21108 + 1.21109 + onShow : function(){ 1.21110 + this.el.show(); 1.21111 + if(this.hideEl !== false){ 1.21112 + this.boundEl.hide(); 1.21113 + } 1.21114 + this.field.show(); 1.21115 + if(Ext.isIE && !this.fixIEFocus){ this.fixIEFocus = true; 1.21116 + this.deferredFocus.defer(50, this); 1.21117 + }else{ 1.21118 + this.field.focus(); 1.21119 + } 1.21120 + this.fireEvent("startedit", this.boundEl, this.startValue); 1.21121 + }, 1.21122 + 1.21123 + deferredFocus : function(){ 1.21124 + if(this.editing){ 1.21125 + this.field.focus(); 1.21126 + } 1.21127 + }, 1.21128 + 1.21129 + 1.21130 + cancelEdit : function(remainVisible){ 1.21131 + if(this.editing){ 1.21132 + this.setValue(this.startValue); 1.21133 + if(remainVisible !== true){ 1.21134 + this.hide(); 1.21135 + } 1.21136 + } 1.21137 + }, 1.21138 + 1.21139 + onBlur : function(){ 1.21140 + if(this.allowBlur !== true && this.editing){ 1.21141 + this.completeEdit(); 1.21142 + } 1.21143 + }, 1.21144 + 1.21145 + onHide : function(){ 1.21146 + if(this.editing){ 1.21147 + this.completeEdit(); 1.21148 + return; 1.21149 + } 1.21150 + this.field.blur(); 1.21151 + if(this.field.collapse){ 1.21152 + this.field.collapse(); 1.21153 + } 1.21154 + this.el.hide(); 1.21155 + if(this.hideEl !== false){ 1.21156 + this.boundEl.show(); 1.21157 + } 1.21158 + }, 1.21159 + 1.21160 + 1.21161 + setValue : function(v){ 1.21162 + this.field.setValue(v); 1.21163 + }, 1.21164 + 1.21165 + 1.21166 + getValue : function(){ 1.21167 + return this.field.getValue(); 1.21168 + }, 1.21169 + 1.21170 + beforeDestroy : function(){ 1.21171 + this.field.destroy(); 1.21172 + this.field = null; 1.21173 + } 1.21174 +}); 1.21175 +Ext.reg('editor', Ext.Editor); 1.21176 + 1.21177 +Ext.MessageBox = function(){ 1.21178 + var dlg, opt, mask, waitTimer; 1.21179 + var bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl; 1.21180 + var buttons, activeTextEl, bwidth, iconCls = ''; 1.21181 + 1.21182 + 1.21183 + var handleButton = function(button){ 1.21184 + if(dlg.isVisible()){ 1.21185 + dlg.hide(); 1.21186 + Ext.callback(opt.fn, opt.scope||window, [button, activeTextEl.dom.value], 1); 1.21187 + } 1.21188 + }; 1.21189 + 1.21190 + 1.21191 + var handleHide = function(){ 1.21192 + if(opt && opt.cls){ 1.21193 + dlg.el.removeClass(opt.cls); 1.21194 + } 1.21195 + progressBar.reset(); 1.21196 + }; 1.21197 + 1.21198 + 1.21199 + var handleEsc = function(d, k, e){ 1.21200 + if(opt && opt.closable !== false){ 1.21201 + dlg.hide(); 1.21202 + } 1.21203 + if(e){ 1.21204 + e.stopEvent(); 1.21205 + } 1.21206 + }; 1.21207 + 1.21208 + 1.21209 + var updateButtons = function(b){ 1.21210 + var width = 0; 1.21211 + if(!b){ 1.21212 + buttons["ok"].hide(); 1.21213 + buttons["cancel"].hide(); 1.21214 + buttons["yes"].hide(); 1.21215 + buttons["no"].hide(); 1.21216 + return width; 1.21217 + } 1.21218 + dlg.footer.dom.style.display = ''; 1.21219 + for(var k in buttons){ 1.21220 + if(typeof buttons[k] != "function"){ 1.21221 + if(b[k]){ 1.21222 + buttons[k].show(); 1.21223 + buttons[k].setText(typeof b[k] == "string" ? b[k] : Ext.MessageBox.buttonText[k]); 1.21224 + width += buttons[k].el.getWidth()+15; 1.21225 + }else{ 1.21226 + buttons[k].hide(); 1.21227 + } 1.21228 + } 1.21229 + } 1.21230 + return width; 1.21231 + }; 1.21232 + 1.21233 + return { 1.21234 + 1.21235 + getDialog : function(titleText){ 1.21236 + if(!dlg){ 1.21237 + dlg = new Ext.Window({ 1.21238 + autoCreate : true, 1.21239 + title:titleText, 1.21240 + resizable:false, 1.21241 + constrain:true, 1.21242 + constrainHeader:true, 1.21243 + minimizable : false, 1.21244 + maximizable : false, 1.21245 + stateful: false, 1.21246 + modal: true, 1.21247 + shim:true, 1.21248 + buttonAlign:"center", 1.21249 + width:400, 1.21250 + height:100, 1.21251 + minHeight: 80, 1.21252 + plain:true, 1.21253 + footer:true, 1.21254 + closable:true, 1.21255 + close : function(){ 1.21256 + if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){ 1.21257 + handleButton("no"); 1.21258 + }else{ 1.21259 + handleButton("cancel"); 1.21260 + } 1.21261 + } 1.21262 + }); 1.21263 + buttons = {}; 1.21264 + var bt = this.buttonText; 1.21265 + 1.21266 + buttons["ok"] = dlg.addButton(bt["ok"], handleButton.createCallback("ok")); 1.21267 + buttons["yes"] = dlg.addButton(bt["yes"], handleButton.createCallback("yes")); 1.21268 + buttons["no"] = dlg.addButton(bt["no"], handleButton.createCallback("no")); 1.21269 + buttons["cancel"] = dlg.addButton(bt["cancel"], handleButton.createCallback("cancel")); 1.21270 + buttons["ok"].hideMode = buttons["yes"].hideMode = buttons["no"].hideMode = buttons["cancel"].hideMode = 'offsets'; 1.21271 + dlg.render(document.body); 1.21272 + dlg.getEl().addClass('x-window-dlg'); 1.21273 + mask = dlg.mask; 1.21274 + bodyEl = dlg.body.createChild({ 1.21275 + html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>' 1.21276 + }); 1.21277 + iconEl = Ext.get(bodyEl.dom.firstChild); 1.21278 + var contentEl = bodyEl.dom.childNodes[1]; 1.21279 + msgEl = Ext.get(contentEl.firstChild); 1.21280 + textboxEl = Ext.get(contentEl.childNodes[2].firstChild); 1.21281 + textboxEl.enableDisplayMode(); 1.21282 + textboxEl.addKeyListener([10,13], function(){ 1.21283 + if(dlg.isVisible() && opt && opt.buttons){ 1.21284 + if(opt.buttons.ok){ 1.21285 + handleButton("ok"); 1.21286 + }else if(opt.buttons.yes){ 1.21287 + handleButton("yes"); 1.21288 + } 1.21289 + } 1.21290 + }); 1.21291 + textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]); 1.21292 + textareaEl.enableDisplayMode(); 1.21293 + progressBar = new Ext.ProgressBar({ 1.21294 + renderTo:bodyEl 1.21295 + }); 1.21296 + bodyEl.createChild({cls:'x-clear'}); 1.21297 + } 1.21298 + return dlg; 1.21299 + }, 1.21300 + 1.21301 + 1.21302 + updateText : function(text){ 1.21303 + if(!dlg.isVisible() && !opt.width){ 1.21304 + dlg.setSize(this.maxWidth, 100); 1.21305 + } 1.21306 + msgEl.update(text || ' '); 1.21307 + 1.21308 + var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0; 1.21309 + var mw = msgEl.getWidth() + msgEl.getMargins('lr'); 1.21310 + var fw = dlg.getFrameWidth('lr'); 1.21311 + var bw = dlg.body.getFrameWidth('lr'); 1.21312 + if (Ext.isIE && iw > 0){ 1.21313 + 1.21314 + 1.21315 + iw += 3; 1.21316 + } 1.21317 + var w = Math.max(Math.min(opt.width || iw+mw+fw+bw, this.maxWidth), 1.21318 + Math.max(opt.minWidth || this.minWidth, bwidth || 0)); 1.21319 + 1.21320 + if(opt.prompt === true){ 1.21321 + activeTextEl.setWidth(w-iw-fw-bw); 1.21322 + } 1.21323 + if(opt.progress === true || opt.wait === true){ 1.21324 + progressBar.setSize(w-iw-fw-bw); 1.21325 + } 1.21326 + dlg.setSize(w, 'auto').center(); 1.21327 + return this; 1.21328 + }, 1.21329 + 1.21330 + 1.21331 + updateProgress : function(value, progressText, msg){ 1.21332 + progressBar.updateProgress(value, progressText); 1.21333 + if(msg){ 1.21334 + this.updateText(msg); 1.21335 + } 1.21336 + return this; 1.21337 + }, 1.21338 + 1.21339 + 1.21340 + isVisible : function(){ 1.21341 + return dlg && dlg.isVisible(); 1.21342 + }, 1.21343 + 1.21344 + 1.21345 + hide : function(){ 1.21346 + if(this.isVisible()){ 1.21347 + dlg.hide(); 1.21348 + handleHide(); 1.21349 + } 1.21350 + return this; 1.21351 + }, 1.21352 + 1.21353 + 1.21354 + show : function(options){ 1.21355 + if(this.isVisible()){ 1.21356 + this.hide(); 1.21357 + } 1.21358 + opt = options; 1.21359 + var d = this.getDialog(opt.title || " "); 1.21360 + 1.21361 + d.setTitle(opt.title || " "); 1.21362 + var allowClose = (opt.closable !== false && opt.progress !== true && opt.wait !== true); 1.21363 + d.tools.close.setDisplayed(allowClose); 1.21364 + activeTextEl = textboxEl; 1.21365 + opt.prompt = opt.prompt || (opt.multiline ? true : false); 1.21366 + if(opt.prompt){ 1.21367 + if(opt.multiline){ 1.21368 + textboxEl.hide(); 1.21369 + textareaEl.show(); 1.21370 + textareaEl.setHeight(typeof opt.multiline == "number" ? 1.21371 + opt.multiline : this.defaultTextHeight); 1.21372 + activeTextEl = textareaEl; 1.21373 + }else{ 1.21374 + textboxEl.show(); 1.21375 + textareaEl.hide(); 1.21376 + } 1.21377 + }else{ 1.21378 + textboxEl.hide(); 1.21379 + textareaEl.hide(); 1.21380 + } 1.21381 + activeTextEl.dom.value = opt.value || ""; 1.21382 + if(opt.prompt){ 1.21383 + d.focusEl = activeTextEl; 1.21384 + }else{ 1.21385 + var bs = opt.buttons; 1.21386 + var db = null; 1.21387 + if(bs && bs.ok){ 1.21388 + db = buttons["ok"]; 1.21389 + }else if(bs && bs.yes){ 1.21390 + db = buttons["yes"]; 1.21391 + } 1.21392 + if (db){ 1.21393 + d.focusEl = db; 1.21394 + } 1.21395 + } 1.21396 + if(opt.iconCls){ 1.21397 + d.setIconClass(opt.iconCls); 1.21398 + } 1.21399 + this.setIcon(opt.icon); 1.21400 + bwidth = updateButtons(opt.buttons); 1.21401 + progressBar.setVisible(opt.progress === true || opt.wait === true); 1.21402 + this.updateProgress(0, opt.progressText); 1.21403 + this.updateText(opt.msg); 1.21404 + if(opt.cls){ 1.21405 + d.el.addClass(opt.cls); 1.21406 + } 1.21407 + d.proxyDrag = opt.proxyDrag === true; 1.21408 + d.modal = opt.modal !== false; 1.21409 + d.mask = opt.modal !== false ? mask : false; 1.21410 + if(!d.isVisible()){ 1.21411 + 1.21412 + document.body.appendChild(dlg.el.dom); 1.21413 + d.setAnimateTarget(opt.animEl); 1.21414 + d.show(opt.animEl); 1.21415 + } 1.21416 + 1.21417 + 1.21418 + d.on('show', function(){ 1.21419 + if(allowClose === true){ 1.21420 + d.keyMap.enable(); 1.21421 + }else{ 1.21422 + d.keyMap.disable(); 1.21423 + } 1.21424 + }, this, {single:true}); 1.21425 + 1.21426 + if(opt.wait === true){ 1.21427 + progressBar.wait(opt.waitConfig); 1.21428 + } 1.21429 + return this; 1.21430 + }, 1.21431 + 1.21432 + 1.21433 + setIcon : function(icon){ 1.21434 + if(icon && icon != ''){ 1.21435 + iconEl.removeClass('x-hidden'); 1.21436 + iconEl.replaceClass(iconCls, icon); 1.21437 + iconCls = icon; 1.21438 + }else{ 1.21439 + iconEl.replaceClass(iconCls, 'x-hidden'); 1.21440 + iconCls = ''; 1.21441 + } 1.21442 + return this; 1.21443 + }, 1.21444 + 1.21445 + 1.21446 + progress : function(title, msg, progressText){ 1.21447 + this.show({ 1.21448 + title : title, 1.21449 + msg : msg, 1.21450 + buttons: false, 1.21451 + progress:true, 1.21452 + closable:false, 1.21453 + minWidth: this.minProgressWidth, 1.21454 + progressText: progressText 1.21455 + }); 1.21456 + return this; 1.21457 + }, 1.21458 + 1.21459 + 1.21460 + wait : function(msg, title, config){ 1.21461 + this.show({ 1.21462 + title : title, 1.21463 + msg : msg, 1.21464 + buttons: false, 1.21465 + closable:false, 1.21466 + wait:true, 1.21467 + modal:true, 1.21468 + minWidth: this.minProgressWidth, 1.21469 + waitConfig: config 1.21470 + }); 1.21471 + return this; 1.21472 + }, 1.21473 + 1.21474 + 1.21475 + alert : function(title, msg, fn, scope){ 1.21476 + this.show({ 1.21477 + title : title, 1.21478 + msg : msg, 1.21479 + buttons: this.OK, 1.21480 + fn: fn, 1.21481 + scope : scope 1.21482 + }); 1.21483 + return this; 1.21484 + }, 1.21485 + 1.21486 + 1.21487 + confirm : function(title, msg, fn, scope){ 1.21488 + this.show({ 1.21489 + title : title, 1.21490 + msg : msg, 1.21491 + buttons: this.YESNO, 1.21492 + fn: fn, 1.21493 + scope : scope, 1.21494 + icon: this.QUESTION 1.21495 + }); 1.21496 + return this; 1.21497 + }, 1.21498 + 1.21499 + 1.21500 + prompt : function(title, msg, fn, scope, multiline, value){ 1.21501 + this.show({ 1.21502 + title : title, 1.21503 + msg : msg, 1.21504 + buttons: this.OKCANCEL, 1.21505 + fn: fn, 1.21506 + minWidth:250, 1.21507 + scope : scope, 1.21508 + prompt:true, 1.21509 + multiline: multiline, 1.21510 + value: value 1.21511 + }); 1.21512 + return this; 1.21513 + }, 1.21514 + 1.21515 + 1.21516 + OK : {ok:true}, 1.21517 + 1.21518 + CANCEL : {cancel:true}, 1.21519 + 1.21520 + OKCANCEL : {ok:true, cancel:true}, 1.21521 + 1.21522 + YESNO : {yes:true, no:true}, 1.21523 + 1.21524 + YESNOCANCEL : {yes:true, no:true, cancel:true}, 1.21525 + 1.21526 + INFO : 'ext-mb-info', 1.21527 + 1.21528 + WARNING : 'ext-mb-warning', 1.21529 + 1.21530 + QUESTION : 'ext-mb-question', 1.21531 + 1.21532 + ERROR : 'ext-mb-error', 1.21533 + 1.21534 + 1.21535 + defaultTextHeight : 75, 1.21536 + 1.21537 + maxWidth : 600, 1.21538 + 1.21539 + minWidth : 100, 1.21540 + 1.21541 + minProgressWidth : 250, 1.21542 + 1.21543 + buttonText : { 1.21544 + ok : "OK", 1.21545 + cancel : "Cancel", 1.21546 + yes : "Yes", 1.21547 + no : "No" 1.21548 + } 1.21549 + }; 1.21550 +}(); 1.21551 + 1.21552 + 1.21553 +Ext.Msg = Ext.MessageBox; 1.21554 + 1.21555 +Ext.Tip = Ext.extend(Ext.Panel, { 1.21556 + 1.21557 + 1.21558 + 1.21559 + minWidth : 40, 1.21560 + 1.21561 + maxWidth : 300, 1.21562 + 1.21563 + shadow : "sides", 1.21564 + 1.21565 + defaultAlign : "tl-bl?", 1.21566 + autoRender: true, 1.21567 + quickShowInterval : 250, 1.21568 + 1.21569 + 1.21570 + frame:true, 1.21571 + hidden:true, 1.21572 + baseCls: 'x-tip', 1.21573 + floating:{shadow:true,shim:true,useDisplay:true,constrain:false}, 1.21574 + autoHeight:true, 1.21575 + 1.21576 + 1.21577 + initComponent : function(){ 1.21578 + Ext.Tip.superclass.initComponent.call(this); 1.21579 + if(this.closable && !this.title){ 1.21580 + this.elements += ',header'; 1.21581 + } 1.21582 + }, 1.21583 + 1.21584 + 1.21585 + afterRender : function(){ 1.21586 + Ext.Tip.superclass.afterRender.call(this); 1.21587 + if(this.closable){ 1.21588 + this.addTool({ 1.21589 + id: 'close', 1.21590 + handler: this.hide, 1.21591 + scope: this 1.21592 + }); 1.21593 + } 1.21594 + }, 1.21595 + 1.21596 + 1.21597 + showAt : function(xy){ 1.21598 + Ext.Tip.superclass.show.call(this); 1.21599 + if(this.measureWidth !== false && (!this.initialConfig || typeof this.initialConfig.width != 'number')){ 1.21600 + this.doAutoWidth(); 1.21601 + } 1.21602 + if(this.constrainPosition){ 1.21603 + xy = this.el.adjustForConstraints(xy); 1.21604 + } 1.21605 + this.setPagePosition(xy[0], xy[1]); 1.21606 + }, 1.21607 + 1.21608 + 1.21609 + doAutoWidth : function(){ 1.21610 + var bw = this.body.getTextWidth(); 1.21611 + if(this.title){ 1.21612 + bw = Math.max(bw, this.header.child('span').getTextWidth(this.title)); 1.21613 + } 1.21614 + bw += this.getFrameWidth() + (this.closable ? 20 : 0) + this.body.getPadding("lr"); 1.21615 + this.setWidth(bw.constrain(this.minWidth, this.maxWidth)); 1.21616 + }, 1.21617 + 1.21618 + 1.21619 + showBy : function(el, pos){ 1.21620 + if(!this.rendered){ 1.21621 + this.render(Ext.getBody()); 1.21622 + } 1.21623 + this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign)); 1.21624 + }, 1.21625 + 1.21626 + initDraggable : function(){ 1.21627 + this.dd = new Ext.Tip.DD(this, typeof this.draggable == 'boolean' ? null : this.draggable); 1.21628 + this.header.addClass('x-tip-draggable'); 1.21629 + } 1.21630 +}); 1.21631 + 1.21632 + 1.21633 +Ext.Tip.DD = function(tip, config){ 1.21634 + Ext.apply(this, config); 1.21635 + this.tip = tip; 1.21636 + Ext.Tip.DD.superclass.constructor.call(this, tip.el.id, 'WindowDD-'+tip.id); 1.21637 + this.setHandleElId(tip.header.id); 1.21638 + this.scroll = false; 1.21639 +}; 1.21640 + 1.21641 +Ext.extend(Ext.Tip.DD, Ext.dd.DD, { 1.21642 + moveOnly:true, 1.21643 + scroll:false, 1.21644 + headerOffsets:[100, 25], 1.21645 + startDrag : function(){ 1.21646 + this.tip.el.disableShadow(); 1.21647 + }, 1.21648 + endDrag : function(e){ 1.21649 + this.tip.el.enableShadow(true); 1.21650 + } 1.21651 +}); 1.21652 + 1.21653 +Ext.ToolTip = Ext.extend(Ext.Tip, { 1.21654 + 1.21655 + 1.21656 + 1.21657 + showDelay: 500, 1.21658 + 1.21659 + hideDelay: 200, 1.21660 + 1.21661 + dismissDelay: 5000, 1.21662 + 1.21663 + mouseOffset: [15,18], 1.21664 + 1.21665 + trackMouse : false, 1.21666 + constrainPosition: true, 1.21667 + 1.21668 + 1.21669 + initComponent: function(){ 1.21670 + Ext.ToolTip.superclass.initComponent.call(this); 1.21671 + this.lastActive = new Date(); 1.21672 + this.initTarget(); 1.21673 + }, 1.21674 + 1.21675 + 1.21676 + initTarget : function(){ 1.21677 + if(this.target){ 1.21678 + this.target = Ext.get(this.target); 1.21679 + this.target.on('mouseover', this.onTargetOver, this); 1.21680 + this.target.on('mouseout', this.onTargetOut, this); 1.21681 + this.target.on('mousemove', this.onMouseMove, this); 1.21682 + } 1.21683 + }, 1.21684 + 1.21685 + 1.21686 + onMouseMove : function(e){ 1.21687 + this.targetXY = e.getXY(); 1.21688 + if(!this.hidden && this.trackMouse){ 1.21689 + this.setPagePosition(this.getTargetXY()); 1.21690 + } 1.21691 + }, 1.21692 + 1.21693 + 1.21694 + getTargetXY : function(){ 1.21695 + return [this.targetXY[0]+this.mouseOffset[0], this.targetXY[1]+this.mouseOffset[1]]; 1.21696 + }, 1.21697 + 1.21698 + 1.21699 + onTargetOver : function(e){ 1.21700 + if(this.disabled || e.within(this.target.dom, true)){ 1.21701 + return; 1.21702 + } 1.21703 + this.clearTimer('hide'); 1.21704 + this.targetXY = e.getXY(); 1.21705 + this.delayShow(); 1.21706 + }, 1.21707 + 1.21708 + 1.21709 + delayShow : function(){ 1.21710 + if(this.hidden && !this.showTimer){ 1.21711 + if(this.lastActive.getElapsed() < this.quickShowInterval){ 1.21712 + this.show(); 1.21713 + }else{ 1.21714 + this.showTimer = this.show.defer(this.showDelay, this); 1.21715 + } 1.21716 + }else if(!this.hidden && this.autoHide !== false){ 1.21717 + this.show(); 1.21718 + } 1.21719 + }, 1.21720 + 1.21721 + 1.21722 + onTargetOut : function(e){ 1.21723 + if(this.disabled || e.within(this.target.dom, true)){ 1.21724 + return; 1.21725 + } 1.21726 + this.clearTimer('show'); 1.21727 + if(this.autoHide !== false){ 1.21728 + this.delayHide(); 1.21729 + } 1.21730 + }, 1.21731 + 1.21732 + 1.21733 + delayHide : function(){ 1.21734 + if(!this.hidden && !this.hideTimer){ 1.21735 + this.hideTimer = this.hide.defer(this.hideDelay, this); 1.21736 + } 1.21737 + }, 1.21738 + 1.21739 + 1.21740 + hide: function(){ 1.21741 + this.clearTimer('dismiss'); 1.21742 + this.lastActive = new Date(); 1.21743 + Ext.ToolTip.superclass.hide.call(this); 1.21744 + }, 1.21745 + 1.21746 + 1.21747 + show : function(){ 1.21748 + this.showAt(this.getTargetXY()); 1.21749 + }, 1.21750 + 1.21751 + 1.21752 + showAt : function(xy){ 1.21753 + this.lastActive = new Date(); 1.21754 + this.clearTimers(); 1.21755 + Ext.ToolTip.superclass.showAt.call(this, xy); 1.21756 + if(this.dismissDelay && this.autoHide !== false){ 1.21757 + this.dismissTimer = this.hide.defer(this.dismissDelay, this); 1.21758 + } 1.21759 + }, 1.21760 + 1.21761 + 1.21762 + clearTimer : function(name){ 1.21763 + name = name + 'Timer'; 1.21764 + clearTimeout(this[name]); 1.21765 + delete this[name]; 1.21766 + }, 1.21767 + 1.21768 + 1.21769 + clearTimers : function(){ 1.21770 + this.clearTimer('show'); 1.21771 + this.clearTimer('dismiss'); 1.21772 + this.clearTimer('hide'); 1.21773 + }, 1.21774 + 1.21775 + 1.21776 + onShow : function(){ 1.21777 + Ext.ToolTip.superclass.onShow.call(this); 1.21778 + Ext.getDoc().on('mousedown', this.onDocMouseDown, this); 1.21779 + }, 1.21780 + 1.21781 + 1.21782 + onHide : function(){ 1.21783 + Ext.ToolTip.superclass.onHide.call(this); 1.21784 + Ext.getDoc().un('mousedown', this.onDocMouseDown, this); 1.21785 + }, 1.21786 + 1.21787 + 1.21788 + onDocMouseDown : function(e){ 1.21789 + if(this.autoHide !== false && !e.within(this.el.dom)){ 1.21790 + this.disable(); 1.21791 + this.enable.defer(100, this); 1.21792 + } 1.21793 + }, 1.21794 + 1.21795 + 1.21796 + onDisable : function(){ 1.21797 + this.clearTimers(); 1.21798 + this.hide(); 1.21799 + }, 1.21800 + 1.21801 + 1.21802 + adjustPosition : function(x, y){ 1.21803 + 1.21804 + var ay = this.targetXY[1], h = this.getSize().height; 1.21805 + if(this.constrainPosition && y <= ay && (y+h) >= ay){ 1.21806 + y = ay-h-5; 1.21807 + } 1.21808 + return {x : x, y: y}; 1.21809 + }, 1.21810 + 1.21811 + 1.21812 + onDestroy : function(){ 1.21813 + Ext.ToolTip.superclass.onDestroy.call(this); 1.21814 + if(this.target){ 1.21815 + this.target.un('mouseover', this.onTargetOver, this); 1.21816 + this.target.un('mouseout', this.onTargetOut, this); 1.21817 + this.target.un('mousemove', this.onMouseMove, this); 1.21818 + } 1.21819 + } 1.21820 +}); 1.21821 + 1.21822 +Ext.QuickTip = Ext.extend(Ext.ToolTip, { 1.21823 + 1.21824 + 1.21825 + interceptTitles : false, 1.21826 + 1.21827 + 1.21828 + tagConfig : { 1.21829 + namespace : "ext", 1.21830 + attribute : "qtip", 1.21831 + width : "qwidth", 1.21832 + target : "target", 1.21833 + title : "qtitle", 1.21834 + hide : "hide", 1.21835 + cls : "qclass", 1.21836 + align : "qalign" 1.21837 + }, 1.21838 + 1.21839 + 1.21840 + initComponent : function(){ 1.21841 + this.target = this.target || Ext.getDoc(); 1.21842 + this.targets = this.targets || {}; 1.21843 + Ext.QuickTip.superclass.initComponent.call(this); 1.21844 + }, 1.21845 + 1.21846 + 1.21847 + register : function(config){ 1.21848 + var cs = Ext.isArray(config) ? config : arguments; 1.21849 + for(var i = 0, len = cs.length; i < len; i++){ 1.21850 + var c = cs[i]; 1.21851 + var target = c.target; 1.21852 + if(target){ 1.21853 + if(Ext.isArray(target)){ 1.21854 + for(var j = 0, jlen = target.length; j < jlen; j++){ 1.21855 + this.targets[Ext.id(target[j])] = c; 1.21856 + } 1.21857 + } else{ 1.21858 + this.targets[Ext.id(target)] = c; 1.21859 + } 1.21860 + } 1.21861 + } 1.21862 + }, 1.21863 + 1.21864 + 1.21865 + unregister : function(el){ 1.21866 + delete this.targets[Ext.id(el)]; 1.21867 + }, 1.21868 + 1.21869 + 1.21870 + onTargetOver : function(e){ 1.21871 + if(this.disabled){ 1.21872 + return; 1.21873 + } 1.21874 + this.targetXY = e.getXY(); 1.21875 + var t = e.getTarget(); 1.21876 + if(!t || t.nodeType !== 1 || t == document || t == document.body){ 1.21877 + return; 1.21878 + } 1.21879 + if(this.activeTarget && t == this.activeTarget.el){ 1.21880 + this.clearTimer('hide'); 1.21881 + this.show(); 1.21882 + return; 1.21883 + } 1.21884 + if(t && this.targets[t.id]){ 1.21885 + this.activeTarget = this.targets[t.id]; 1.21886 + this.activeTarget.el = t; 1.21887 + this.delayShow(); 1.21888 + return; 1.21889 + } 1.21890 + var ttp, et = Ext.fly(t), cfg = this.tagConfig; 1.21891 + var ns = cfg.namespace; 1.21892 + if(this.interceptTitles && t.title){ 1.21893 + ttp = t.title; 1.21894 + t.qtip = ttp; 1.21895 + t.removeAttribute("title"); 1.21896 + e.preventDefault(); 1.21897 + } else{ 1.21898 + ttp = t.qtip || et.getAttributeNS(ns, cfg.attribute); 1.21899 + } 1.21900 + if(ttp){ 1.21901 + var autoHide = et.getAttributeNS(ns, cfg.hide); 1.21902 + this.activeTarget = { 1.21903 + el: t, 1.21904 + text: ttp, 1.21905 + width: et.getAttributeNS(ns, cfg.width), 1.21906 + autoHide: autoHide != "user" && autoHide !== 'false', 1.21907 + title: et.getAttributeNS(ns, cfg.title), 1.21908 + cls: et.getAttributeNS(ns, cfg.cls), 1.21909 + align: et.getAttributeNS(ns, cfg.align) 1.21910 + }; 1.21911 + this.delayShow(); 1.21912 + } 1.21913 + }, 1.21914 + 1.21915 + 1.21916 + onTargetOut : function(e){ 1.21917 + this.clearTimer('show'); 1.21918 + if(this.autoHide !== false){ 1.21919 + this.delayHide(); 1.21920 + } 1.21921 + }, 1.21922 + 1.21923 + 1.21924 + showAt : function(xy){ 1.21925 + var t = this.activeTarget; 1.21926 + if(t){ 1.21927 + if(!this.rendered){ 1.21928 + this.render(Ext.getBody()); 1.21929 + this.activeTarget = t; 1.21930 + } 1.21931 + if(t.width){ 1.21932 + this.setWidth(t.width); 1.21933 + this.body.setWidth(this.adjustBodyWidth(t.width - this.getFrameWidth())); 1.21934 + this.measureWidth = false; 1.21935 + } else{ 1.21936 + this.measureWidth = true; 1.21937 + } 1.21938 + this.setTitle(t.title || ''); 1.21939 + this.body.update(t.text); 1.21940 + this.autoHide = t.autoHide; 1.21941 + this.dismissDelay = t.dismissDelay || this.dismissDelay; 1.21942 + if(this.lastCls){ 1.21943 + this.el.removeClass(this.lastCls); 1.21944 + delete this.lastCls; 1.21945 + } 1.21946 + if(t.cls){ 1.21947 + this.el.addClass(t.cls); 1.21948 + this.lastCls = t.cls; 1.21949 + } 1.21950 + if(t.align){ 1.21951 + xy = this.el.getAlignToXY(t.el, t.align); 1.21952 + this.constrainPosition = false; 1.21953 + } else{ 1.21954 + this.constrainPosition = true; 1.21955 + } 1.21956 + } 1.21957 + Ext.QuickTip.superclass.showAt.call(this, xy); 1.21958 + }, 1.21959 + 1.21960 + 1.21961 + hide: function(){ 1.21962 + delete this.activeTarget; 1.21963 + Ext.QuickTip.superclass.hide.call(this); 1.21964 + } 1.21965 +}); 1.21966 + 1.21967 +Ext.QuickTips = function(){ 1.21968 + var tip, locks = []; 1.21969 + return { 1.21970 + 1.21971 + init : function(){ 1.21972 + if(!tip){ 1.21973 + tip = new Ext.QuickTip({elements:'header,body'}); 1.21974 + } 1.21975 + }, 1.21976 + 1.21977 + 1.21978 + enable : function(){ 1.21979 + if(tip){ 1.21980 + locks.pop(); 1.21981 + if(locks.length < 1){ 1.21982 + tip.enable(); 1.21983 + } 1.21984 + } 1.21985 + }, 1.21986 + 1.21987 + 1.21988 + disable : function(){ 1.21989 + if(tip){ 1.21990 + tip.disable(); 1.21991 + } 1.21992 + locks.push(1); 1.21993 + }, 1.21994 + 1.21995 + 1.21996 + isEnabled : function(){ 1.21997 + return tip !== undefined && !tip.disabled; 1.21998 + }, 1.21999 + 1.22000 + 1.22001 + getQuickTip : function(){ 1.22002 + return tip; 1.22003 + }, 1.22004 + 1.22005 + 1.22006 + register : function(){ 1.22007 + tip.register.apply(tip, arguments); 1.22008 + }, 1.22009 + 1.22010 + 1.22011 + unregister : function(){ 1.22012 + tip.unregister.apply(tip, arguments); 1.22013 + }, 1.22014 + 1.22015 + 1.22016 + tips :function(){ 1.22017 + tip.register.apply(tip, arguments); 1.22018 + } 1.22019 + } 1.22020 +}(); 1.22021 + 1.22022 +Ext.tree.TreePanel = Ext.extend(Ext.Panel, { 1.22023 + rootVisible : true, 1.22024 + animate: Ext.enableFx, 1.22025 + lines : true, 1.22026 + enableDD : false, 1.22027 + hlDrop : Ext.enableFx, 1.22028 + pathSeparator: "/", 1.22029 + 1.22030 + initComponent : function(){ 1.22031 + Ext.tree.TreePanel.superclass.initComponent.call(this); 1.22032 + 1.22033 + if(!this.eventModel){ 1.22034 + this.eventModel = new Ext.tree.TreeEventModel(this); 1.22035 + } 1.22036 + 1.22037 + this.nodeHash = {}; 1.22038 + 1.22039 + 1.22040 + if(this.root){ 1.22041 + this.setRootNode(this.root); 1.22042 + } 1.22043 + 1.22044 + this.addEvents( 1.22045 + 1.22046 + 1.22047 + "append", 1.22048 + 1.22049 + "remove", 1.22050 + 1.22051 + "movenode", 1.22052 + 1.22053 + "insert", 1.22054 + 1.22055 + "beforeappend", 1.22056 + 1.22057 + "beforeremove", 1.22058 + 1.22059 + "beforemovenode", 1.22060 + 1.22061 + "beforeinsert", 1.22062 + 1.22063 + 1.22064 + "beforeload", 1.22065 + 1.22066 + "load", 1.22067 + 1.22068 + "textchange", 1.22069 + 1.22070 + "beforeexpandnode", 1.22071 + 1.22072 + "beforecollapsenode", 1.22073 + 1.22074 + "expandnode", 1.22075 + 1.22076 + "disabledchange", 1.22077 + 1.22078 + "collapsenode", 1.22079 + 1.22080 + "beforeclick", 1.22081 + 1.22082 + "click", 1.22083 + 1.22084 + "checkchange", 1.22085 + 1.22086 + "dblclick", 1.22087 + 1.22088 + "contextmenu", 1.22089 + 1.22090 + "beforechildrenrendered", 1.22091 + 1.22092 + "startdrag", 1.22093 + 1.22094 + "enddrag", 1.22095 + 1.22096 + "dragdrop", 1.22097 + 1.22098 + "beforenodedrop", 1.22099 + 1.22100 + "nodedrop", 1.22101 + 1.22102 + "nodedragover" 1.22103 + ); 1.22104 + if(this.singleExpand){ 1.22105 + this.on("beforeexpandnode", this.restrictExpand, this); 1.22106 + } 1.22107 + }, 1.22108 + 1.22109 + 1.22110 + proxyNodeEvent : function(ename, a1, a2, a3, a4, a5, a6){ 1.22111 + if(ename == 'collapse' || ename == 'expand' || ename == 'beforecollapse' || ename == 'beforeexpand' || ename == 'move' || ename == 'beforemove'){ 1.22112 + ename = ename+'node'; 1.22113 + } 1.22114 + 1.22115 + return this.fireEvent(ename, a1, a2, a3, a4, a5, a6); 1.22116 + }, 1.22117 + 1.22118 + 1.22119 + 1.22120 + getRootNode : function(){ 1.22121 + return this.root; 1.22122 + }, 1.22123 + 1.22124 + 1.22125 + setRootNode : function(node){ 1.22126 + this.root = node; 1.22127 + node.ownerTree = this; 1.22128 + node.isRoot = true; 1.22129 + this.registerNode(node); 1.22130 + if(!this.rootVisible){ 1.22131 + var uiP = node.attributes.uiProvider; 1.22132 + node.ui = uiP ? new uiP(node) : new Ext.tree.RootTreeNodeUI(node); 1.22133 + } 1.22134 + return node; 1.22135 + }, 1.22136 + 1.22137 + 1.22138 + getNodeById : function(id){ 1.22139 + return this.nodeHash[id]; 1.22140 + }, 1.22141 + 1.22142 + 1.22143 + registerNode : function(node){ 1.22144 + this.nodeHash[node.id] = node; 1.22145 + }, 1.22146 + 1.22147 + 1.22148 + unregisterNode : function(node){ 1.22149 + delete this.nodeHash[node.id]; 1.22150 + }, 1.22151 + 1.22152 + 1.22153 + toString : function(){ 1.22154 + return "[Tree"+(this.id?" "+this.id:"")+"]"; 1.22155 + }, 1.22156 + 1.22157 + 1.22158 + restrictExpand : function(node){ 1.22159 + var p = node.parentNode; 1.22160 + if(p){ 1.22161 + if(p.expandedChild && p.expandedChild.parentNode == p){ 1.22162 + p.expandedChild.collapse(); 1.22163 + } 1.22164 + p.expandedChild = node; 1.22165 + } 1.22166 + }, 1.22167 + 1.22168 + 1.22169 + getChecked : function(a, startNode){ 1.22170 + startNode = startNode || this.root; 1.22171 + var r = []; 1.22172 + var f = function(){ 1.22173 + if(this.attributes.checked){ 1.22174 + r.push(!a ? this : (a == 'id' ? this.id : this.attributes[a])); 1.22175 + } 1.22176 + } 1.22177 + startNode.cascade(f); 1.22178 + return r; 1.22179 + }, 1.22180 + 1.22181 + 1.22182 + getEl : function(){ 1.22183 + return this.el; 1.22184 + }, 1.22185 + 1.22186 + 1.22187 + getLoader : function(){ 1.22188 + return this.loader; 1.22189 + }, 1.22190 + 1.22191 + 1.22192 + expandAll : function(){ 1.22193 + this.root.expand(true); 1.22194 + }, 1.22195 + 1.22196 + 1.22197 + collapseAll : function(){ 1.22198 + this.root.collapse(true); 1.22199 + }, 1.22200 + 1.22201 + 1.22202 + getSelectionModel : function(){ 1.22203 + if(!this.selModel){ 1.22204 + this.selModel = new Ext.tree.DefaultSelectionModel(); 1.22205 + } 1.22206 + return this.selModel; 1.22207 + }, 1.22208 + 1.22209 + 1.22210 + expandPath : function(path, attr, callback){ 1.22211 + attr = attr || "id"; 1.22212 + var keys = path.split(this.pathSeparator); 1.22213 + var curNode = this.root; 1.22214 + if(curNode.attributes[attr] != keys[1]){ 1.22215 + if(callback){ 1.22216 + callback(false, null); 1.22217 + } 1.22218 + return; 1.22219 + } 1.22220 + var index = 1; 1.22221 + var f = function(){ 1.22222 + if(++index == keys.length){ 1.22223 + if(callback){ 1.22224 + callback(true, curNode); 1.22225 + } 1.22226 + return; 1.22227 + } 1.22228 + var c = curNode.findChild(attr, keys[index]); 1.22229 + if(!c){ 1.22230 + if(callback){ 1.22231 + callback(false, curNode); 1.22232 + } 1.22233 + return; 1.22234 + } 1.22235 + curNode = c; 1.22236 + c.expand(false, false, f); 1.22237 + }; 1.22238 + curNode.expand(false, false, f); 1.22239 + }, 1.22240 + 1.22241 + 1.22242 + selectPath : function(path, attr, callback){ 1.22243 + attr = attr || "id"; 1.22244 + var keys = path.split(this.pathSeparator); 1.22245 + var v = keys.pop(); 1.22246 + if(keys.length > 0){ 1.22247 + var f = function(success, node){ 1.22248 + if(success && node){ 1.22249 + var n = node.findChild(attr, v); 1.22250 + if(n){ 1.22251 + n.select(); 1.22252 + if(callback){ 1.22253 + callback(true, n); 1.22254 + } 1.22255 + }else if(callback){ 1.22256 + callback(false, n); 1.22257 + } 1.22258 + }else{ 1.22259 + if(callback){ 1.22260 + callback(false, n); 1.22261 + } 1.22262 + } 1.22263 + }; 1.22264 + this.expandPath(keys.join(this.pathSeparator), attr, f); 1.22265 + }else{ 1.22266 + this.root.select(); 1.22267 + if(callback){ 1.22268 + callback(true, this.root); 1.22269 + } 1.22270 + } 1.22271 + }, 1.22272 + 1.22273 + 1.22274 + getTreeEl : function(){ 1.22275 + return this.body; 1.22276 + }, 1.22277 + 1.22278 + 1.22279 + onRender : function(ct, position){ 1.22280 + Ext.tree.TreePanel.superclass.onRender.call(this, ct, position); 1.22281 + this.el.addClass('x-tree'); 1.22282 + this.innerCt = this.body.createChild({tag:"ul", 1.22283 + cls:"x-tree-root-ct " + 1.22284 + (this.useArrows ? 'x-tree-arrows' : this.lines ? "x-tree-lines" : "x-tree-no-lines")}); 1.22285 + }, 1.22286 + 1.22287 + 1.22288 + initEvents : function(){ 1.22289 + Ext.tree.TreePanel.superclass.initEvents.call(this); 1.22290 + 1.22291 + if(this.containerScroll){ 1.22292 + Ext.dd.ScrollManager.register(this.body); 1.22293 + } 1.22294 + if((this.enableDD || this.enableDrop) && !this.dropZone){ 1.22295 + 1.22296 + this.dropZone = new Ext.tree.TreeDropZone(this, this.dropConfig || { 1.22297 + ddGroup: this.ddGroup || "TreeDD", appendOnly: this.ddAppendOnly === true 1.22298 + }); 1.22299 + } 1.22300 + if((this.enableDD || this.enableDrag) && !this.dragZone){ 1.22301 + 1.22302 + this.dragZone = new Ext.tree.TreeDragZone(this, this.dragConfig || { 1.22303 + ddGroup: this.ddGroup || "TreeDD", 1.22304 + scroll: this.ddScroll 1.22305 + }); 1.22306 + } 1.22307 + this.getSelectionModel().init(this); 1.22308 + }, 1.22309 + 1.22310 + 1.22311 + afterRender : function(){ 1.22312 + Ext.tree.TreePanel.superclass.afterRender.call(this); 1.22313 + this.root.render(); 1.22314 + if(!this.rootVisible){ 1.22315 + this.root.renderChildren(); 1.22316 + } 1.22317 + }, 1.22318 + 1.22319 + onDestroy : function(){ 1.22320 + if(this.rendered){ 1.22321 + this.body.removeAllListeners(); 1.22322 + Ext.dd.ScrollManager.unregister(this.body); 1.22323 + if(this.dropZone){ 1.22324 + this.dropZone.unreg(); 1.22325 + } 1.22326 + if(this.dragZone){ 1.22327 + this.dragZone.unreg(); 1.22328 + } 1.22329 + } 1.22330 + this.root.destroy(); 1.22331 + this.nodeHash = null; 1.22332 + Ext.tree.TreePanel.superclass.onDestroy.call(this); 1.22333 + } 1.22334 + 1.22335 + 1.22336 + 1.22337 + 1.22338 + 1.22339 + 1.22340 + 1.22341 + 1.22342 + 1.22343 + 1.22344 + 1.22345 + 1.22346 + 1.22347 + 1.22348 + 1.22349 + 1.22350 + 1.22351 + 1.22352 + 1.22353 + 1.22354 + 1.22355 + 1.22356 + 1.22357 + 1.22358 + 1.22359 + 1.22360 + 1.22361 + 1.22362 + 1.22363 + 1.22364 + 1.22365 + 1.22366 + 1.22367 + 1.22368 + 1.22369 + 1.22370 + 1.22371 + 1.22372 + 1.22373 + 1.22374 + 1.22375 + 1.22376 + 1.22377 + 1.22378 + 1.22379 + 1.22380 + 1.22381 +}); 1.22382 +Ext.reg('treepanel', Ext.tree.TreePanel); 1.22383 +Ext.tree.TreeEventModel = function(tree){ 1.22384 + this.tree = tree; 1.22385 + this.tree.on('render', this.initEvents, this); 1.22386 +} 1.22387 + 1.22388 +Ext.tree.TreeEventModel.prototype = { 1.22389 + initEvents : function(){ 1.22390 + var el = this.tree.getTreeEl(); 1.22391 + el.on('click', this.delegateClick, this); 1.22392 + if(this.tree.trackMouseOver !== false){ 1.22393 + el.on('mouseover', this.delegateOver, this); 1.22394 + el.on('mouseout', this.delegateOut, this); 1.22395 + } 1.22396 + el.on('dblclick', this.delegateDblClick, this); 1.22397 + el.on('contextmenu', this.delegateContextMenu, this); 1.22398 + }, 1.22399 + 1.22400 + getNode : function(e){ 1.22401 + var t; 1.22402 + if(t = e.getTarget('.x-tree-node-el', 10)){ 1.22403 + var id = Ext.fly(t, '_treeEvents').getAttributeNS('ext', 'tree-node-id'); 1.22404 + if(id){ 1.22405 + return this.tree.getNodeById(id); 1.22406 + } 1.22407 + } 1.22408 + return null; 1.22409 + }, 1.22410 + 1.22411 + getNodeTarget : function(e){ 1.22412 + var t = e.getTarget('.x-tree-node-icon', 1); 1.22413 + if(!t){ 1.22414 + t = e.getTarget('.x-tree-node-el', 6); 1.22415 + } 1.22416 + return t; 1.22417 + }, 1.22418 + 1.22419 + delegateOut : function(e, t){ 1.22420 + if(!this.beforeEvent(e)){ 1.22421 + return; 1.22422 + } 1.22423 + if(e.getTarget('.x-tree-ec-icon', 1)){ 1.22424 + var n = this.getNode(e); 1.22425 + this.onIconOut(e, n); 1.22426 + if(n == this.lastEcOver){ 1.22427 + delete this.lastEcOver; 1.22428 + } 1.22429 + } 1.22430 + if((t = this.getNodeTarget(e)) && !e.within(t, true)){ 1.22431 + this.onNodeOut(e, this.getNode(e)); 1.22432 + } 1.22433 + }, 1.22434 + 1.22435 + delegateOver : function(e, t){ 1.22436 + if(!this.beforeEvent(e)){ 1.22437 + return; 1.22438 + } 1.22439 + if(this.lastEcOver){ 1.22440 + this.onIconOut(e, this.lastEcOver); 1.22441 + delete this.lastEcOver; 1.22442 + } 1.22443 + if(e.getTarget('.x-tree-ec-icon', 1)){ 1.22444 + this.lastEcOver = this.getNode(e); 1.22445 + this.onIconOver(e, this.lastEcOver); 1.22446 + } 1.22447 + if(t = this.getNodeTarget(e)){ 1.22448 + this.onNodeOver(e, this.getNode(e)); 1.22449 + } 1.22450 + }, 1.22451 + 1.22452 + delegateClick : function(e, t){ 1.22453 + if(!this.beforeEvent(e)){ 1.22454 + return; 1.22455 + } 1.22456 + 1.22457 + if(e.getTarget('input[type=checkbox]', 1)){ 1.22458 + this.onCheckboxClick(e, this.getNode(e)); 1.22459 + } 1.22460 + else if(e.getTarget('.x-tree-ec-icon', 1)){ 1.22461 + this.onIconClick(e, this.getNode(e)); 1.22462 + } 1.22463 + else if(this.getNodeTarget(e)){ 1.22464 + this.onNodeClick(e, this.getNode(e)); 1.22465 + } 1.22466 + }, 1.22467 + 1.22468 + delegateDblClick : function(e, t){ 1.22469 + if(this.beforeEvent(e) && this.getNodeTarget(e)){ 1.22470 + this.onNodeDblClick(e, this.getNode(e)); 1.22471 + } 1.22472 + }, 1.22473 + 1.22474 + delegateContextMenu : function(e, t){ 1.22475 + if(this.beforeEvent(e) && this.getNodeTarget(e)){ 1.22476 + this.onNodeContextMenu(e, this.getNode(e)); 1.22477 + } 1.22478 + }, 1.22479 + 1.22480 + onNodeClick : function(e, node){ 1.22481 + node.ui.onClick(e); 1.22482 + }, 1.22483 + 1.22484 + onNodeOver : function(e, node){ 1.22485 + node.ui.onOver(e); 1.22486 + }, 1.22487 + 1.22488 + onNodeOut : function(e, node){ 1.22489 + node.ui.onOut(e); 1.22490 + }, 1.22491 + 1.22492 + onIconOver : function(e, node){ 1.22493 + node.ui.addClass('x-tree-ec-over'); 1.22494 + }, 1.22495 + 1.22496 + onIconOut : function(e, node){ 1.22497 + node.ui.removeClass('x-tree-ec-over'); 1.22498 + }, 1.22499 + 1.22500 + onIconClick : function(e, node){ 1.22501 + node.ui.ecClick(e); 1.22502 + }, 1.22503 + 1.22504 + onCheckboxClick : function(e, node){ 1.22505 + node.ui.onCheckChange(e); 1.22506 + }, 1.22507 + 1.22508 + onNodeDblClick : function(e, node){ 1.22509 + node.ui.onDblClick(e); 1.22510 + }, 1.22511 + 1.22512 + onNodeContextMenu : function(e, node){ 1.22513 + node.ui.onContextMenu(e); 1.22514 + }, 1.22515 + 1.22516 + beforeEvent : function(e){ 1.22517 + if(this.disabled){ 1.22518 + e.stopEvent(); 1.22519 + return false; 1.22520 + } 1.22521 + return true; 1.22522 + }, 1.22523 + 1.22524 + disable: function(){ 1.22525 + this.disabled = true; 1.22526 + }, 1.22527 + 1.22528 + enable: function(){ 1.22529 + this.disabled = false; 1.22530 + } 1.22531 +}; 1.22532 + 1.22533 +Ext.tree.DefaultSelectionModel = function(config){ 1.22534 + this.selNode = null; 1.22535 + 1.22536 + this.addEvents( 1.22537 + 1.22538 + "selectionchange", 1.22539 + 1.22540 + 1.22541 + "beforeselect" 1.22542 + ); 1.22543 + 1.22544 + Ext.apply(this, config); 1.22545 + Ext.tree.DefaultSelectionModel.superclass.constructor.call(this); 1.22546 +}; 1.22547 + 1.22548 +Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, { 1.22549 + init : function(tree){ 1.22550 + this.tree = tree; 1.22551 + tree.getTreeEl().on("keydown", this.onKeyDown, this); 1.22552 + tree.on("click", this.onNodeClick, this); 1.22553 + }, 1.22554 + 1.22555 + onNodeClick : function(node, e){ 1.22556 + this.select(node); 1.22557 + }, 1.22558 + 1.22559 + 1.22560 + select : function(node){ 1.22561 + var last = this.selNode; 1.22562 + if(last != node && this.fireEvent('beforeselect', this, node, last) !== false){ 1.22563 + if(last){ 1.22564 + last.ui.onSelectedChange(false); 1.22565 + } 1.22566 + this.selNode = node; 1.22567 + node.ui.onSelectedChange(true); 1.22568 + this.fireEvent("selectionchange", this, node, last); 1.22569 + } 1.22570 + return node; 1.22571 + }, 1.22572 + 1.22573 + 1.22574 + unselect : function(node){ 1.22575 + if(this.selNode == node){ 1.22576 + this.clearSelections(); 1.22577 + } 1.22578 + }, 1.22579 + 1.22580 + 1.22581 + clearSelections : function(){ 1.22582 + var n = this.selNode; 1.22583 + if(n){ 1.22584 + n.ui.onSelectedChange(false); 1.22585 + this.selNode = null; 1.22586 + this.fireEvent("selectionchange", this, null); 1.22587 + } 1.22588 + return n; 1.22589 + }, 1.22590 + 1.22591 + 1.22592 + getSelectedNode : function(){ 1.22593 + return this.selNode; 1.22594 + }, 1.22595 + 1.22596 + 1.22597 + isSelected : function(node){ 1.22598 + return this.selNode == node; 1.22599 + }, 1.22600 + 1.22601 + 1.22602 + selectPrevious : function(){ 1.22603 + var s = this.selNode || this.lastSelNode; 1.22604 + if(!s){ 1.22605 + return null; 1.22606 + } 1.22607 + var ps = s.previousSibling; 1.22608 + if(ps){ 1.22609 + if(!ps.isExpanded() || ps.childNodes.length < 1){ 1.22610 + return this.select(ps); 1.22611 + } else{ 1.22612 + var lc = ps.lastChild; 1.22613 + while(lc && lc.isExpanded() && lc.childNodes.length > 0){ 1.22614 + lc = lc.lastChild; 1.22615 + } 1.22616 + return this.select(lc); 1.22617 + } 1.22618 + } else if(s.parentNode && (this.tree.rootVisible || !s.parentNode.isRoot)){ 1.22619 + return this.select(s.parentNode); 1.22620 + } 1.22621 + return null; 1.22622 + }, 1.22623 + 1.22624 + 1.22625 + selectNext : function(){ 1.22626 + var s = this.selNode || this.lastSelNode; 1.22627 + if(!s){ 1.22628 + return null; 1.22629 + } 1.22630 + if(s.firstChild && s.isExpanded()){ 1.22631 + return this.select(s.firstChild); 1.22632 + }else if(s.nextSibling){ 1.22633 + return this.select(s.nextSibling); 1.22634 + }else if(s.parentNode){ 1.22635 + var newS = null; 1.22636 + s.parentNode.bubble(function(){ 1.22637 + if(this.nextSibling){ 1.22638 + newS = this.getOwnerTree().selModel.select(this.nextSibling); 1.22639 + return false; 1.22640 + } 1.22641 + }); 1.22642 + return newS; 1.22643 + } 1.22644 + return null; 1.22645 + }, 1.22646 + 1.22647 + onKeyDown : function(e){ 1.22648 + var s = this.selNode || this.lastSelNode; 1.22649 + 1.22650 + var sm = this; 1.22651 + if(!s){ 1.22652 + return; 1.22653 + } 1.22654 + var k = e.getKey(); 1.22655 + switch(k){ 1.22656 + case e.DOWN: 1.22657 + e.stopEvent(); 1.22658 + this.selectNext(); 1.22659 + break; 1.22660 + case e.UP: 1.22661 + e.stopEvent(); 1.22662 + this.selectPrevious(); 1.22663 + break; 1.22664 + case e.RIGHT: 1.22665 + e.preventDefault(); 1.22666 + if(s.hasChildNodes()){ 1.22667 + if(!s.isExpanded()){ 1.22668 + s.expand(); 1.22669 + }else if(s.firstChild){ 1.22670 + this.select(s.firstChild, e); 1.22671 + } 1.22672 + } 1.22673 + break; 1.22674 + case e.LEFT: 1.22675 + e.preventDefault(); 1.22676 + if(s.hasChildNodes() && s.isExpanded()){ 1.22677 + s.collapse(); 1.22678 + }else if(s.parentNode && (this.tree.rootVisible || s.parentNode != this.tree.getRootNode())){ 1.22679 + this.select(s.parentNode, e); 1.22680 + } 1.22681 + break; 1.22682 + }; 1.22683 + } 1.22684 +}); 1.22685 + 1.22686 + 1.22687 +Ext.tree.MultiSelectionModel = function(config){ 1.22688 + this.selNodes = []; 1.22689 + this.selMap = {}; 1.22690 + this.addEvents( 1.22691 + 1.22692 + "selectionchange" 1.22693 + ); 1.22694 + Ext.apply(this, config); 1.22695 + Ext.tree.MultiSelectionModel.superclass.constructor.call(this); 1.22696 +}; 1.22697 + 1.22698 +Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, { 1.22699 + init : function(tree){ 1.22700 + this.tree = tree; 1.22701 + tree.getTreeEl().on("keydown", this.onKeyDown, this); 1.22702 + tree.on("click", this.onNodeClick, this); 1.22703 + }, 1.22704 + 1.22705 + onNodeClick : function(node, e){ 1.22706 + this.select(node, e, e.ctrlKey); 1.22707 + }, 1.22708 + 1.22709 + 1.22710 + select : function(node, e, keepExisting){ 1.22711 + if(keepExisting !== true){ 1.22712 + this.clearSelections(true); 1.22713 + } 1.22714 + if(this.isSelected(node)){ 1.22715 + this.lastSelNode = node; 1.22716 + return node; 1.22717 + } 1.22718 + this.selNodes.push(node); 1.22719 + this.selMap[node.id] = node; 1.22720 + this.lastSelNode = node; 1.22721 + node.ui.onSelectedChange(true); 1.22722 + this.fireEvent("selectionchange", this, this.selNodes); 1.22723 + return node; 1.22724 + }, 1.22725 + 1.22726 + 1.22727 + unselect : function(node){ 1.22728 + if(this.selMap[node.id]){ 1.22729 + node.ui.onSelectedChange(false); 1.22730 + var sn = this.selNodes; 1.22731 + var index = sn.indexOf(node); 1.22732 + if(index != -1){ 1.22733 + this.selNodes.splice(index, 1); 1.22734 + } 1.22735 + delete this.selMap[node.id]; 1.22736 + this.fireEvent("selectionchange", this, this.selNodes); 1.22737 + } 1.22738 + }, 1.22739 + 1.22740 + 1.22741 + clearSelections : function(suppressEvent){ 1.22742 + var sn = this.selNodes; 1.22743 + if(sn.length > 0){ 1.22744 + for(var i = 0, len = sn.length; i < len; i++){ 1.22745 + sn[i].ui.onSelectedChange(false); 1.22746 + } 1.22747 + this.selNodes = []; 1.22748 + this.selMap = {}; 1.22749 + if(suppressEvent !== true){ 1.22750 + this.fireEvent("selectionchange", this, this.selNodes); 1.22751 + } 1.22752 + } 1.22753 + }, 1.22754 + 1.22755 + 1.22756 + isSelected : function(node){ 1.22757 + return this.selMap[node.id] ? true : false; 1.22758 + }, 1.22759 + 1.22760 + 1.22761 + getSelectedNodes : function(){ 1.22762 + return this.selNodes; 1.22763 + }, 1.22764 + 1.22765 + onKeyDown : Ext.tree.DefaultSelectionModel.prototype.onKeyDown, 1.22766 + 1.22767 + selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext, 1.22768 + 1.22769 + selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious 1.22770 +}); 1.22771 + 1.22772 +Ext.tree.TreeNode = function(attributes){ 1.22773 + attributes = attributes || {}; 1.22774 + if(typeof attributes == "string"){ 1.22775 + attributes = {text: attributes}; 1.22776 + } 1.22777 + this.childrenRendered = false; 1.22778 + this.rendered = false; 1.22779 + Ext.tree.TreeNode.superclass.constructor.call(this, attributes); 1.22780 + this.expanded = attributes.expanded === true; 1.22781 + this.isTarget = attributes.isTarget !== false; 1.22782 + this.draggable = attributes.draggable !== false && attributes.allowDrag !== false; 1.22783 + this.allowChildren = attributes.allowChildren !== false && attributes.allowDrop !== false; 1.22784 + 1.22785 + 1.22786 + this.text = attributes.text; 1.22787 + 1.22788 + this.disabled = attributes.disabled === true; 1.22789 + 1.22790 + this.addEvents( 1.22791 + 1.22792 + "textchange", 1.22793 + 1.22794 + "beforeexpand", 1.22795 + 1.22796 + "beforecollapse", 1.22797 + 1.22798 + "expand", 1.22799 + 1.22800 + "disabledchange", 1.22801 + 1.22802 + "collapse", 1.22803 + 1.22804 + "beforeclick", 1.22805 + 1.22806 + "click", 1.22807 + 1.22808 + "checkchange", 1.22809 + 1.22810 + "dblclick", 1.22811 + 1.22812 + "contextmenu", 1.22813 + 1.22814 + "beforechildrenrendered" 1.22815 + ); 1.22816 + 1.22817 + var uiClass = this.attributes.uiProvider || this.defaultUI || Ext.tree.TreeNodeUI; 1.22818 + 1.22819 + 1.22820 + this.ui = new uiClass(this); 1.22821 +}; 1.22822 +Ext.extend(Ext.tree.TreeNode, Ext.data.Node, { 1.22823 + preventHScroll: true, 1.22824 + 1.22825 + isExpanded : function(){ 1.22826 + return this.expanded; 1.22827 + }, 1.22828 + 1.22829 + 1.22830 + getUI : function(){ 1.22831 + return this.ui; 1.22832 + }, 1.22833 + 1.22834 + 1.22835 + setFirstChild : function(node){ 1.22836 + var of = this.firstChild; 1.22837 + Ext.tree.TreeNode.superclass.setFirstChild.call(this, node); 1.22838 + if(this.childrenRendered && of && node != of){ 1.22839 + of.renderIndent(true, true); 1.22840 + } 1.22841 + if(this.rendered){ 1.22842 + this.renderIndent(true, true); 1.22843 + } 1.22844 + }, 1.22845 + 1.22846 + 1.22847 + setLastChild : function(node){ 1.22848 + var ol = this.lastChild; 1.22849 + Ext.tree.TreeNode.superclass.setLastChild.call(this, node); 1.22850 + if(this.childrenRendered && ol && node != ol){ 1.22851 + ol.renderIndent(true, true); 1.22852 + } 1.22853 + if(this.rendered){ 1.22854 + this.renderIndent(true, true); 1.22855 + } 1.22856 + }, 1.22857 + 1.22858 + 1.22859 + 1.22860 + appendChild : function(){ 1.22861 + var node = Ext.tree.TreeNode.superclass.appendChild.apply(this, arguments); 1.22862 + if(node && this.childrenRendered){ 1.22863 + node.render(); 1.22864 + } 1.22865 + this.ui.updateExpandIcon(); 1.22866 + return node; 1.22867 + }, 1.22868 + 1.22869 + 1.22870 + removeChild : function(node){ 1.22871 + this.ownerTree.getSelectionModel().unselect(node); 1.22872 + Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments); 1.22873 + 1.22874 + if(this.childrenRendered){ 1.22875 + node.ui.remove(); 1.22876 + } 1.22877 + if(this.childNodes.length < 1){ 1.22878 + this.collapse(false, false); 1.22879 + }else{ 1.22880 + this.ui.updateExpandIcon(); 1.22881 + } 1.22882 + if(!this.firstChild && !this.isHiddenRoot()) { 1.22883 + this.childrenRendered = false; 1.22884 + } 1.22885 + return node; 1.22886 + }, 1.22887 + 1.22888 + 1.22889 + insertBefore : function(node, refNode){ 1.22890 + var newNode = Ext.tree.TreeNode.superclass.insertBefore.apply(this, arguments); 1.22891 + if(newNode && refNode && this.childrenRendered){ 1.22892 + node.render(); 1.22893 + } 1.22894 + this.ui.updateExpandIcon(); 1.22895 + return newNode; 1.22896 + }, 1.22897 + 1.22898 + 1.22899 + setText : function(text){ 1.22900 + var oldText = this.text; 1.22901 + this.text = text; 1.22902 + this.attributes.text = text; 1.22903 + if(this.rendered){ 1.22904 + this.ui.onTextChange(this, text, oldText); 1.22905 + } 1.22906 + this.fireEvent("textchange", this, text, oldText); 1.22907 + }, 1.22908 + 1.22909 + 1.22910 + select : function(){ 1.22911 + this.getOwnerTree().getSelectionModel().select(this); 1.22912 + }, 1.22913 + 1.22914 + 1.22915 + unselect : function(){ 1.22916 + this.getOwnerTree().getSelectionModel().unselect(this); 1.22917 + }, 1.22918 + 1.22919 + 1.22920 + isSelected : function(){ 1.22921 + return this.getOwnerTree().getSelectionModel().isSelected(this); 1.22922 + }, 1.22923 + 1.22924 + 1.22925 + expand : function(deep, anim, callback){ 1.22926 + if(!this.expanded){ 1.22927 + if(this.fireEvent("beforeexpand", this, deep, anim) === false){ 1.22928 + return; 1.22929 + } 1.22930 + if(!this.childrenRendered){ 1.22931 + this.renderChildren(); 1.22932 + } 1.22933 + this.expanded = true; 1.22934 + if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){ 1.22935 + this.ui.animExpand(function(){ 1.22936 + this.fireEvent("expand", this); 1.22937 + if(typeof callback == "function"){ 1.22938 + callback(this); 1.22939 + } 1.22940 + if(deep === true){ 1.22941 + this.expandChildNodes(true); 1.22942 + } 1.22943 + }.createDelegate(this)); 1.22944 + return; 1.22945 + }else{ 1.22946 + this.ui.expand(); 1.22947 + this.fireEvent("expand", this); 1.22948 + if(typeof callback == "function"){ 1.22949 + callback(this); 1.22950 + } 1.22951 + } 1.22952 + }else{ 1.22953 + if(typeof callback == "function"){ 1.22954 + callback(this); 1.22955 + } 1.22956 + } 1.22957 + if(deep === true){ 1.22958 + this.expandChildNodes(true); 1.22959 + } 1.22960 + }, 1.22961 + 1.22962 + isHiddenRoot : function(){ 1.22963 + return this.isRoot && !this.getOwnerTree().rootVisible; 1.22964 + }, 1.22965 + 1.22966 + 1.22967 + collapse : function(deep, anim){ 1.22968 + if(this.expanded && !this.isHiddenRoot()){ 1.22969 + if(this.fireEvent("beforecollapse", this, deep, anim) === false){ 1.22970 + return; 1.22971 + } 1.22972 + this.expanded = false; 1.22973 + if((this.getOwnerTree().animate && anim !== false) || anim){ 1.22974 + this.ui.animCollapse(function(){ 1.22975 + this.fireEvent("collapse", this); 1.22976 + if(deep === true){ 1.22977 + this.collapseChildNodes(true); 1.22978 + } 1.22979 + }.createDelegate(this)); 1.22980 + return; 1.22981 + }else{ 1.22982 + this.ui.collapse(); 1.22983 + this.fireEvent("collapse", this); 1.22984 + } 1.22985 + } 1.22986 + if(deep === true){ 1.22987 + var cs = this.childNodes; 1.22988 + for(var i = 0, len = cs.length; i < len; i++) { 1.22989 + cs[i].collapse(true, false); 1.22990 + } 1.22991 + } 1.22992 + }, 1.22993 + 1.22994 + 1.22995 + delayedExpand : function(delay){ 1.22996 + if(!this.expandProcId){ 1.22997 + this.expandProcId = this.expand.defer(delay, this); 1.22998 + } 1.22999 + }, 1.23000 + 1.23001 + 1.23002 + cancelExpand : function(){ 1.23003 + if(this.expandProcId){ 1.23004 + clearTimeout(this.expandProcId); 1.23005 + } 1.23006 + this.expandProcId = false; 1.23007 + }, 1.23008 + 1.23009 + 1.23010 + toggle : function(){ 1.23011 + if(this.expanded){ 1.23012 + this.collapse(); 1.23013 + }else{ 1.23014 + this.expand(); 1.23015 + } 1.23016 + }, 1.23017 + 1.23018 + 1.23019 + ensureVisible : function(callback){ 1.23020 + var tree = this.getOwnerTree(); 1.23021 + tree.expandPath(this.parentNode.getPath(), false, function(){ 1.23022 + var node = tree.getNodeById(this.id); 1.23023 + tree.getTreeEl().scrollChildIntoView(node.ui.anchor); 1.23024 + Ext.callback(callback); 1.23025 + }.createDelegate(this)); 1.23026 + }, 1.23027 + 1.23028 + 1.23029 + expandChildNodes : function(deep){ 1.23030 + var cs = this.childNodes; 1.23031 + for(var i = 0, len = cs.length; i < len; i++) { 1.23032 + cs[i].expand(deep); 1.23033 + } 1.23034 + }, 1.23035 + 1.23036 + 1.23037 + collapseChildNodes : function(deep){ 1.23038 + var cs = this.childNodes; 1.23039 + for(var i = 0, len = cs.length; i < len; i++) { 1.23040 + cs[i].collapse(deep); 1.23041 + } 1.23042 + }, 1.23043 + 1.23044 + 1.23045 + disable : function(){ 1.23046 + this.disabled = true; 1.23047 + this.unselect(); 1.23048 + if(this.rendered && this.ui.onDisableChange){ 1.23049 + this.ui.onDisableChange(this, true); 1.23050 + } 1.23051 + this.fireEvent("disabledchange", this, true); 1.23052 + }, 1.23053 + 1.23054 + 1.23055 + enable : function(){ 1.23056 + this.disabled = false; 1.23057 + if(this.rendered && this.ui.onDisableChange){ 1.23058 + this.ui.onDisableChange(this, false); 1.23059 + } 1.23060 + this.fireEvent("disabledchange", this, false); 1.23061 + }, 1.23062 + 1.23063 + 1.23064 + renderChildren : function(suppressEvent){ 1.23065 + if(suppressEvent !== false){ 1.23066 + this.fireEvent("beforechildrenrendered", this); 1.23067 + } 1.23068 + var cs = this.childNodes; 1.23069 + for(var i = 0, len = cs.length; i < len; i++){ 1.23070 + cs[i].render(true); 1.23071 + } 1.23072 + this.childrenRendered = true; 1.23073 + }, 1.23074 + 1.23075 + 1.23076 + sort : function(fn, scope){ 1.23077 + Ext.tree.TreeNode.superclass.sort.apply(this, arguments); 1.23078 + if(this.childrenRendered){ 1.23079 + var cs = this.childNodes; 1.23080 + for(var i = 0, len = cs.length; i < len; i++){ 1.23081 + cs[i].render(true); 1.23082 + } 1.23083 + } 1.23084 + }, 1.23085 + 1.23086 + 1.23087 + render : function(bulkRender){ 1.23088 + this.ui.render(bulkRender); 1.23089 + if(!this.rendered){ 1.23090 + 1.23091 + this.getOwnerTree().registerNode(this); 1.23092 + this.rendered = true; 1.23093 + if(this.expanded){ 1.23094 + this.expanded = false; 1.23095 + this.expand(false, false); 1.23096 + } 1.23097 + } 1.23098 + }, 1.23099 + 1.23100 + 1.23101 + renderIndent : function(deep, refresh){ 1.23102 + if(refresh){ 1.23103 + this.ui.childIndent = null; 1.23104 + } 1.23105 + this.ui.renderIndent(); 1.23106 + if(deep === true && this.childrenRendered){ 1.23107 + var cs = this.childNodes; 1.23108 + for(var i = 0, len = cs.length; i < len; i++){ 1.23109 + cs[i].renderIndent(true, refresh); 1.23110 + } 1.23111 + } 1.23112 + }, 1.23113 + 1.23114 + beginUpdate : function(){ 1.23115 + this.childrenRendered = false; 1.23116 + }, 1.23117 + 1.23118 + endUpdate : function(){ 1.23119 + if(this.expanded && this.rendered){ 1.23120 + this.renderChildren(); 1.23121 + } 1.23122 + }, 1.23123 + 1.23124 + destroy : function(){ 1.23125 + for(var i = 0,l = this.childNodes.length; i < l; i++){ 1.23126 + this.childNodes[i].destroy(); 1.23127 + } 1.23128 + this.childNodes = null; 1.23129 + if(this.ui.destroy){ 1.23130 + this.ui.destroy(); 1.23131 + } 1.23132 + } 1.23133 +}); 1.23134 + 1.23135 + Ext.tree.AsyncTreeNode = function(config){ 1.23136 + this.loaded = false; 1.23137 + this.loading = false; 1.23138 + Ext.tree.AsyncTreeNode.superclass.constructor.apply(this, arguments); 1.23139 + 1.23140 + this.addEvents('beforeload', 'load'); 1.23141 + 1.23142 + 1.23143 +}; 1.23144 +Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, { 1.23145 + expand : function(deep, anim, callback){ 1.23146 + if(this.loading){ 1.23147 + var timer; 1.23148 + var f = function(){ 1.23149 + if(!this.loading){ 1.23150 + clearInterval(timer); 1.23151 + this.expand(deep, anim, callback); 1.23152 + } 1.23153 + }.createDelegate(this); 1.23154 + timer = setInterval(f, 200); 1.23155 + return; 1.23156 + } 1.23157 + if(!this.loaded){ 1.23158 + if(this.fireEvent("beforeload", this) === false){ 1.23159 + return; 1.23160 + } 1.23161 + this.loading = true; 1.23162 + this.ui.beforeLoad(this); 1.23163 + var loader = this.loader || this.attributes.loader || this.getOwnerTree().getLoader(); 1.23164 + if(loader){ 1.23165 + loader.load(this, this.loadComplete.createDelegate(this, [deep, anim, callback])); 1.23166 + return; 1.23167 + } 1.23168 + } 1.23169 + Ext.tree.AsyncTreeNode.superclass.expand.call(this, deep, anim, callback); 1.23170 + }, 1.23171 + 1.23172 + 1.23173 + isLoading : function(){ 1.23174 + return this.loading; 1.23175 + }, 1.23176 + 1.23177 + loadComplete : function(deep, anim, callback){ 1.23178 + this.loading = false; 1.23179 + this.loaded = true; 1.23180 + this.ui.afterLoad(this); 1.23181 + this.fireEvent("load", this); 1.23182 + this.expand(deep, anim, callback); 1.23183 + }, 1.23184 + 1.23185 + 1.23186 + isLoaded : function(){ 1.23187 + return this.loaded; 1.23188 + }, 1.23189 + 1.23190 + hasChildNodes : function(){ 1.23191 + if(!this.isLeaf() && !this.loaded){ 1.23192 + return true; 1.23193 + }else{ 1.23194 + return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this); 1.23195 + } 1.23196 + }, 1.23197 + 1.23198 + 1.23199 + reload : function(callback){ 1.23200 + this.collapse(false, false); 1.23201 + while(this.firstChild){ 1.23202 + this.removeChild(this.firstChild); 1.23203 + } 1.23204 + this.childrenRendered = false; 1.23205 + this.loaded = false; 1.23206 + if(this.isHiddenRoot()){ 1.23207 + this.expanded = false; 1.23208 + } 1.23209 + this.expand(false, false, callback); 1.23210 + } 1.23211 +}); 1.23212 + 1.23213 +Ext.tree.TreeNodeUI = function(node){ 1.23214 + this.node = node; 1.23215 + this.rendered = false; 1.23216 + this.animating = false; 1.23217 + this.wasLeaf = true; 1.23218 + this.ecc = 'x-tree-ec-icon x-tree-elbow'; 1.23219 + this.emptyIcon = Ext.BLANK_IMAGE_URL; 1.23220 +}; 1.23221 + 1.23222 +Ext.tree.TreeNodeUI.prototype = { 1.23223 + 1.23224 + removeChild : function(node){ 1.23225 + if(this.rendered){ 1.23226 + this.ctNode.removeChild(node.ui.getEl()); 1.23227 + } 1.23228 + }, 1.23229 + 1.23230 + 1.23231 + beforeLoad : function(){ 1.23232 + this.addClass("x-tree-node-loading"); 1.23233 + }, 1.23234 + 1.23235 + 1.23236 + afterLoad : function(){ 1.23237 + this.removeClass("x-tree-node-loading"); 1.23238 + }, 1.23239 + 1.23240 + 1.23241 + onTextChange : function(node, text, oldText){ 1.23242 + if(this.rendered){ 1.23243 + this.textNode.innerHTML = text; 1.23244 + } 1.23245 + }, 1.23246 + 1.23247 + 1.23248 + onDisableChange : function(node, state){ 1.23249 + this.disabled = state; 1.23250 + if (this.checkbox) { 1.23251 + this.checkbox.disabled = state; 1.23252 + } 1.23253 + if(state){ 1.23254 + this.addClass("x-tree-node-disabled"); 1.23255 + }else{ 1.23256 + this.removeClass("x-tree-node-disabled"); 1.23257 + } 1.23258 + }, 1.23259 + 1.23260 + 1.23261 + onSelectedChange : function(state){ 1.23262 + if(state){ 1.23263 + this.focus(); 1.23264 + this.addClass("x-tree-selected"); 1.23265 + }else{ 1.23266 + 1.23267 + this.removeClass("x-tree-selected"); 1.23268 + } 1.23269 + }, 1.23270 + 1.23271 + 1.23272 + onMove : function(tree, node, oldParent, newParent, index, refNode){ 1.23273 + this.childIndent = null; 1.23274 + if(this.rendered){ 1.23275 + var targetNode = newParent.ui.getContainer(); 1.23276 + if(!targetNode){ 1.23277 + this.holder = document.createElement("div"); 1.23278 + this.holder.appendChild(this.wrap); 1.23279 + return; 1.23280 + } 1.23281 + var insertBefore = refNode ? refNode.ui.getEl() : null; 1.23282 + if(insertBefore){ 1.23283 + targetNode.insertBefore(this.wrap, insertBefore); 1.23284 + }else{ 1.23285 + targetNode.appendChild(this.wrap); 1.23286 + } 1.23287 + this.node.renderIndent(true); 1.23288 + } 1.23289 + }, 1.23290 + 1.23291 + 1.23292 + addClass : function(cls){ 1.23293 + if(this.elNode){ 1.23294 + Ext.fly(this.elNode).addClass(cls); 1.23295 + } 1.23296 + }, 1.23297 + 1.23298 + 1.23299 + removeClass : function(cls){ 1.23300 + if(this.elNode){ 1.23301 + Ext.fly(this.elNode).removeClass(cls); 1.23302 + } 1.23303 + }, 1.23304 + 1.23305 + 1.23306 + remove : function(){ 1.23307 + if(this.rendered){ 1.23308 + this.holder = document.createElement("div"); 1.23309 + this.holder.appendChild(this.wrap); 1.23310 + } 1.23311 + }, 1.23312 + 1.23313 + 1.23314 + fireEvent : function(){ 1.23315 + return this.node.fireEvent.apply(this.node, arguments); 1.23316 + }, 1.23317 + 1.23318 + 1.23319 + initEvents : function(){ 1.23320 + this.node.on("move", this.onMove, this); 1.23321 + 1.23322 + if(this.node.disabled){ 1.23323 + this.addClass("x-tree-node-disabled"); 1.23324 + if (this.checkbox) { 1.23325 + this.checkbox.disabled = true; 1.23326 + } 1.23327 + } 1.23328 + if(this.node.hidden){ 1.23329 + this.hide(); 1.23330 + } 1.23331 + var ot = this.node.getOwnerTree(); 1.23332 + var dd = ot.enableDD || ot.enableDrag || ot.enableDrop; 1.23333 + if(dd && (!this.node.isRoot || ot.rootVisible)){ 1.23334 + Ext.dd.Registry.register(this.elNode, { 1.23335 + node: this.node, 1.23336 + handles: this.getDDHandles(), 1.23337 + isHandle: false 1.23338 + }); 1.23339 + } 1.23340 + }, 1.23341 + 1.23342 + 1.23343 + getDDHandles : function(){ 1.23344 + return [this.iconNode, this.textNode, this.elNode]; 1.23345 + }, 1.23346 + 1.23347 + 1.23348 + hide : function(){ 1.23349 + this.node.hidden = true; 1.23350 + if(this.wrap){ 1.23351 + this.wrap.style.display = "none"; 1.23352 + } 1.23353 + }, 1.23354 + 1.23355 + 1.23356 + show : function(){ 1.23357 + this.node.hidden = false; 1.23358 + if(this.wrap){ 1.23359 + this.wrap.style.display = ""; 1.23360 + } 1.23361 + }, 1.23362 + 1.23363 + 1.23364 + onContextMenu : function(e){ 1.23365 + if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) { 1.23366 + e.preventDefault(); 1.23367 + this.focus(); 1.23368 + this.fireEvent("contextmenu", this.node, e); 1.23369 + } 1.23370 + }, 1.23371 + 1.23372 + 1.23373 + onClick : function(e){ 1.23374 + if(this.dropping){ 1.23375 + e.stopEvent(); 1.23376 + return; 1.23377 + } 1.23378 + if(this.fireEvent("beforeclick", this.node, e) !== false){ 1.23379 + var a = e.getTarget('a'); 1.23380 + if(!this.disabled && this.node.attributes.href && a){ 1.23381 + this.fireEvent("click", this.node, e); 1.23382 + return; 1.23383 + }else if(a && e.ctrlKey){ 1.23384 + e.stopEvent(); 1.23385 + } 1.23386 + e.preventDefault(); 1.23387 + if(this.disabled){ 1.23388 + return; 1.23389 + } 1.23390 + 1.23391 + if(this.node.attributes.singleClickExpand && !this.animating && this.node.hasChildNodes()){ 1.23392 + this.node.toggle(); 1.23393 + } 1.23394 + 1.23395 + this.fireEvent("click", this.node, e); 1.23396 + }else{ 1.23397 + e.stopEvent(); 1.23398 + } 1.23399 + }, 1.23400 + 1.23401 + 1.23402 + onDblClick : function(e){ 1.23403 + e.preventDefault(); 1.23404 + if(this.disabled){ 1.23405 + return; 1.23406 + } 1.23407 + if(this.checkbox){ 1.23408 + this.toggleCheck(); 1.23409 + } 1.23410 + if(!this.animating && this.node.hasChildNodes()){ 1.23411 + this.node.toggle(); 1.23412 + } 1.23413 + this.fireEvent("dblclick", this.node, e); 1.23414 + }, 1.23415 + 1.23416 + onOver : function(e){ 1.23417 + this.addClass('x-tree-node-over'); 1.23418 + }, 1.23419 + 1.23420 + onOut : function(e){ 1.23421 + this.removeClass('x-tree-node-over'); 1.23422 + }, 1.23423 + 1.23424 + 1.23425 + onCheckChange : function(){ 1.23426 + var checked = this.checkbox.checked; 1.23427 + 1.23428 + this.checkbox.defaultChecked = checked; 1.23429 + this.node.attributes.checked = checked; 1.23430 + this.fireEvent('checkchange', this.node, checked); 1.23431 + }, 1.23432 + 1.23433 + 1.23434 + ecClick : function(e){ 1.23435 + if(!this.animating && (this.node.hasChildNodes() || this.node.attributes.expandable)){ 1.23436 + this.node.toggle(); 1.23437 + } 1.23438 + }, 1.23439 + 1.23440 + 1.23441 + startDrop : function(){ 1.23442 + this.dropping = true; 1.23443 + }, 1.23444 + 1.23445 + 1.23446 + endDrop : function(){ 1.23447 + setTimeout(function(){ 1.23448 + this.dropping = false; 1.23449 + }.createDelegate(this), 50); 1.23450 + }, 1.23451 + 1.23452 + 1.23453 + expand : function(){ 1.23454 + this.updateExpandIcon(); 1.23455 + this.ctNode.style.display = ""; 1.23456 + }, 1.23457 + 1.23458 + 1.23459 + focus : function(){ 1.23460 + if(!this.node.preventHScroll){ 1.23461 + try{this.anchor.focus(); 1.23462 + }catch(e){} 1.23463 + }else if(!Ext.isIE){ 1.23464 + try{ 1.23465 + var noscroll = this.node.getOwnerTree().getTreeEl().dom; 1.23466 + var l = noscroll.scrollLeft; 1.23467 + this.anchor.focus(); 1.23468 + noscroll.scrollLeft = l; 1.23469 + }catch(e){} 1.23470 + } 1.23471 + }, 1.23472 + 1.23473 + 1.23474 + toggleCheck : function(value){ 1.23475 + var cb = this.checkbox; 1.23476 + if(cb){ 1.23477 + cb.checked = (value === undefined ? !cb.checked : value); 1.23478 + this.onCheckChange(); 1.23479 + } 1.23480 + }, 1.23481 + 1.23482 + 1.23483 + blur : function(){ 1.23484 + try{ 1.23485 + this.anchor.blur(); 1.23486 + }catch(e){} 1.23487 + }, 1.23488 + 1.23489 + 1.23490 + animExpand : function(callback){ 1.23491 + var ct = Ext.get(this.ctNode); 1.23492 + ct.stopFx(); 1.23493 + if(!this.node.hasChildNodes()){ 1.23494 + this.updateExpandIcon(); 1.23495 + this.ctNode.style.display = ""; 1.23496 + Ext.callback(callback); 1.23497 + return; 1.23498 + } 1.23499 + this.animating = true; 1.23500 + this.updateExpandIcon(); 1.23501 + 1.23502 + ct.slideIn('t', { 1.23503 + callback : function(){ 1.23504 + this.animating = false; 1.23505 + Ext.callback(callback); 1.23506 + }, 1.23507 + scope: this, 1.23508 + duration: this.node.ownerTree.duration || .25 1.23509 + }); 1.23510 + }, 1.23511 + 1.23512 + 1.23513 + highlight : function(){ 1.23514 + var tree = this.node.getOwnerTree(); 1.23515 + Ext.fly(this.wrap).highlight( 1.23516 + tree.hlColor || "C3DAF9", 1.23517 + {endColor: tree.hlBaseColor} 1.23518 + ); 1.23519 + }, 1.23520 + 1.23521 + 1.23522 + collapse : function(){ 1.23523 + this.updateExpandIcon(); 1.23524 + this.ctNode.style.display = "none"; 1.23525 + }, 1.23526 + 1.23527 + 1.23528 + animCollapse : function(callback){ 1.23529 + var ct = Ext.get(this.ctNode); 1.23530 + ct.enableDisplayMode('block'); 1.23531 + ct.stopFx(); 1.23532 + 1.23533 + this.animating = true; 1.23534 + this.updateExpandIcon(); 1.23535 + 1.23536 + ct.slideOut('t', { 1.23537 + callback : function(){ 1.23538 + this.animating = false; 1.23539 + Ext.callback(callback); 1.23540 + }, 1.23541 + scope: this, 1.23542 + duration: this.node.ownerTree.duration || .25 1.23543 + }); 1.23544 + }, 1.23545 + 1.23546 + 1.23547 + getContainer : function(){ 1.23548 + return this.ctNode; 1.23549 + }, 1.23550 + 1.23551 + 1.23552 + getEl : function(){ 1.23553 + return this.wrap; 1.23554 + }, 1.23555 + 1.23556 + 1.23557 + appendDDGhost : function(ghostNode){ 1.23558 + ghostNode.appendChild(this.elNode.cloneNode(true)); 1.23559 + }, 1.23560 + 1.23561 + 1.23562 + getDDRepairXY : function(){ 1.23563 + return Ext.lib.Dom.getXY(this.iconNode); 1.23564 + }, 1.23565 + 1.23566 + 1.23567 + onRender : function(){ 1.23568 + this.render(); 1.23569 + }, 1.23570 + 1.23571 + 1.23572 + render : function(bulkRender){ 1.23573 + var n = this.node, a = n.attributes; 1.23574 + var targetNode = n.parentNode ? 1.23575 + n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom; 1.23576 + 1.23577 + if(!this.rendered){ 1.23578 + this.rendered = true; 1.23579 + 1.23580 + this.renderElements(n, a, targetNode, bulkRender); 1.23581 + 1.23582 + if(a.qtip){ 1.23583 + if(this.textNode.setAttributeNS){ 1.23584 + this.textNode.setAttributeNS("ext", "qtip", a.qtip); 1.23585 + if(a.qtipTitle){ 1.23586 + this.textNode.setAttributeNS("ext", "qtitle", a.qtipTitle); 1.23587 + } 1.23588 + }else{ 1.23589 + this.textNode.setAttribute("ext:qtip", a.qtip); 1.23590 + if(a.qtipTitle){ 1.23591 + this.textNode.setAttribute("ext:qtitle", a.qtipTitle); 1.23592 + } 1.23593 + } 1.23594 + }else if(a.qtipCfg){ 1.23595 + a.qtipCfg.target = Ext.id(this.textNode); 1.23596 + Ext.QuickTips.register(a.qtipCfg); 1.23597 + } 1.23598 + this.initEvents(); 1.23599 + if(!this.node.expanded){ 1.23600 + this.updateExpandIcon(true); 1.23601 + } 1.23602 + }else{ 1.23603 + if(bulkRender === true) { 1.23604 + targetNode.appendChild(this.wrap); 1.23605 + } 1.23606 + } 1.23607 + }, 1.23608 + 1.23609 + 1.23610 + renderElements : function(n, a, targetNode, bulkRender){ 1.23611 + 1.23612 + this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : ''; 1.23613 + 1.23614 + var cb = typeof a.checked == 'boolean'; 1.23615 + 1.23616 + var href = a.href ? a.href : Ext.isGecko ? "" : "#"; 1.23617 + var buf = ['<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ', a.cls,'" unselectable="on">', 1.23618 + '<span class="x-tree-node-indent">',this.indentMarkup,"</span>", 1.23619 + '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow" />', 1.23620 + '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />', 1.23621 + cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + (a.checked ? 'checked="checked" />' : '/>')) : '', 1.23622 + '<a hidefocus="on" class="x-tree-node-anchor" href="',href,'" tabIndex="1" ', 1.23623 + a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", '><span unselectable="on">',n.text,"</span></a></div>", 1.23624 + '<ul class="x-tree-node-ct" style="display:none;"></ul>', 1.23625 + "</li>"].join(''); 1.23626 + 1.23627 + var nel; 1.23628 + if(bulkRender !== true && n.nextSibling && (nel = n.nextSibling.ui.getEl())){ 1.23629 + this.wrap = Ext.DomHelper.insertHtml("beforeBegin", nel, buf); 1.23630 + }else{ 1.23631 + this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf); 1.23632 + } 1.23633 + 1.23634 + this.elNode = this.wrap.childNodes[0]; 1.23635 + this.ctNode = this.wrap.childNodes[1]; 1.23636 + var cs = this.elNode.childNodes; 1.23637 + this.indentNode = cs[0]; 1.23638 + this.ecNode = cs[1]; 1.23639 + this.iconNode = cs[2]; 1.23640 + var index = 3; 1.23641 + if(cb){ 1.23642 + this.checkbox = cs[3]; 1.23643 + 1.23644 + this.checkbox.defaultChecked = this.checkbox.checked; 1.23645 + index++; 1.23646 + } 1.23647 + this.anchor = cs[index]; 1.23648 + this.textNode = cs[index].firstChild; 1.23649 + }, 1.23650 + 1.23651 + 1.23652 + getAnchor : function(){ 1.23653 + return this.anchor; 1.23654 + }, 1.23655 + 1.23656 + 1.23657 + getTextEl : function(){ 1.23658 + return this.textNode; 1.23659 + }, 1.23660 + 1.23661 + 1.23662 + getIconEl : function(){ 1.23663 + return this.iconNode; 1.23664 + }, 1.23665 + 1.23666 + 1.23667 + isChecked : function(){ 1.23668 + return this.checkbox ? this.checkbox.checked : false; 1.23669 + }, 1.23670 + 1.23671 + 1.23672 + updateExpandIcon : function(){ 1.23673 + if(this.rendered){ 1.23674 + var n = this.node, c1, c2; 1.23675 + var cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow"; 1.23676 + var hasChild = n.hasChildNodes(); 1.23677 + if(hasChild || n.attributes.expandable){ 1.23678 + if(n.expanded){ 1.23679 + cls += "-minus"; 1.23680 + c1 = "x-tree-node-collapsed"; 1.23681 + c2 = "x-tree-node-expanded"; 1.23682 + }else{ 1.23683 + cls += "-plus"; 1.23684 + c1 = "x-tree-node-expanded"; 1.23685 + c2 = "x-tree-node-collapsed"; 1.23686 + } 1.23687 + if(this.wasLeaf){ 1.23688 + this.removeClass("x-tree-node-leaf"); 1.23689 + this.wasLeaf = false; 1.23690 + } 1.23691 + if(this.c1 != c1 || this.c2 != c2){ 1.23692 + Ext.fly(this.elNode).replaceClass(c1, c2); 1.23693 + this.c1 = c1; this.c2 = c2; 1.23694 + } 1.23695 + }else{ 1.23696 + if(!this.wasLeaf){ 1.23697 + Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-leaf"); 1.23698 + delete this.c1; 1.23699 + delete this.c2; 1.23700 + this.wasLeaf = true; 1.23701 + } 1.23702 + } 1.23703 + var ecc = "x-tree-ec-icon "+cls; 1.23704 + if(this.ecc != ecc){ 1.23705 + this.ecNode.className = ecc; 1.23706 + this.ecc = ecc; 1.23707 + } 1.23708 + } 1.23709 + }, 1.23710 + 1.23711 + 1.23712 + getChildIndent : function(){ 1.23713 + if(!this.childIndent){ 1.23714 + var buf = []; 1.23715 + var p = this.node; 1.23716 + while(p){ 1.23717 + if(!p.isRoot || (p.isRoot && p.ownerTree.rootVisible)){ 1.23718 + if(!p.isLast()) { 1.23719 + buf.unshift('<img src="'+this.emptyIcon+'" class="x-tree-elbow-line" />'); 1.23720 + } else { 1.23721 + buf.unshift('<img src="'+this.emptyIcon+'" class="x-tree-icon" />'); 1.23722 + } 1.23723 + } 1.23724 + p = p.parentNode; 1.23725 + } 1.23726 + this.childIndent = buf.join(""); 1.23727 + } 1.23728 + return this.childIndent; 1.23729 + }, 1.23730 + 1.23731 + 1.23732 + renderIndent : function(){ 1.23733 + if(this.rendered){ 1.23734 + var indent = ""; 1.23735 + var p = this.node.parentNode; 1.23736 + if(p){ 1.23737 + indent = p.ui.getChildIndent(); 1.23738 + } 1.23739 + if(this.indentMarkup != indent){ 1.23740 + this.indentNode.innerHTML = indent; 1.23741 + this.indentMarkup = indent; 1.23742 + } 1.23743 + this.updateExpandIcon(); 1.23744 + } 1.23745 + }, 1.23746 + 1.23747 + destroy : function(){ 1.23748 + if(this.elNode){ 1.23749 + Ext.dd.Registry.unregister(this.elNode.id); 1.23750 + } 1.23751 + delete this.elNode; 1.23752 + delete this.ctNode; 1.23753 + delete this.indentNode; 1.23754 + delete this.ecNode; 1.23755 + delete this.iconNode; 1.23756 + delete this.checkbox; 1.23757 + delete this.anchor; 1.23758 + delete this.textNode; 1.23759 + Ext.removeNode(this.ctNode); 1.23760 + } 1.23761 +}; 1.23762 + 1.23763 + 1.23764 +Ext.tree.RootTreeNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { 1.23765 + 1.23766 + render : function(){ 1.23767 + if(!this.rendered){ 1.23768 + var targetNode = this.node.ownerTree.innerCt.dom; 1.23769 + this.node.expanded = true; 1.23770 + targetNode.innerHTML = '<div class="x-tree-root-node"></div>'; 1.23771 + this.wrap = this.ctNode = targetNode.firstChild; 1.23772 + } 1.23773 + }, 1.23774 + collapse : Ext.emptyFn, 1.23775 + expand : Ext.emptyFn 1.23776 +}); 1.23777 + 1.23778 +Ext.tree.TreeLoader = function(config){ 1.23779 + this.baseParams = {}; 1.23780 + Ext.apply(this, config); 1.23781 + 1.23782 + this.addEvents( 1.23783 + 1.23784 + "beforeload", 1.23785 + 1.23786 + "load", 1.23787 + 1.23788 + "loadexception" 1.23789 + ); 1.23790 + 1.23791 + Ext.tree.TreeLoader.superclass.constructor.call(this); 1.23792 +}; 1.23793 + 1.23794 +Ext.extend(Ext.tree.TreeLoader, Ext.util.Observable, { 1.23795 + 1.23796 + 1.23797 + 1.23798 + 1.23799 + 1.23800 + 1.23801 + 1.23802 + uiProviders : {}, 1.23803 + 1.23804 + 1.23805 + clearOnLoad : true, 1.23806 + 1.23807 + 1.23808 + load : function(node, callback){ 1.23809 + if(this.clearOnLoad){ 1.23810 + while(node.firstChild){ 1.23811 + node.removeChild(node.firstChild); 1.23812 + } 1.23813 + } 1.23814 + if(this.doPreload(node)){ 1.23815 + if(typeof callback == "function"){ 1.23816 + callback(); 1.23817 + } 1.23818 + }else if(this.dataUrl||this.url){ 1.23819 + this.requestData(node, callback); 1.23820 + } 1.23821 + }, 1.23822 + 1.23823 + doPreload : function(node){ 1.23824 + if(node.attributes.children){ 1.23825 + if(node.childNodes.length < 1){ 1.23826 + var cs = node.attributes.children; 1.23827 + node.beginUpdate(); 1.23828 + for(var i = 0, len = cs.length; i < len; i++){ 1.23829 + var cn = node.appendChild(this.createNode(cs[i])); 1.23830 + if(this.preloadChildren){ 1.23831 + this.doPreload(cn); 1.23832 + } 1.23833 + } 1.23834 + node.endUpdate(); 1.23835 + } 1.23836 + return true; 1.23837 + }else { 1.23838 + return false; 1.23839 + } 1.23840 + }, 1.23841 + 1.23842 + getParams: function(node){ 1.23843 + var buf = [], bp = this.baseParams; 1.23844 + for(var key in bp){ 1.23845 + if(typeof bp[key] != "function"){ 1.23846 + buf.push(encodeURIComponent(key), "=", encodeURIComponent(bp[key]), "&"); 1.23847 + } 1.23848 + } 1.23849 + buf.push("node=", encodeURIComponent(node.id)); 1.23850 + return buf.join(""); 1.23851 + }, 1.23852 + 1.23853 + requestData : function(node, callback){ 1.23854 + if(this.fireEvent("beforeload", this, node, callback) !== false){ 1.23855 + this.transId = Ext.Ajax.request({ 1.23856 + method:this.requestMethod, 1.23857 + url: this.dataUrl||this.url, 1.23858 + success: this.handleResponse, 1.23859 + failure: this.handleFailure, 1.23860 + scope: this, 1.23861 + argument: {callback: callback, node: node}, 1.23862 + params: this.getParams(node) 1.23863 + }); 1.23864 + }else{ 1.23865 + 1.23866 + 1.23867 + if(typeof callback == "function"){ 1.23868 + callback(); 1.23869 + } 1.23870 + } 1.23871 + }, 1.23872 + 1.23873 + isLoading : function(){ 1.23874 + return this.transId ? true : false; 1.23875 + }, 1.23876 + 1.23877 + abort : function(){ 1.23878 + if(this.isLoading()){ 1.23879 + Ext.Ajax.abort(this.transId); 1.23880 + } 1.23881 + }, 1.23882 + 1.23883 + 1.23884 + createNode : function(attr){ 1.23885 + 1.23886 + if(this.baseAttrs){ 1.23887 + Ext.applyIf(attr, this.baseAttrs); 1.23888 + } 1.23889 + if(this.applyLoader !== false){ 1.23890 + attr.loader = this; 1.23891 + } 1.23892 + if(typeof attr.uiProvider == 'string'){ 1.23893 + attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider); 1.23894 + } 1.23895 + return(attr.leaf ? 1.23896 + new Ext.tree.TreeNode(attr) : 1.23897 + new Ext.tree.AsyncTreeNode(attr)); 1.23898 + }, 1.23899 + 1.23900 + processResponse : function(response, node, callback){ 1.23901 + var json = response.responseText; 1.23902 + try { 1.23903 + var o = eval("("+json+")"); 1.23904 + node.beginUpdate(); 1.23905 + for(var i = 0, len = o.length; i < len; i++){ 1.23906 + var n = this.createNode(o[i]); 1.23907 + if(n){ 1.23908 + node.appendChild(n); 1.23909 + } 1.23910 + } 1.23911 + node.endUpdate(); 1.23912 + if(typeof callback == "function"){ 1.23913 + callback(this, node); 1.23914 + } 1.23915 + }catch(e){ 1.23916 + this.handleFailure(response); 1.23917 + } 1.23918 + }, 1.23919 + 1.23920 + handleResponse : function(response){ 1.23921 + this.transId = false; 1.23922 + var a = response.argument; 1.23923 + this.processResponse(response, a.node, a.callback); 1.23924 + this.fireEvent("load", this, a.node, response); 1.23925 + }, 1.23926 + 1.23927 + handleFailure : function(response){ 1.23928 + this.transId = false; 1.23929 + var a = response.argument; 1.23930 + this.fireEvent("loadexception", this, a.node, response); 1.23931 + if(typeof a.callback == "function"){ 1.23932 + a.callback(this, a.node); 1.23933 + } 1.23934 + } 1.23935 +}); 1.23936 + 1.23937 +Ext.tree.TreeFilter = function(tree, config){ 1.23938 + this.tree = tree; 1.23939 + this.filtered = {}; 1.23940 + Ext.apply(this, config); 1.23941 +}; 1.23942 + 1.23943 +Ext.tree.TreeFilter.prototype = { 1.23944 + clearBlank:false, 1.23945 + reverse:false, 1.23946 + autoClear:false, 1.23947 + remove:false, 1.23948 + 1.23949 + 1.23950 + filter : function(value, attr, startNode){ 1.23951 + attr = attr || "text"; 1.23952 + var f; 1.23953 + if(typeof value == "string"){ 1.23954 + var vlen = value.length; 1.23955 + 1.23956 + if(vlen == 0 && this.clearBlank){ 1.23957 + this.clear(); 1.23958 + return; 1.23959 + } 1.23960 + value = value.toLowerCase(); 1.23961 + f = function(n){ 1.23962 + return n.attributes[attr].substr(0, vlen).toLowerCase() == value; 1.23963 + }; 1.23964 + }else if(value.exec){ 1.23965 + f = function(n){ 1.23966 + return value.test(n.attributes[attr]); 1.23967 + }; 1.23968 + }else{ 1.23969 + throw 'Illegal filter type, must be string or regex'; 1.23970 + } 1.23971 + this.filterBy(f, null, startNode); 1.23972 + }, 1.23973 + 1.23974 + 1.23975 + filterBy : function(fn, scope, startNode){ 1.23976 + startNode = startNode || this.tree.root; 1.23977 + if(this.autoClear){ 1.23978 + this.clear(); 1.23979 + } 1.23980 + var af = this.filtered, rv = this.reverse; 1.23981 + var f = function(n){ 1.23982 + if(n == startNode){ 1.23983 + return true; 1.23984 + } 1.23985 + if(af[n.id]){ 1.23986 + return false; 1.23987 + } 1.23988 + var m = fn.call(scope || n, n); 1.23989 + if(!m || rv){ 1.23990 + af[n.id] = n; 1.23991 + n.ui.hide(); 1.23992 + return false; 1.23993 + } 1.23994 + return true; 1.23995 + }; 1.23996 + startNode.cascade(f); 1.23997 + if(this.remove){ 1.23998 + for(var id in af){ 1.23999 + if(typeof id != "function"){ 1.24000 + var n = af[id]; 1.24001 + if(n && n.parentNode){ 1.24002 + n.parentNode.removeChild(n); 1.24003 + } 1.24004 + } 1.24005 + } 1.24006 + } 1.24007 + }, 1.24008 + 1.24009 + 1.24010 + clear : function(){ 1.24011 + var t = this.tree; 1.24012 + var af = this.filtered; 1.24013 + for(var id in af){ 1.24014 + if(typeof id != "function"){ 1.24015 + var n = af[id]; 1.24016 + if(n){ 1.24017 + n.ui.show(); 1.24018 + } 1.24019 + } 1.24020 + } 1.24021 + this.filtered = {}; 1.24022 + } 1.24023 +}; 1.24024 + 1.24025 + 1.24026 +Ext.tree.TreeSorter = function(tree, config){ 1.24027 + 1.24028 + 1.24029 + 1.24030 + 1.24031 + 1.24032 + 1.24033 + 1.24034 + Ext.apply(this, config); 1.24035 + tree.on("beforechildrenrendered", this.doSort, this); 1.24036 + tree.on("append", this.updateSort, this); 1.24037 + tree.on("insert", this.updateSort, this); 1.24038 + tree.on("textchange", this.updateSortParent, this); 1.24039 + 1.24040 + var dsc = this.dir && this.dir.toLowerCase() == "desc"; 1.24041 + var p = this.property || "text"; 1.24042 + var sortType = this.sortType; 1.24043 + var fs = this.folderSort; 1.24044 + var cs = this.caseSensitive === true; 1.24045 + var leafAttr = this.leafAttr || 'leaf'; 1.24046 + 1.24047 + this.sortFn = function(n1, n2){ 1.24048 + if(fs){ 1.24049 + if(n1.attributes[leafAttr] && !n2.attributes[leafAttr]){ 1.24050 + return 1; 1.24051 + } 1.24052 + if(!n1.attributes[leafAttr] && n2.attributes[leafAttr]){ 1.24053 + return -1; 1.24054 + } 1.24055 + } 1.24056 + var v1 = sortType ? sortType(n1) : (cs ? n1.attributes[p] : n1.attributes[p].toUpperCase()); 1.24057 + var v2 = sortType ? sortType(n2) : (cs ? n2.attributes[p] : n2.attributes[p].toUpperCase()); 1.24058 + if(v1 < v2){ 1.24059 + return dsc ? +1 : -1; 1.24060 + }else if(v1 > v2){ 1.24061 + return dsc ? -1 : +1; 1.24062 + }else{ 1.24063 + return 0; 1.24064 + } 1.24065 + }; 1.24066 +}; 1.24067 + 1.24068 +Ext.tree.TreeSorter.prototype = { 1.24069 + doSort : function(node){ 1.24070 + node.sort(this.sortFn); 1.24071 + }, 1.24072 + 1.24073 + compareNodes : function(n1, n2){ 1.24074 + return (n1.text.toUpperCase() > n2.text.toUpperCase() ? 1 : -1); 1.24075 + }, 1.24076 + 1.24077 + updateSort : function(tree, node){ 1.24078 + if(node.childrenRendered){ 1.24079 + this.doSort.defer(1, this, [node]); 1.24080 + } 1.24081 + }, 1.24082 + 1.24083 + updateSortParent : function(node){ 1.24084 + var p = node.parentNode; 1.24085 + if(p && p.childrenRendered){ 1.24086 + this.doSort.defer(1, this, [p]); 1.24087 + } 1.24088 + } 1.24089 +}; 1.24090 + 1.24091 +if(Ext.dd.DropZone){ 1.24092 + 1.24093 +Ext.tree.TreeDropZone = function(tree, config){ 1.24094 + 1.24095 + this.allowParentInsert = false; 1.24096 + 1.24097 + this.allowContainerDrop = false; 1.24098 + 1.24099 + this.appendOnly = false; 1.24100 + Ext.tree.TreeDropZone.superclass.constructor.call(this, tree.innerCt, config); 1.24101 + 1.24102 + this.tree = tree; 1.24103 + 1.24104 + this.dragOverData = {}; 1.24105 + 1.24106 + this.lastInsertClass = "x-tree-no-status"; 1.24107 +}; 1.24108 + 1.24109 +Ext.extend(Ext.tree.TreeDropZone, Ext.dd.DropZone, { 1.24110 + 1.24111 + ddGroup : "TreeDD", 1.24112 + 1.24113 + 1.24114 + expandDelay : 1000, 1.24115 + 1.24116 + 1.24117 + expandNode : function(node){ 1.24118 + if(node.hasChildNodes() && !node.isExpanded()){ 1.24119 + node.expand(false, null, this.triggerCacheRefresh.createDelegate(this)); 1.24120 + } 1.24121 + }, 1.24122 + 1.24123 + 1.24124 + queueExpand : function(node){ 1.24125 + this.expandProcId = this.expandNode.defer(this.expandDelay, this, [node]); 1.24126 + }, 1.24127 + 1.24128 + 1.24129 + cancelExpand : function(){ 1.24130 + if(this.expandProcId){ 1.24131 + clearTimeout(this.expandProcId); 1.24132 + this.expandProcId = false; 1.24133 + } 1.24134 + }, 1.24135 + 1.24136 + 1.24137 + isValidDropPoint : function(n, pt, dd, e, data){ 1.24138 + if(!n || !data){ return false; } 1.24139 + var targetNode = n.node; 1.24140 + var dropNode = data.node; 1.24141 + 1.24142 + if(!(targetNode && targetNode.isTarget && pt)){ 1.24143 + return false; 1.24144 + } 1.24145 + if(pt == "append" && targetNode.allowChildren === false){ 1.24146 + return false; 1.24147 + } 1.24148 + if((pt == "above" || pt == "below") && (targetNode.parentNode && targetNode.parentNode.allowChildren === false)){ 1.24149 + return false; 1.24150 + } 1.24151 + if(dropNode && (targetNode == dropNode || dropNode.contains(targetNode))){ 1.24152 + return false; 1.24153 + } 1.24154 + 1.24155 + var overEvent = this.dragOverData; 1.24156 + overEvent.tree = this.tree; 1.24157 + overEvent.target = targetNode; 1.24158 + overEvent.data = data; 1.24159 + overEvent.point = pt; 1.24160 + overEvent.source = dd; 1.24161 + overEvent.rawEvent = e; 1.24162 + overEvent.dropNode = dropNode; 1.24163 + overEvent.cancel = false; 1.24164 + var result = this.tree.fireEvent("nodedragover", overEvent); 1.24165 + return overEvent.cancel === false && result !== false; 1.24166 + }, 1.24167 + 1.24168 + 1.24169 + getDropPoint : function(e, n, dd){ 1.24170 + var tn = n.node; 1.24171 + if(tn.isRoot){ 1.24172 + return tn.allowChildren !== false ? "append" : false; 1.24173 + } 1.24174 + var dragEl = n.ddel; 1.24175 + var t = Ext.lib.Dom.getY(dragEl), b = t + dragEl.offsetHeight; 1.24176 + var y = Ext.lib.Event.getPageY(e); 1.24177 + var noAppend = tn.allowChildren === false || tn.isLeaf(); 1.24178 + if(this.appendOnly || tn.parentNode.allowChildren === false){ 1.24179 + return noAppend ? false : "append"; 1.24180 + } 1.24181 + var noBelow = false; 1.24182 + if(!this.allowParentInsert){ 1.24183 + noBelow = tn.hasChildNodes() && tn.isExpanded(); 1.24184 + } 1.24185 + var q = (b - t) / (noAppend ? 2 : 3); 1.24186 + if(y >= t && y < (t + q)){ 1.24187 + return "above"; 1.24188 + }else if(!noBelow && (noAppend || y >= b-q && y <= b)){ 1.24189 + return "below"; 1.24190 + }else{ 1.24191 + return "append"; 1.24192 + } 1.24193 + }, 1.24194 + 1.24195 + 1.24196 + onNodeEnter : function(n, dd, e, data){ 1.24197 + this.cancelExpand(); 1.24198 + }, 1.24199 + 1.24200 + 1.24201 + onNodeOver : function(n, dd, e, data){ 1.24202 + var pt = this.getDropPoint(e, n, dd); 1.24203 + var node = n.node; 1.24204 + 1.24205 + 1.24206 + if(!this.expandProcId && pt == "append" && node.hasChildNodes() && !n.node.isExpanded()){ 1.24207 + this.queueExpand(node); 1.24208 + }else if(pt != "append"){ 1.24209 + this.cancelExpand(); 1.24210 + } 1.24211 + 1.24212 + 1.24213 + var returnCls = this.dropNotAllowed; 1.24214 + if(this.isValidDropPoint(n, pt, dd, e, data)){ 1.24215 + if(pt){ 1.24216 + var el = n.ddel; 1.24217 + var cls; 1.24218 + if(pt == "above"){ 1.24219 + returnCls = n.node.isFirst() ? "x-tree-drop-ok-above" : "x-tree-drop-ok-between"; 1.24220 + cls = "x-tree-drag-insert-above"; 1.24221 + }else if(pt == "below"){ 1.24222 + returnCls = n.node.isLast() ? "x-tree-drop-ok-below" : "x-tree-drop-ok-between"; 1.24223 + cls = "x-tree-drag-insert-below"; 1.24224 + }else{ 1.24225 + returnCls = "x-tree-drop-ok-append"; 1.24226 + cls = "x-tree-drag-append"; 1.24227 + } 1.24228 + if(this.lastInsertClass != cls){ 1.24229 + Ext.fly(el).replaceClass(this.lastInsertClass, cls); 1.24230 + this.lastInsertClass = cls; 1.24231 + } 1.24232 + } 1.24233 + } 1.24234 + return returnCls; 1.24235 + }, 1.24236 + 1.24237 + 1.24238 + onNodeOut : function(n, dd, e, data){ 1.24239 + this.cancelExpand(); 1.24240 + this.removeDropIndicators(n); 1.24241 + }, 1.24242 + 1.24243 + 1.24244 + onNodeDrop : function(n, dd, e, data){ 1.24245 + var point = this.getDropPoint(e, n, dd); 1.24246 + var targetNode = n.node; 1.24247 + targetNode.ui.startDrop(); 1.24248 + if(!this.isValidDropPoint(n, point, dd, e, data)){ 1.24249 + targetNode.ui.endDrop(); 1.24250 + return false; 1.24251 + } 1.24252 + 1.24253 + var dropNode = data.node || (dd.getTreeNode ? dd.getTreeNode(data, targetNode, point, e) : null); 1.24254 + var dropEvent = { 1.24255 + tree : this.tree, 1.24256 + target: targetNode, 1.24257 + data: data, 1.24258 + point: point, 1.24259 + source: dd, 1.24260 + rawEvent: e, 1.24261 + dropNode: dropNode, 1.24262 + cancel: !dropNode, 1.24263 + dropStatus: false 1.24264 + }; 1.24265 + var retval = this.tree.fireEvent("beforenodedrop", dropEvent); 1.24266 + if(retval === false || dropEvent.cancel === true || !dropEvent.dropNode){ 1.24267 + targetNode.ui.endDrop(); 1.24268 + return dropEvent.dropStatus; 1.24269 + } 1.24270 + 1.24271 + targetNode = dropEvent.target; 1.24272 + if(point == "append" && !targetNode.isExpanded()){ 1.24273 + targetNode.expand(false, null, function(){ 1.24274 + this.completeDrop(dropEvent); 1.24275 + }.createDelegate(this)); 1.24276 + }else{ 1.24277 + this.completeDrop(dropEvent); 1.24278 + } 1.24279 + return true; 1.24280 + }, 1.24281 + 1.24282 + 1.24283 + completeDrop : function(de){ 1.24284 + var ns = de.dropNode, p = de.point, t = de.target; 1.24285 + if(!Ext.isArray(ns)){ 1.24286 + ns = [ns]; 1.24287 + } 1.24288 + var n; 1.24289 + for(var i = 0, len = ns.length; i < len; i++){ 1.24290 + n = ns[i]; 1.24291 + if(p == "above"){ 1.24292 + t.parentNode.insertBefore(n, t); 1.24293 + }else if(p == "below"){ 1.24294 + t.parentNode.insertBefore(n, t.nextSibling); 1.24295 + }else{ 1.24296 + t.appendChild(n); 1.24297 + } 1.24298 + } 1.24299 + n.ui.focus(); 1.24300 + if(this.tree.hlDrop){ 1.24301 + n.ui.highlight(); 1.24302 + } 1.24303 + t.ui.endDrop(); 1.24304 + this.tree.fireEvent("nodedrop", de); 1.24305 + }, 1.24306 + 1.24307 + 1.24308 + afterNodeMoved : function(dd, data, e, targetNode, dropNode){ 1.24309 + if(this.tree.hlDrop){ 1.24310 + dropNode.ui.focus(); 1.24311 + dropNode.ui.highlight(); 1.24312 + } 1.24313 + this.tree.fireEvent("nodedrop", this.tree, targetNode, data, dd, e); 1.24314 + }, 1.24315 + 1.24316 + 1.24317 + getTree : function(){ 1.24318 + return this.tree; 1.24319 + }, 1.24320 + 1.24321 + 1.24322 + removeDropIndicators : function(n){ 1.24323 + if(n && n.ddel){ 1.24324 + var el = n.ddel; 1.24325 + Ext.fly(el).removeClass([ 1.24326 + "x-tree-drag-insert-above", 1.24327 + "x-tree-drag-insert-below", 1.24328 + "x-tree-drag-append"]); 1.24329 + this.lastInsertClass = "_noclass"; 1.24330 + } 1.24331 + }, 1.24332 + 1.24333 + 1.24334 + beforeDragDrop : function(target, e, id){ 1.24335 + this.cancelExpand(); 1.24336 + return true; 1.24337 + }, 1.24338 + 1.24339 + 1.24340 + afterRepair : function(data){ 1.24341 + if(data && Ext.enableFx){ 1.24342 + data.node.ui.highlight(); 1.24343 + } 1.24344 + this.hideProxy(); 1.24345 + } 1.24346 +}); 1.24347 + 1.24348 +} 1.24349 + 1.24350 +if(Ext.dd.DragZone){ 1.24351 +Ext.tree.TreeDragZone = function(tree, config){ 1.24352 + Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.getTreeEl(), config); 1.24353 + 1.24354 + this.tree = tree; 1.24355 +}; 1.24356 + 1.24357 +Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, { 1.24358 + 1.24359 + ddGroup : "TreeDD", 1.24360 + 1.24361 + 1.24362 + onBeforeDrag : function(data, e){ 1.24363 + var n = data.node; 1.24364 + return n && n.draggable && !n.disabled; 1.24365 + }, 1.24366 + 1.24367 + 1.24368 + onInitDrag : function(e){ 1.24369 + var data = this.dragData; 1.24370 + this.tree.getSelectionModel().select(data.node); 1.24371 + this.tree.eventModel.disable(); 1.24372 + this.proxy.update(""); 1.24373 + data.node.ui.appendDDGhost(this.proxy.ghost.dom); 1.24374 + this.tree.fireEvent("startdrag", this.tree, data.node, e); 1.24375 + }, 1.24376 + 1.24377 + 1.24378 + getRepairXY : function(e, data){ 1.24379 + return data.node.ui.getDDRepairXY(); 1.24380 + }, 1.24381 + 1.24382 + 1.24383 + onEndDrag : function(data, e){ 1.24384 + this.tree.eventModel.enable.defer(100, this.tree.eventModel); 1.24385 + this.tree.fireEvent("enddrag", this.tree, data.node, e); 1.24386 + }, 1.24387 + 1.24388 + 1.24389 + onValidDrop : function(dd, e, id){ 1.24390 + this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e); 1.24391 + this.hideProxy(); 1.24392 + }, 1.24393 + 1.24394 + 1.24395 + beforeInvalidDrop : function(e, id){ 1.24396 + 1.24397 + var sm = this.tree.getSelectionModel(); 1.24398 + sm.clearSelections(); 1.24399 + sm.select(this.dragData.node); 1.24400 + } 1.24401 +}); 1.24402 +} 1.24403 + 1.24404 +Ext.tree.TreeEditor = function(tree, fc, config){ 1.24405 + fc = fc || {}; 1.24406 + var field = fc.events ? fc : new Ext.form.TextField(fc); 1.24407 + Ext.tree.TreeEditor.superclass.constructor.call(this, field, config); 1.24408 + 1.24409 + this.tree = tree; 1.24410 + 1.24411 + if(!tree.rendered){ 1.24412 + tree.on('render', this.initEditor, this); 1.24413 + }else{ 1.24414 + this.initEditor(tree); 1.24415 + } 1.24416 +}; 1.24417 + 1.24418 +Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { 1.24419 + 1.24420 + alignment: "l-l", 1.24421 + autoSize: false, 1.24422 + 1.24423 + hideEl : false, 1.24424 + 1.24425 + cls: "x-small-editor x-tree-editor", 1.24426 + 1.24427 + shim:false, 1.24428 + shadow:"frame", 1.24429 + 1.24430 + maxWidth: 250, 1.24431 + 1.24432 + editDelay : 350, 1.24433 + 1.24434 + initEditor : function(tree){ 1.24435 + tree.on('beforeclick', this.beforeNodeClick, this); 1.24436 + tree.on('dblclick', this.onNodeDblClick, this); 1.24437 + this.on('complete', this.updateNode, this); 1.24438 + this.on('beforestartedit', this.fitToTree, this); 1.24439 + this.on('startedit', this.bindScroll, this, {delay:10}); 1.24440 + this.on('specialkey', this.onSpecialKey, this); 1.24441 + }, 1.24442 + 1.24443 + fitToTree : function(ed, el){ 1.24444 + var td = this.tree.getTreeEl().dom, nd = el.dom; 1.24445 + if(td.scrollLeft > nd.offsetLeft){ td.scrollLeft = nd.offsetLeft; 1.24446 + } 1.24447 + var w = Math.min( 1.24448 + this.maxWidth, 1.24449 + (td.clientWidth > 20 ? td.clientWidth : td.offsetWidth) - Math.max(0, nd.offsetLeft-td.scrollLeft) - 5); 1.24450 + this.setSize(w, ''); 1.24451 + }, 1.24452 + 1.24453 + triggerEdit : function(node, defer){ 1.24454 + this.completeEdit(); 1.24455 + if(node.attributes.editable !== false){ 1.24456 + this.editNode = node; 1.24457 + this.autoEditTimer = this.startEdit.defer(this.editDelay, this, [node.ui.textNode, node.text]); 1.24458 + return false; 1.24459 + } 1.24460 + }, 1.24461 + 1.24462 + bindScroll : function(){ 1.24463 + this.tree.getTreeEl().on('scroll', this.cancelEdit, this); 1.24464 + }, 1.24465 + 1.24466 + beforeNodeClick : function(node, e){ 1.24467 + clearTimeout(this.autoEditTimer); 1.24468 + if(this.tree.getSelectionModel().isSelected(node)){ 1.24469 + e.stopEvent(); 1.24470 + return this.triggerEdit(node); 1.24471 + } 1.24472 + }, 1.24473 + 1.24474 + onNodeDblClick : function(node, e){ 1.24475 + clearTimeout(this.autoEditTimer); 1.24476 + }, 1.24477 + 1.24478 + updateNode : function(ed, value){ 1.24479 + this.tree.getTreeEl().un('scroll', this.cancelEdit, this); 1.24480 + this.editNode.setText(value); 1.24481 + }, 1.24482 + 1.24483 + onHide : function(){ 1.24484 + Ext.tree.TreeEditor.superclass.onHide.call(this); 1.24485 + if(this.editNode){ 1.24486 + this.editNode.ui.focus.defer(50, this.editNode.ui); 1.24487 + } 1.24488 + }, 1.24489 + 1.24490 + onSpecialKey : function(field, e){ 1.24491 + var k = e.getKey(); 1.24492 + if(k == e.ESC){ 1.24493 + e.stopEvent(); 1.24494 + this.cancelEdit(); 1.24495 + }else if(k == e.ENTER && !e.hasModifier()){ 1.24496 + e.stopEvent(); 1.24497 + this.completeEdit(); 1.24498 + } 1.24499 + } 1.24500 +}); 1.24501 + 1.24502 +Ext.menu.Menu = function(config){ 1.24503 + if(Ext.isArray(config)){ 1.24504 + config = {items:config}; 1.24505 + } 1.24506 + Ext.apply(this, config); 1.24507 + this.id = this.id || Ext.id(); 1.24508 + this.addEvents( 1.24509 + 1.24510 + 'beforeshow', 1.24511 + 1.24512 + 'beforehide', 1.24513 + 1.24514 + 'show', 1.24515 + 1.24516 + 'hide', 1.24517 + 1.24518 + 'click', 1.24519 + 1.24520 + 'mouseover', 1.24521 + 1.24522 + 'mouseout', 1.24523 + 1.24524 + 'itemclick' 1.24525 + ); 1.24526 + Ext.menu.MenuMgr.register(this); 1.24527 + Ext.menu.Menu.superclass.constructor.call(this); 1.24528 + var mis = this.items; 1.24529 + 1.24530 + 1.24531 + this.items = new Ext.util.MixedCollection(); 1.24532 + if(mis){ 1.24533 + this.add.apply(this, mis); 1.24534 + } 1.24535 +}; 1.24536 + 1.24537 +Ext.extend(Ext.menu.Menu, Ext.util.Observable, { 1.24538 + 1.24539 + 1.24540 + 1.24541 + minWidth : 120, 1.24542 + 1.24543 + shadow : "sides", 1.24544 + 1.24545 + subMenuAlign : "tl-tr?", 1.24546 + 1.24547 + defaultAlign : "tl-bl?", 1.24548 + 1.24549 + allowOtherMenus : false, 1.24550 + 1.24551 + hidden:true, 1.24552 + 1.24553 + createEl : function(){ 1.24554 + return new Ext.Layer({ 1.24555 + cls: "x-menu", 1.24556 + shadow:this.shadow, 1.24557 + constrain: false, 1.24558 + parentEl: this.parentEl || document.body, 1.24559 + zindex:15000 1.24560 + }); 1.24561 + }, 1.24562 + 1.24563 + render : function(){ 1.24564 + if(this.el){ 1.24565 + return; 1.24566 + } 1.24567 + var el = this.el = this.createEl(); 1.24568 + 1.24569 + if(!this.keyNav){ 1.24570 + this.keyNav = new Ext.menu.MenuNav(this); 1.24571 + } 1.24572 + if(this.plain){ 1.24573 + el.addClass("x-menu-plain"); 1.24574 + } 1.24575 + if(this.cls){ 1.24576 + el.addClass(this.cls); 1.24577 + } 1.24578 + this.focusEl = el.createChild({ 1.24579 + tag: "a", cls: "x-menu-focus", href: "#", onclick: "return false;", tabIndex:"-1" 1.24580 + }); 1.24581 + var ul = el.createChild({tag: "ul", cls: "x-menu-list"}); 1.24582 + ul.on("click", this.onClick, this); 1.24583 + ul.on("mouseover", this.onMouseOver, this); 1.24584 + ul.on("mouseout", this.onMouseOut, this); 1.24585 + this.items.each(function(item){ 1.24586 + var li = document.createElement("li"); 1.24587 + li.className = "x-menu-list-item"; 1.24588 + ul.dom.appendChild(li); 1.24589 + item.render(li, this); 1.24590 + }, this); 1.24591 + this.ul = ul; 1.24592 + this.autoWidth(); 1.24593 + }, 1.24594 + 1.24595 + autoWidth : function(){ 1.24596 + var el = this.el, ul = this.ul; 1.24597 + if(!el){ 1.24598 + return; 1.24599 + } 1.24600 + var w = this.width; 1.24601 + if(w){ 1.24602 + el.setWidth(w); 1.24603 + }else if(Ext.isIE){ 1.24604 + el.setWidth(this.minWidth); 1.24605 + var t = el.dom.offsetWidth; el.setWidth(ul.getWidth()+el.getFrameWidth("lr")); 1.24606 + } 1.24607 + }, 1.24608 + 1.24609 + delayAutoWidth : function(){ 1.24610 + if(this.el){ 1.24611 + if(!this.awTask){ 1.24612 + this.awTask = new Ext.util.DelayedTask(this.autoWidth, this); 1.24613 + } 1.24614 + this.awTask.delay(20); 1.24615 + } 1.24616 + }, 1.24617 + 1.24618 + findTargetItem : function(e){ 1.24619 + var t = e.getTarget(".x-menu-list-item", this.ul, true); 1.24620 + if(t && t.menuItemId){ 1.24621 + return this.items.get(t.menuItemId); 1.24622 + } 1.24623 + }, 1.24624 + 1.24625 + onClick : function(e){ 1.24626 + var t; 1.24627 + if(t = this.findTargetItem(e)){ 1.24628 + t.onClick(e); 1.24629 + this.fireEvent("click", this, t, e); 1.24630 + } 1.24631 + }, 1.24632 + 1.24633 + setActiveItem : function(item, autoExpand){ 1.24634 + if(item != this.activeItem){ 1.24635 + if(this.activeItem){ 1.24636 + this.activeItem.deactivate(); 1.24637 + } 1.24638 + this.activeItem = item; 1.24639 + item.activate(autoExpand); 1.24640 + }else if(autoExpand){ 1.24641 + item.expandMenu(); 1.24642 + } 1.24643 + }, 1.24644 + 1.24645 + tryActivate : function(start, step){ 1.24646 + var items = this.items; 1.24647 + for(var i = start, len = items.length; i >= 0 && i < len; i+= step){ 1.24648 + var item = items.get(i); 1.24649 + if(!item.disabled && item.canActivate){ 1.24650 + this.setActiveItem(item, false); 1.24651 + return item; 1.24652 + } 1.24653 + } 1.24654 + return false; 1.24655 + }, 1.24656 + 1.24657 + onMouseOver : function(e){ 1.24658 + var t; 1.24659 + if(t = this.findTargetItem(e)){ 1.24660 + if(t.canActivate && !t.disabled){ 1.24661 + this.setActiveItem(t, true); 1.24662 + } 1.24663 + } 1.24664 + this.fireEvent("mouseover", this, e, t); 1.24665 + }, 1.24666 + 1.24667 + onMouseOut : function(e){ 1.24668 + var t; 1.24669 + if(t = this.findTargetItem(e)){ 1.24670 + if(t == this.activeItem && t.shouldDeactivate(e)){ 1.24671 + this.activeItem.deactivate(); 1.24672 + delete this.activeItem; 1.24673 + } 1.24674 + } 1.24675 + this.fireEvent("mouseout", this, e, t); 1.24676 + }, 1.24677 + 1.24678 + 1.24679 + isVisible : function(){ 1.24680 + return this.el && !this.hidden; 1.24681 + }, 1.24682 + 1.24683 + 1.24684 + show : function(el, pos, parentMenu){ 1.24685 + this.parentMenu = parentMenu; 1.24686 + if(!this.el){ 1.24687 + this.render(); 1.24688 + } 1.24689 + this.fireEvent("beforeshow", this); 1.24690 + this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign), parentMenu, false); 1.24691 + }, 1.24692 + 1.24693 + 1.24694 + showAt : function(xy, parentMenu, _e){ 1.24695 + this.parentMenu = parentMenu; 1.24696 + if(!this.el){ 1.24697 + this.render(); 1.24698 + } 1.24699 + if(_e !== false){ 1.24700 + this.fireEvent("beforeshow", this); 1.24701 + xy = this.el.adjustForConstraints(xy); 1.24702 + } 1.24703 + this.el.setXY(xy); 1.24704 + this.el.show(); 1.24705 + this.hidden = false; 1.24706 + this.focus(); 1.24707 + this.fireEvent("show", this); 1.24708 + }, 1.24709 + 1.24710 + 1.24711 + 1.24712 + focus : function(){ 1.24713 + if(!this.hidden){ 1.24714 + this.doFocus.defer(50, this); 1.24715 + } 1.24716 + }, 1.24717 + 1.24718 + doFocus : function(){ 1.24719 + if(!this.hidden){ 1.24720 + this.focusEl.focus(); 1.24721 + } 1.24722 + }, 1.24723 + 1.24724 + 1.24725 + hide : function(deep){ 1.24726 + if(this.el && this.isVisible()){ 1.24727 + this.fireEvent("beforehide", this); 1.24728 + if(this.activeItem){ 1.24729 + this.activeItem.deactivate(); 1.24730 + this.activeItem = null; 1.24731 + } 1.24732 + this.el.hide(); 1.24733 + this.hidden = true; 1.24734 + this.fireEvent("hide", this); 1.24735 + } 1.24736 + if(deep === true && this.parentMenu){ 1.24737 + this.parentMenu.hide(true); 1.24738 + } 1.24739 + }, 1.24740 + 1.24741 + 1.24742 + add : function(){ 1.24743 + var a = arguments, l = a.length, item; 1.24744 + for(var i = 0; i < l; i++){ 1.24745 + var el = a[i]; 1.24746 + if(el.render){ item = this.addItem(el); 1.24747 + }else if(typeof el == "string"){ if(el == "separator" || el == "-"){ 1.24748 + item = this.addSeparator(); 1.24749 + }else{ 1.24750 + item = this.addText(el); 1.24751 + } 1.24752 + }else if(el.tagName || el.el){ item = this.addElement(el); 1.24753 + }else if(typeof el == "object"){ Ext.applyIf(el, this.defaults); 1.24754 + item = this.addMenuItem(el); 1.24755 + } 1.24756 + } 1.24757 + return item; 1.24758 + }, 1.24759 + 1.24760 + 1.24761 + getEl : function(){ 1.24762 + if(!this.el){ 1.24763 + this.render(); 1.24764 + } 1.24765 + return this.el; 1.24766 + }, 1.24767 + 1.24768 + 1.24769 + addSeparator : function(){ 1.24770 + return this.addItem(new Ext.menu.Separator()); 1.24771 + }, 1.24772 + 1.24773 + 1.24774 + addElement : function(el){ 1.24775 + return this.addItem(new Ext.menu.BaseItem(el)); 1.24776 + }, 1.24777 + 1.24778 + 1.24779 + addItem : function(item){ 1.24780 + this.items.add(item); 1.24781 + if(this.ul){ 1.24782 + var li = document.createElement("li"); 1.24783 + li.className = "x-menu-list-item"; 1.24784 + this.ul.dom.appendChild(li); 1.24785 + item.render(li, this); 1.24786 + this.delayAutoWidth(); 1.24787 + } 1.24788 + return item; 1.24789 + }, 1.24790 + 1.24791 + 1.24792 + addMenuItem : function(config){ 1.24793 + if(!(config instanceof Ext.menu.Item)){ 1.24794 + if(typeof config.checked == "boolean"){ config = new Ext.menu.CheckItem(config); 1.24795 + }else{ 1.24796 + config = new Ext.menu.Item(config); 1.24797 + } 1.24798 + } 1.24799 + return this.addItem(config); 1.24800 + }, 1.24801 + 1.24802 + 1.24803 + addText : function(text){ 1.24804 + return this.addItem(new Ext.menu.TextItem(text)); 1.24805 + }, 1.24806 + 1.24807 + 1.24808 + insert : function(index, item){ 1.24809 + this.items.insert(index, item); 1.24810 + if(this.ul){ 1.24811 + var li = document.createElement("li"); 1.24812 + li.className = "x-menu-list-item"; 1.24813 + this.ul.dom.insertBefore(li, this.ul.dom.childNodes[index]); 1.24814 + item.render(li, this); 1.24815 + this.delayAutoWidth(); 1.24816 + } 1.24817 + return item; 1.24818 + }, 1.24819 + 1.24820 + 1.24821 + remove : function(item){ 1.24822 + this.items.removeKey(item.id); 1.24823 + item.destroy(); 1.24824 + }, 1.24825 + 1.24826 + 1.24827 + removeAll : function(){ 1.24828 + if(this.items){ 1.24829 + var f; 1.24830 + while(f = this.items.first()){ 1.24831 + this.remove(f); 1.24832 + } 1.24833 + } 1.24834 + }, 1.24835 + 1.24836 + 1.24837 + destroy : function(){ 1.24838 + this.beforeDestroy(); 1.24839 + Ext.menu.MenuMgr.unregister(this); 1.24840 + if (this.keyNav) { 1.24841 + this.keyNav.disable(); 1.24842 + } 1.24843 + this.removeAll(); 1.24844 + if (this.ul) { 1.24845 + this.ul.removeAllListeners(); 1.24846 + } 1.24847 + if (this.el) { 1.24848 + this.el.destroy(); 1.24849 + } 1.24850 + }, 1.24851 + 1.24852 + beforeDestroy : Ext.emptyFn 1.24853 + 1.24854 +}); 1.24855 + 1.24856 +Ext.menu.MenuNav = function(menu){ 1.24857 + Ext.menu.MenuNav.superclass.constructor.call(this, menu.el); 1.24858 + this.scope = this.menu = menu; 1.24859 +}; 1.24860 + 1.24861 +Ext.extend(Ext.menu.MenuNav, Ext.KeyNav, { 1.24862 + doRelay : function(e, h){ 1.24863 + var k = e.getKey(); 1.24864 + if(!this.menu.activeItem && e.isNavKeyPress() && k != e.SPACE && k != e.RETURN){ 1.24865 + this.menu.tryActivate(0, 1); 1.24866 + return false; 1.24867 + } 1.24868 + return h.call(this.scope || this, e, this.menu); 1.24869 + }, 1.24870 + 1.24871 + up : function(e, m){ 1.24872 + if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){ 1.24873 + m.tryActivate(m.items.length-1, -1); 1.24874 + } 1.24875 + }, 1.24876 + 1.24877 + down : function(e, m){ 1.24878 + if(!m.tryActivate(m.items.indexOf(m.activeItem)+1, 1)){ 1.24879 + m.tryActivate(0, 1); 1.24880 + } 1.24881 + }, 1.24882 + 1.24883 + right : function(e, m){ 1.24884 + if(m.activeItem){ 1.24885 + m.activeItem.expandMenu(true); 1.24886 + } 1.24887 + }, 1.24888 + 1.24889 + left : function(e, m){ 1.24890 + m.hide(); 1.24891 + if(m.parentMenu && m.parentMenu.activeItem){ 1.24892 + m.parentMenu.activeItem.activate(); 1.24893 + } 1.24894 + }, 1.24895 + 1.24896 + enter : function(e, m){ 1.24897 + if(m.activeItem){ 1.24898 + e.stopPropagation(); 1.24899 + m.activeItem.onClick(e); 1.24900 + m.fireEvent("click", this, m.activeItem); 1.24901 + return true; 1.24902 + } 1.24903 + } 1.24904 +}); 1.24905 + 1.24906 +Ext.menu.MenuMgr = function(){ 1.24907 + var menus, active, groups = {}, attached = false, lastShow = new Date(); 1.24908 + 1.24909 + function init(){ 1.24910 + menus = {}; 1.24911 + active = new Ext.util.MixedCollection(); 1.24912 + Ext.getDoc().addKeyListener(27, function(){ 1.24913 + if(active.length > 0){ 1.24914 + hideAll(); 1.24915 + } 1.24916 + }); 1.24917 + } 1.24918 + 1.24919 + function hideAll(){ 1.24920 + if(active && active.length > 0){ 1.24921 + var c = active.clone(); 1.24922 + c.each(function(m){ 1.24923 + m.hide(); 1.24924 + }); 1.24925 + } 1.24926 + } 1.24927 + 1.24928 + function onHide(m){ 1.24929 + active.remove(m); 1.24930 + if(active.length < 1){ 1.24931 + Ext.getDoc().un("mousedown", onMouseDown); 1.24932 + attached = false; 1.24933 + } 1.24934 + } 1.24935 + 1.24936 + function onShow(m){ 1.24937 + var last = active.last(); 1.24938 + lastShow = new Date(); 1.24939 + active.add(m); 1.24940 + if(!attached){ 1.24941 + Ext.getDoc().on("mousedown", onMouseDown); 1.24942 + attached = true; 1.24943 + } 1.24944 + if(m.parentMenu){ 1.24945 + m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3); 1.24946 + m.parentMenu.activeChild = m; 1.24947 + }else if(last && last.isVisible()){ 1.24948 + m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3); 1.24949 + } 1.24950 + } 1.24951 + 1.24952 + function onBeforeHide(m){ 1.24953 + if(m.activeChild){ 1.24954 + m.activeChild.hide(); 1.24955 + } 1.24956 + if(m.autoHideTimer){ 1.24957 + clearTimeout(m.autoHideTimer); 1.24958 + delete m.autoHideTimer; 1.24959 + } 1.24960 + } 1.24961 + 1.24962 + function onBeforeShow(m){ 1.24963 + var pm = m.parentMenu; 1.24964 + if(!pm && !m.allowOtherMenus){ 1.24965 + hideAll(); 1.24966 + }else if(pm && pm.activeChild){ 1.24967 + pm.activeChild.hide(); 1.24968 + } 1.24969 + } 1.24970 + 1.24971 + function onMouseDown(e){ 1.24972 + if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){ 1.24973 + hideAll(); 1.24974 + } 1.24975 + } 1.24976 + 1.24977 + function onBeforeCheck(mi, state){ 1.24978 + if(state){ 1.24979 + var g = groups[mi.group]; 1.24980 + for(var i = 0, l = g.length; i < l; i++){ 1.24981 + if(g[i] != mi){ 1.24982 + g[i].setChecked(false); 1.24983 + } 1.24984 + } 1.24985 + } 1.24986 + } 1.24987 + 1.24988 + return { 1.24989 + 1.24990 + 1.24991 + hideAll : function(){ 1.24992 + hideAll(); 1.24993 + }, 1.24994 + 1.24995 + register : function(menu){ 1.24996 + if(!menus){ 1.24997 + init(); 1.24998 + } 1.24999 + menus[menu.id] = menu; 1.25000 + menu.on("beforehide", onBeforeHide); 1.25001 + menu.on("hide", onHide); 1.25002 + menu.on("beforeshow", onBeforeShow); 1.25003 + menu.on("show", onShow); 1.25004 + var g = menu.group; 1.25005 + if(g && menu.events["checkchange"]){ 1.25006 + if(!groups[g]){ 1.25007 + groups[g] = []; 1.25008 + } 1.25009 + groups[g].push(menu); 1.25010 + menu.on("checkchange", onCheck); 1.25011 + } 1.25012 + }, 1.25013 + 1.25014 + 1.25015 + get : function(menu){ 1.25016 + if(typeof menu == "string"){ if(!menus){ return null; 1.25017 + } 1.25018 + return menus[menu]; 1.25019 + }else if(menu.events){ return menu; 1.25020 + }else if(typeof menu.length == 'number'){ return new Ext.menu.Menu({items:menu}); 1.25021 + }else{ return new Ext.menu.Menu(menu); 1.25022 + } 1.25023 + }, 1.25024 + 1.25025 + unregister : function(menu){ 1.25026 + delete menus[menu.id]; 1.25027 + menu.un("beforehide", onBeforeHide); 1.25028 + menu.un("hide", onHide); 1.25029 + menu.un("beforeshow", onBeforeShow); 1.25030 + menu.un("show", onShow); 1.25031 + var g = menu.group; 1.25032 + if(g && menu.events["checkchange"]){ 1.25033 + groups[g].remove(menu); 1.25034 + menu.un("checkchange", onCheck); 1.25035 + } 1.25036 + }, 1.25037 + 1.25038 + registerCheckable : function(menuItem){ 1.25039 + var g = menuItem.group; 1.25040 + if(g){ 1.25041 + if(!groups[g]){ 1.25042 + groups[g] = []; 1.25043 + } 1.25044 + groups[g].push(menuItem); 1.25045 + menuItem.on("beforecheckchange", onBeforeCheck); 1.25046 + } 1.25047 + }, 1.25048 + 1.25049 + unregisterCheckable : function(menuItem){ 1.25050 + var g = menuItem.group; 1.25051 + if(g){ 1.25052 + groups[g].remove(menuItem); 1.25053 + menuItem.un("beforecheckchange", onBeforeCheck); 1.25054 + } 1.25055 + }, 1.25056 + 1.25057 + getCheckedItem : function(groupId){ 1.25058 + var g = groups[groupId]; 1.25059 + if(g){ 1.25060 + for(var i = 0, l = g.length; i < l; i++){ 1.25061 + if(g[i].checked){ 1.25062 + return g[i]; 1.25063 + } 1.25064 + } 1.25065 + } 1.25066 + return null; 1.25067 + }, 1.25068 + 1.25069 + setCheckedItem : function(groupId, itemId){ 1.25070 + var g = groups[groupId]; 1.25071 + if(g){ 1.25072 + for(var i = 0, l = g.length; i < l; i++){ 1.25073 + if(g[i].id == itemId){ 1.25074 + g[i].setChecked(true); 1.25075 + } 1.25076 + } 1.25077 + } 1.25078 + return null; 1.25079 + } 1.25080 + }; 1.25081 +}(); 1.25082 + 1.25083 + 1.25084 +Ext.menu.BaseItem = function(config){ 1.25085 + Ext.menu.BaseItem.superclass.constructor.call(this, config); 1.25086 + 1.25087 + this.addEvents( 1.25088 + 1.25089 + 'click', 1.25090 + 1.25091 + 'activate', 1.25092 + 1.25093 + 'deactivate' 1.25094 + ); 1.25095 + 1.25096 + if(this.handler){ 1.25097 + this.on("click", this.handler, this.scope); 1.25098 + } 1.25099 +}; 1.25100 + 1.25101 +Ext.extend(Ext.menu.BaseItem, Ext.Component, { 1.25102 + 1.25103 + 1.25104 + 1.25105 + canActivate : false, 1.25106 + 1.25107 + activeClass : "x-menu-item-active", 1.25108 + 1.25109 + hideOnClick : true, 1.25110 + 1.25111 + hideDelay : 100, 1.25112 + 1.25113 + ctype: "Ext.menu.BaseItem", 1.25114 + 1.25115 + actionMode : "container", 1.25116 + 1.25117 + render : function(container, parentMenu){ 1.25118 + this.parentMenu = parentMenu; 1.25119 + Ext.menu.BaseItem.superclass.render.call(this, container); 1.25120 + this.container.menuItemId = this.id; 1.25121 + }, 1.25122 + 1.25123 + onRender : function(container, position){ 1.25124 + this.el = Ext.get(this.el); 1.25125 + container.dom.appendChild(this.el.dom); 1.25126 + }, 1.25127 + 1.25128 + 1.25129 + setHandler : function(handler, scope){ 1.25130 + if(this.handler){ 1.25131 + this.un("click", this.handler, this.scope); 1.25132 + } 1.25133 + this.on("click", this.handler = handler, this.scope = scope); 1.25134 + }, 1.25135 + 1.25136 + onClick : function(e){ 1.25137 + if(!this.disabled && this.fireEvent("click", this, e) !== false 1.25138 + && this.parentMenu.fireEvent("itemclick", this, e) !== false){ 1.25139 + this.handleClick(e); 1.25140 + }else{ 1.25141 + e.stopEvent(); 1.25142 + } 1.25143 + }, 1.25144 + 1.25145 + activate : function(){ 1.25146 + if(this.disabled){ 1.25147 + return false; 1.25148 + } 1.25149 + var li = this.container; 1.25150 + li.addClass(this.activeClass); 1.25151 + this.region = li.getRegion().adjust(2, 2, -2, -2); 1.25152 + this.fireEvent("activate", this); 1.25153 + return true; 1.25154 + }, 1.25155 + 1.25156 + deactivate : function(){ 1.25157 + this.container.removeClass(this.activeClass); 1.25158 + this.fireEvent("deactivate", this); 1.25159 + }, 1.25160 + 1.25161 + shouldDeactivate : function(e){ 1.25162 + return !this.region || !this.region.contains(e.getPoint()); 1.25163 + }, 1.25164 + 1.25165 + handleClick : function(e){ 1.25166 + if(this.hideOnClick){ 1.25167 + this.parentMenu.hide.defer(this.hideDelay, this.parentMenu, [true]); 1.25168 + } 1.25169 + }, 1.25170 + 1.25171 + expandMenu : function(autoActivate){ 1.25172 + }, 1.25173 + 1.25174 + hideMenu : function(){ 1.25175 + } 1.25176 +}); 1.25177 + 1.25178 +Ext.menu.TextItem = function(text){ 1.25179 + this.text = text; 1.25180 + Ext.menu.TextItem.superclass.constructor.call(this); 1.25181 +}; 1.25182 + 1.25183 +Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, { 1.25184 + 1.25185 + 1.25186 + hideOnClick : false, 1.25187 + 1.25188 + itemCls : "x-menu-text", 1.25189 + 1.25190 + onRender : function(){ 1.25191 + var s = document.createElement("span"); 1.25192 + s.className = this.itemCls; 1.25193 + s.innerHTML = this.text; 1.25194 + this.el = s; 1.25195 + Ext.menu.TextItem.superclass.onRender.apply(this, arguments); 1.25196 + } 1.25197 +}); 1.25198 + 1.25199 +Ext.menu.Separator = function(config){ 1.25200 + Ext.menu.Separator.superclass.constructor.call(this, config); 1.25201 +}; 1.25202 + 1.25203 +Ext.extend(Ext.menu.Separator, Ext.menu.BaseItem, { 1.25204 + 1.25205 + itemCls : "x-menu-sep", 1.25206 + 1.25207 + hideOnClick : false, 1.25208 + 1.25209 + onRender : function(li){ 1.25210 + var s = document.createElement("span"); 1.25211 + s.className = this.itemCls; 1.25212 + s.innerHTML = " "; 1.25213 + this.el = s; 1.25214 + li.addClass("x-menu-sep-li"); 1.25215 + Ext.menu.Separator.superclass.onRender.apply(this, arguments); 1.25216 + } 1.25217 +}); 1.25218 + 1.25219 +Ext.menu.Item = function(config){ 1.25220 + Ext.menu.Item.superclass.constructor.call(this, config); 1.25221 + if(this.menu){ 1.25222 + this.menu = Ext.menu.MenuMgr.get(this.menu); 1.25223 + } 1.25224 +}; 1.25225 +Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, { 1.25226 + 1.25227 + 1.25228 + 1.25229 + 1.25230 + 1.25231 + 1.25232 + 1.25233 + itemCls : "x-menu-item", 1.25234 + 1.25235 + canActivate : true, 1.25236 + 1.25237 + showDelay: 200, 1.25238 + hideDelay: 200, 1.25239 + 1.25240 + ctype: "Ext.menu.Item", 1.25241 + 1.25242 + onRender : function(container, position){ 1.25243 + var el = document.createElement("a"); 1.25244 + el.hideFocus = true; 1.25245 + el.unselectable = "on"; 1.25246 + el.href = this.href || "#"; 1.25247 + if(this.hrefTarget){ 1.25248 + el.target = this.hrefTarget; 1.25249 + } 1.25250 + el.className = this.itemCls + (this.menu ? " x-menu-item-arrow" : "") + (this.cls ? " " + this.cls : ""); 1.25251 + el.innerHTML = String.format( 1.25252 + '<img src="{0}" class="x-menu-item-icon {2}" />{1}', 1.25253 + this.icon || Ext.BLANK_IMAGE_URL, this.itemText||this.text, this.iconCls || ''); 1.25254 + this.el = el; 1.25255 + Ext.menu.Item.superclass.onRender.call(this, container, position); 1.25256 + }, 1.25257 + 1.25258 + 1.25259 + setText : function(text){ 1.25260 + this.text = text; 1.25261 + if(this.rendered){ 1.25262 + this.el.update(String.format( 1.25263 + '<img src="{0}" class="x-menu-item-icon {2}">{1}', 1.25264 + this.icon || Ext.BLANK_IMAGE_URL, this.text, this.iconCls || '')); 1.25265 + this.parentMenu.autoWidth(); 1.25266 + } 1.25267 + }, 1.25268 + 1.25269 + 1.25270 + setIconClass : function(cls){ 1.25271 + var oldCls = this.iconCls; 1.25272 + this.iconCls = cls; 1.25273 + if(this.rendered){ 1.25274 + this.el.child('img.x-menu-item-icon').replaceClass(oldCls, this.iconCls); 1.25275 + } 1.25276 + }, 1.25277 + 1.25278 + handleClick : function(e){ 1.25279 + if(!this.href){ e.stopEvent(); 1.25280 + } 1.25281 + Ext.menu.Item.superclass.handleClick.apply(this, arguments); 1.25282 + }, 1.25283 + 1.25284 + activate : function(autoExpand){ 1.25285 + if(Ext.menu.Item.superclass.activate.apply(this, arguments)){ 1.25286 + this.focus(); 1.25287 + if(autoExpand){ 1.25288 + this.expandMenu(); 1.25289 + } 1.25290 + } 1.25291 + return true; 1.25292 + }, 1.25293 + 1.25294 + shouldDeactivate : function(e){ 1.25295 + if(Ext.menu.Item.superclass.shouldDeactivate.call(this, e)){ 1.25296 + if(this.menu && this.menu.isVisible()){ 1.25297 + return !this.menu.getEl().getRegion().contains(e.getPoint()); 1.25298 + } 1.25299 + return true; 1.25300 + } 1.25301 + return false; 1.25302 + }, 1.25303 + 1.25304 + deactivate : function(){ 1.25305 + Ext.menu.Item.superclass.deactivate.apply(this, arguments); 1.25306 + this.hideMenu(); 1.25307 + }, 1.25308 + 1.25309 + expandMenu : function(autoActivate){ 1.25310 + if(!this.disabled && this.menu){ 1.25311 + clearTimeout(this.hideTimer); 1.25312 + delete this.hideTimer; 1.25313 + if(!this.menu.isVisible() && !this.showTimer){ 1.25314 + this.showTimer = this.deferExpand.defer(this.showDelay, this, [autoActivate]); 1.25315 + }else if (this.menu.isVisible() && autoActivate){ 1.25316 + this.menu.tryActivate(0, 1); 1.25317 + } 1.25318 + } 1.25319 + }, 1.25320 + 1.25321 + deferExpand : function(autoActivate){ 1.25322 + delete this.showTimer; 1.25323 + this.menu.show(this.container, this.parentMenu.subMenuAlign || "tl-tr?", this.parentMenu); 1.25324 + if(autoActivate){ 1.25325 + this.menu.tryActivate(0, 1); 1.25326 + } 1.25327 + }, 1.25328 + 1.25329 + hideMenu : function(){ 1.25330 + clearTimeout(this.showTimer); 1.25331 + delete this.showTimer; 1.25332 + if(!this.hideTimer && this.menu && this.menu.isVisible()){ 1.25333 + this.hideTimer = this.deferHide.defer(this.hideDelay, this); 1.25334 + } 1.25335 + }, 1.25336 + 1.25337 + deferHide : function(){ 1.25338 + delete this.hideTimer; 1.25339 + this.menu.hide(); 1.25340 + } 1.25341 +}); 1.25342 + 1.25343 +Ext.menu.CheckItem = function(config){ 1.25344 + Ext.menu.CheckItem.superclass.constructor.call(this, config); 1.25345 + this.addEvents( 1.25346 + 1.25347 + "beforecheckchange" , 1.25348 + 1.25349 + "checkchange" 1.25350 + ); 1.25351 + 1.25352 + if(this.checkHandler){ 1.25353 + this.on('checkchange', this.checkHandler, this.scope); 1.25354 + } 1.25355 + Ext.menu.MenuMgr.registerCheckable(this); 1.25356 +}; 1.25357 +Ext.extend(Ext.menu.CheckItem, Ext.menu.Item, { 1.25358 + 1.25359 + 1.25360 + itemCls : "x-menu-item x-menu-check-item", 1.25361 + 1.25362 + groupClass : "x-menu-group-item", 1.25363 + 1.25364 + 1.25365 + checked: false, 1.25366 + 1.25367 + ctype: "Ext.menu.CheckItem", 1.25368 + 1.25369 + onRender : function(c){ 1.25370 + Ext.menu.CheckItem.superclass.onRender.apply(this, arguments); 1.25371 + if(this.group){ 1.25372 + this.el.addClass(this.groupClass); 1.25373 + } 1.25374 + if(this.checked){ 1.25375 + this.checked = false; 1.25376 + this.setChecked(true, true); 1.25377 + } 1.25378 + }, 1.25379 + 1.25380 + destroy : function(){ 1.25381 + Ext.menu.MenuMgr.unregisterCheckable(this); 1.25382 + Ext.menu.CheckItem.superclass.destroy.apply(this, arguments); 1.25383 + }, 1.25384 + 1.25385 + 1.25386 + setChecked : function(state, suppressEvent){ 1.25387 + if(this.checked != state && this.fireEvent("beforecheckchange", this, state) !== false){ 1.25388 + if(this.container){ 1.25389 + this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked"); 1.25390 + } 1.25391 + this.checked = state; 1.25392 + if(suppressEvent !== true){ 1.25393 + this.fireEvent("checkchange", this, state); 1.25394 + } 1.25395 + } 1.25396 + }, 1.25397 + 1.25398 + handleClick : function(e){ 1.25399 + if(!this.disabled && !(this.checked && this.group)){ this.setChecked(!this.checked); 1.25400 + } 1.25401 + Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments); 1.25402 + } 1.25403 +}); 1.25404 + 1.25405 +Ext.menu.Adapter = function(component, config){ 1.25406 + Ext.menu.Adapter.superclass.constructor.call(this, config); 1.25407 + this.component = component; 1.25408 +}; 1.25409 +Ext.extend(Ext.menu.Adapter, Ext.menu.BaseItem, { 1.25410 + canActivate : true, 1.25411 + 1.25412 + onRender : function(container, position){ 1.25413 + this.component.render(container); 1.25414 + this.el = this.component.getEl(); 1.25415 + }, 1.25416 + 1.25417 + activate : function(){ 1.25418 + if(this.disabled){ 1.25419 + return false; 1.25420 + } 1.25421 + this.component.focus(); 1.25422 + this.fireEvent("activate", this); 1.25423 + return true; 1.25424 + }, 1.25425 + 1.25426 + deactivate : function(){ 1.25427 + this.fireEvent("deactivate", this); 1.25428 + }, 1.25429 + 1.25430 + disable : function(){ 1.25431 + this.component.disable(); 1.25432 + Ext.menu.Adapter.superclass.disable.call(this); 1.25433 + }, 1.25434 + 1.25435 + enable : function(){ 1.25436 + this.component.enable(); 1.25437 + Ext.menu.Adapter.superclass.enable.call(this); 1.25438 + } 1.25439 +}); 1.25440 + 1.25441 +Ext.menu.DateItem = function(config){ 1.25442 + Ext.menu.DateItem.superclass.constructor.call(this, new Ext.DatePicker(config), config); 1.25443 + 1.25444 + this.picker = this.component; 1.25445 + this.addEvents('select'); 1.25446 + 1.25447 + this.picker.on("render", function(picker){ 1.25448 + picker.getEl().swallowEvent("click"); 1.25449 + picker.container.addClass("x-menu-date-item"); 1.25450 + }); 1.25451 + 1.25452 + this.picker.on("select", this.onSelect, this); 1.25453 +}; 1.25454 + 1.25455 +Ext.extend(Ext.menu.DateItem, Ext.menu.Adapter, { 1.25456 + onSelect : function(picker, date){ 1.25457 + this.fireEvent("select", this, date, picker); 1.25458 + Ext.menu.DateItem.superclass.handleClick.call(this); 1.25459 + } 1.25460 +}); 1.25461 + 1.25462 +Ext.menu.ColorItem = function(config){ 1.25463 + Ext.menu.ColorItem.superclass.constructor.call(this, new Ext.ColorPalette(config), config); 1.25464 + 1.25465 + this.palette = this.component; 1.25466 + this.relayEvents(this.palette, ["select"]); 1.25467 + if(this.selectHandler){ 1.25468 + this.on('select', this.selectHandler, this.scope); 1.25469 + } 1.25470 +}; 1.25471 +Ext.extend(Ext.menu.ColorItem, Ext.menu.Adapter); 1.25472 + 1.25473 +Ext.menu.DateMenu = function(config){ 1.25474 + Ext.menu.DateMenu.superclass.constructor.call(this, config); 1.25475 + this.plain = true; 1.25476 + var di = new Ext.menu.DateItem(config); 1.25477 + this.add(di); 1.25478 + 1.25479 + this.picker = di.picker; 1.25480 + 1.25481 + this.relayEvents(di, ["select"]); 1.25482 + 1.25483 + this.on('beforeshow', function(){ 1.25484 + if(this.picker){ 1.25485 + this.picker.hideMonthPicker(true); 1.25486 + } 1.25487 + }, this); 1.25488 +}; 1.25489 +Ext.extend(Ext.menu.DateMenu, Ext.menu.Menu, { 1.25490 + cls:'x-date-menu', 1.25491 + 1.25492 + beforeDestroy : function() { 1.25493 + this.picker.destroy(); 1.25494 + } 1.25495 +}); 1.25496 + 1.25497 +Ext.menu.ColorMenu = function(config){ 1.25498 + Ext.menu.ColorMenu.superclass.constructor.call(this, config); 1.25499 + this.plain = true; 1.25500 + var ci = new Ext.menu.ColorItem(config); 1.25501 + this.add(ci); 1.25502 + 1.25503 + this.palette = ci.palette; 1.25504 + 1.25505 + this.relayEvents(ci, ["select"]); 1.25506 +}; 1.25507 +Ext.extend(Ext.menu.ColorMenu, Ext.menu.Menu); 1.25508 + 1.25509 +Ext.form.Field = Ext.extend(Ext.BoxComponent, { 1.25510 + 1.25511 + 1.25512 + 1.25513 + 1.25514 + 1.25515 + 1.25516 + 1.25517 + 1.25518 + 1.25519 + 1.25520 + 1.25521 + 1.25522 + 1.25523 + invalidClass : "x-form-invalid", 1.25524 + 1.25525 + invalidText : "The value in this field is invalid", 1.25526 + 1.25527 + focusClass : "x-form-focus", 1.25528 + 1.25529 + validationEvent : "keyup", 1.25530 + 1.25531 + validateOnBlur : true, 1.25532 + 1.25533 + validationDelay : 250, 1.25534 + 1.25535 + defaultAutoCreate : {tag: "input", type: "text", size: "20", autocomplete: "off"}, 1.25536 + 1.25537 + fieldClass : "x-form-field", 1.25538 + 1.25539 + msgTarget : 'qtip', 1.25540 + 1.25541 + msgFx : 'normal', 1.25542 + 1.25543 + readOnly : false, 1.25544 + 1.25545 + disabled : false, 1.25546 + 1.25547 + isFormField : true, 1.25548 + 1.25549 + hasFocus : false, 1.25550 + 1.25551 + initComponent : function(){ 1.25552 + Ext.form.Field.superclass.initComponent.call(this); 1.25553 + this.addEvents( 1.25554 + 1.25555 + 'focus', 1.25556 + 1.25557 + 'blur', 1.25558 + 1.25559 + 'specialkey', 1.25560 + 1.25561 + 'change', 1.25562 + 1.25563 + 'invalid', 1.25564 + 1.25565 + 'valid' 1.25566 + ); 1.25567 + }, 1.25568 + 1.25569 + 1.25570 + getName: function(){ 1.25571 + return this.rendered && this.el.dom.name ? this.el.dom.name : (this.hiddenName || ''); 1.25572 + }, 1.25573 + 1.25574 + onRender : function(ct, position){ 1.25575 + Ext.form.Field.superclass.onRender.call(this, ct, position); 1.25576 + if(!this.el){ 1.25577 + var cfg = this.getAutoCreate(); 1.25578 + if(!cfg.name){ 1.25579 + cfg.name = this.name || this.id; 1.25580 + } 1.25581 + if(this.inputType){ 1.25582 + cfg.type = this.inputType; 1.25583 + } 1.25584 + this.el = ct.createChild(cfg, position); 1.25585 + } 1.25586 + var type = this.el.dom.type; 1.25587 + if(type){ 1.25588 + if(type == 'password'){ 1.25589 + type = 'text'; 1.25590 + } 1.25591 + this.el.addClass('x-form-'+type); 1.25592 + } 1.25593 + if(this.readOnly){ 1.25594 + this.el.dom.readOnly = true; 1.25595 + } 1.25596 + if(this.tabIndex !== undefined){ 1.25597 + this.el.dom.setAttribute('tabIndex', this.tabIndex); 1.25598 + } 1.25599 + 1.25600 + this.el.addClass([this.fieldClass, this.cls]); 1.25601 + this.initValue(); 1.25602 + }, 1.25603 + 1.25604 + initValue : function(){ 1.25605 + if(this.value !== undefined){ 1.25606 + this.setValue(this.value); 1.25607 + }else if(this.el.dom.value.length > 0){ 1.25608 + this.setValue(this.el.dom.value); 1.25609 + } 1.25610 + }, 1.25611 + 1.25612 + 1.25613 + isDirty : function() { 1.25614 + if(this.disabled) { 1.25615 + return false; 1.25616 + } 1.25617 + return String(this.getValue()) !== String(this.originalValue); 1.25618 + }, 1.25619 + 1.25620 + afterRender : function(){ 1.25621 + Ext.form.Field.superclass.afterRender.call(this); 1.25622 + this.initEvents(); 1.25623 + }, 1.25624 + 1.25625 + fireKey : function(e){ 1.25626 + if(e.isSpecialKey()){ 1.25627 + this.fireEvent("specialkey", this, e); 1.25628 + } 1.25629 + }, 1.25630 + 1.25631 + 1.25632 + reset : function(){ 1.25633 + this.setValue(this.originalValue); 1.25634 + this.clearInvalid(); 1.25635 + }, 1.25636 + 1.25637 + initEvents : function(){ 1.25638 + this.el.on(Ext.isIE || Ext.isSafari3 ? "keydown" : "keypress", this.fireKey, this); 1.25639 + this.el.on("focus", this.onFocus, this); 1.25640 + this.el.on("blur", this.onBlur, this); 1.25641 + 1.25642 + this.originalValue = this.getValue(); 1.25643 + }, 1.25644 + 1.25645 + onFocus : function(){ 1.25646 + if(!Ext.isOpera && this.focusClass){ this.el.addClass(this.focusClass); 1.25647 + } 1.25648 + if(!this.hasFocus){ 1.25649 + this.hasFocus = true; 1.25650 + this.startValue = this.getValue(); 1.25651 + this.fireEvent("focus", this); 1.25652 + } 1.25653 + }, 1.25654 + 1.25655 + beforeBlur : Ext.emptyFn, 1.25656 + 1.25657 + onBlur : function(){ 1.25658 + this.beforeBlur(); 1.25659 + if(!Ext.isOpera && this.focusClass){ this.el.removeClass(this.focusClass); 1.25660 + } 1.25661 + this.hasFocus = false; 1.25662 + if(this.validationEvent !== false && this.validateOnBlur && this.validationEvent != "blur"){ 1.25663 + this.validate(); 1.25664 + } 1.25665 + var v = this.getValue(); 1.25666 + if(String(v) !== String(this.startValue)){ 1.25667 + this.fireEvent('change', this, v, this.startValue); 1.25668 + } 1.25669 + this.fireEvent("blur", this); 1.25670 + }, 1.25671 + 1.25672 + 1.25673 + isValid : function(preventMark){ 1.25674 + if(this.disabled){ 1.25675 + return true; 1.25676 + } 1.25677 + var restore = this.preventMark; 1.25678 + this.preventMark = preventMark === true; 1.25679 + var v = this.validateValue(this.processValue(this.getRawValue())); 1.25680 + this.preventMark = restore; 1.25681 + return v; 1.25682 + }, 1.25683 + 1.25684 + 1.25685 + validate : function(){ 1.25686 + if(this.disabled || this.validateValue(this.processValue(this.getRawValue()))){ 1.25687 + this.clearInvalid(); 1.25688 + return true; 1.25689 + } 1.25690 + return false; 1.25691 + }, 1.25692 + 1.25693 + processValue : function(value){ 1.25694 + return value; 1.25695 + }, 1.25696 + 1.25697 + validateValue : function(value){ 1.25698 + return true; 1.25699 + }, 1.25700 + 1.25701 + 1.25702 + markInvalid : function(msg){ 1.25703 + if(!this.rendered || this.preventMark){ return; 1.25704 + } 1.25705 + this.el.addClass(this.invalidClass); 1.25706 + msg = msg || this.invalidText; 1.25707 + switch(this.msgTarget){ 1.25708 + case 'qtip': 1.25709 + this.el.dom.qtip = msg; 1.25710 + this.el.dom.qclass = 'x-form-invalid-tip'; 1.25711 + if(Ext.QuickTips){ Ext.QuickTips.enable(); 1.25712 + } 1.25713 + break; 1.25714 + case 'title': 1.25715 + this.el.dom.title = msg; 1.25716 + break; 1.25717 + case 'under': 1.25718 + if(!this.errorEl){ 1.25719 + var elp = this.getErrorCt(); 1.25720 + this.errorEl = elp.createChild({cls:'x-form-invalid-msg'}); 1.25721 + this.errorEl.setWidth(elp.getWidth(true)-20); 1.25722 + } 1.25723 + this.errorEl.update(msg); 1.25724 + Ext.form.Field.msgFx[this.msgFx].show(this.errorEl, this); 1.25725 + break; 1.25726 + case 'side': 1.25727 + if(!this.errorIcon){ 1.25728 + var elp = this.getErrorCt(); 1.25729 + this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'}); 1.25730 + } 1.25731 + this.alignErrorIcon(); 1.25732 + this.errorIcon.dom.qtip = msg; 1.25733 + this.errorIcon.dom.qclass = 'x-form-invalid-tip'; 1.25734 + this.errorIcon.show(); 1.25735 + this.on('resize', this.alignErrorIcon, this); 1.25736 + break; 1.25737 + default: 1.25738 + var t = Ext.getDom(this.msgTarget); 1.25739 + t.innerHTML = msg; 1.25740 + t.style.display = this.msgDisplay; 1.25741 + break; 1.25742 + } 1.25743 + this.fireEvent('invalid', this, msg); 1.25744 + }, 1.25745 + 1.25746 + getErrorCt : function(){ 1.25747 + return this.el.findParent('.x-form-element', 5, true) || this.el.findParent('.x-form-field-wrap', 5, true); }, 1.25748 + 1.25749 + alignErrorIcon : function(){ 1.25750 + this.errorIcon.alignTo(this.el, 'tl-tr', [2, 0]); 1.25751 + }, 1.25752 + 1.25753 + 1.25754 + clearInvalid : function(){ 1.25755 + if(!this.rendered || this.preventMark){ return; 1.25756 + } 1.25757 + this.el.removeClass(this.invalidClass); 1.25758 + switch(this.msgTarget){ 1.25759 + case 'qtip': 1.25760 + this.el.dom.qtip = ''; 1.25761 + break; 1.25762 + case 'title': 1.25763 + this.el.dom.title = ''; 1.25764 + break; 1.25765 + case 'under': 1.25766 + if(this.errorEl){ 1.25767 + Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl, this); 1.25768 + } 1.25769 + break; 1.25770 + case 'side': 1.25771 + if(this.errorIcon){ 1.25772 + this.errorIcon.dom.qtip = ''; 1.25773 + this.errorIcon.hide(); 1.25774 + this.un('resize', this.alignErrorIcon, this); 1.25775 + } 1.25776 + break; 1.25777 + default: 1.25778 + var t = Ext.getDom(this.msgTarget); 1.25779 + t.innerHTML = ''; 1.25780 + t.style.display = 'none'; 1.25781 + break; 1.25782 + } 1.25783 + this.fireEvent('valid', this); 1.25784 + }, 1.25785 + 1.25786 + 1.25787 + getRawValue : function(){ 1.25788 + var v = this.rendered ? this.el.getValue() : Ext.value(this.value, ''); 1.25789 + if(v === this.emptyText){ 1.25790 + v = ''; 1.25791 + } 1.25792 + return v; 1.25793 + }, 1.25794 + 1.25795 + 1.25796 + getValue : function(){ 1.25797 + if(!this.rendered) { 1.25798 + return this.value; 1.25799 + } 1.25800 + var v = this.el.getValue(); 1.25801 + if(v === this.emptyText || v === undefined){ 1.25802 + v = ''; 1.25803 + } 1.25804 + return v; 1.25805 + }, 1.25806 + 1.25807 + 1.25808 + setRawValue : function(v){ 1.25809 + return this.el.dom.value = (v === null || v === undefined ? '' : v); 1.25810 + }, 1.25811 + 1.25812 + 1.25813 + setValue : function(v){ 1.25814 + this.value = v; 1.25815 + if(this.rendered){ 1.25816 + this.el.dom.value = (v === null || v === undefined ? '' : v); 1.25817 + this.validate(); 1.25818 + } 1.25819 + }, 1.25820 + 1.25821 + adjustSize : function(w, h){ 1.25822 + var s = Ext.form.Field.superclass.adjustSize.call(this, w, h); 1.25823 + s.width = this.adjustWidth(this.el.dom.tagName, s.width); 1.25824 + return s; 1.25825 + }, 1.25826 + 1.25827 + adjustWidth : function(tag, w){ 1.25828 + tag = tag.toLowerCase(); 1.25829 + if(typeof w == 'number' && !Ext.isSafari){ 1.25830 + if(Ext.isIE && (tag == 'input' || tag == 'textarea')){ 1.25831 + if(tag == 'input' && !Ext.isStrict){ 1.25832 + return this.inEditor ? w : w - 3; 1.25833 + } 1.25834 + if(tag == 'input' && Ext.isStrict){ 1.25835 + return w - (Ext.isIE6 ? 4 : 1); 1.25836 + } 1.25837 + if(tag == 'textarea' && Ext.isStrict){ 1.25838 + return w-2; 1.25839 + } 1.25840 + }else if(Ext.isOpera && Ext.isStrict){ 1.25841 + if(tag == 'input'){ 1.25842 + return w + 2; 1.25843 + } 1.25844 + if(tag == 'textarea'){ 1.25845 + return w-2; 1.25846 + } 1.25847 + } 1.25848 + } 1.25849 + return w; 1.25850 + } 1.25851 + 1.25852 + 1.25853 + 1.25854 + 1.25855 + 1.25856 +}); 1.25857 + 1.25858 + 1.25859 +Ext.form.Field.msgFx = { 1.25860 + normal : { 1.25861 + show: function(msgEl, f){ 1.25862 + msgEl.setDisplayed('block'); 1.25863 + }, 1.25864 + 1.25865 + hide : function(msgEl, f){ 1.25866 + msgEl.setDisplayed(false).update(''); 1.25867 + } 1.25868 + }, 1.25869 + 1.25870 + slide : { 1.25871 + show: function(msgEl, f){ 1.25872 + msgEl.slideIn('t', {stopFx:true}); 1.25873 + }, 1.25874 + 1.25875 + hide : function(msgEl, f){ 1.25876 + msgEl.slideOut('t', {stopFx:true,useDisplay:true}); 1.25877 + } 1.25878 + }, 1.25879 + 1.25880 + slideRight : { 1.25881 + show: function(msgEl, f){ 1.25882 + msgEl.fixDisplay(); 1.25883 + msgEl.alignTo(f.el, 'tl-tr'); 1.25884 + msgEl.slideIn('l', {stopFx:true}); 1.25885 + }, 1.25886 + 1.25887 + hide : function(msgEl, f){ 1.25888 + msgEl.slideOut('l', {stopFx:true,useDisplay:true}); 1.25889 + } 1.25890 + } 1.25891 +}; 1.25892 +Ext.reg('field', Ext.form.Field); 1.25893 + 1.25894 + 1.25895 +Ext.form.TextField = Ext.extend(Ext.form.Field, { 1.25896 + 1.25897 + 1.25898 + grow : false, 1.25899 + 1.25900 + growMin : 30, 1.25901 + 1.25902 + growMax : 800, 1.25903 + 1.25904 + vtype : null, 1.25905 + 1.25906 + maskRe : null, 1.25907 + 1.25908 + disableKeyFilter : false, 1.25909 + 1.25910 + allowBlank : true, 1.25911 + 1.25912 + minLength : 0, 1.25913 + 1.25914 + maxLength : Number.MAX_VALUE, 1.25915 + 1.25916 + minLengthText : "The minimum length for this field is {0}", 1.25917 + 1.25918 + maxLengthText : "The maximum length for this field is {0}", 1.25919 + 1.25920 + selectOnFocus : false, 1.25921 + 1.25922 + blankText : "This field is required", 1.25923 + 1.25924 + validator : null, 1.25925 + 1.25926 + regex : null, 1.25927 + 1.25928 + regexText : "", 1.25929 + 1.25930 + emptyText : null, 1.25931 + 1.25932 + emptyClass : 'x-form-empty-field', 1.25933 + 1.25934 + 1.25935 + 1.25936 + initComponent : function(){ 1.25937 + Ext.form.TextField.superclass.initComponent.call(this); 1.25938 + this.addEvents( 1.25939 + 1.25940 + 'autosize', 1.25941 + 1.25942 + 1.25943 + 'keydown', 1.25944 + 1.25945 + 'keyup', 1.25946 + 1.25947 + 'keypress' 1.25948 + ); 1.25949 + }, 1.25950 + 1.25951 + initEvents : function(){ 1.25952 + Ext.form.TextField.superclass.initEvents.call(this); 1.25953 + if(this.validationEvent == 'keyup'){ 1.25954 + this.validationTask = new Ext.util.DelayedTask(this.validate, this); 1.25955 + this.el.on('keyup', this.filterValidation, this); 1.25956 + } 1.25957 + else if(this.validationEvent !== false){ 1.25958 + this.el.on(this.validationEvent, this.validate, this, {buffer: this.validationDelay}); 1.25959 + } 1.25960 + if(this.selectOnFocus || this.emptyText){ 1.25961 + this.on("focus", this.preFocus, this); 1.25962 + if(this.emptyText){ 1.25963 + this.on('blur', this.postBlur, this); 1.25964 + this.applyEmptyText(); 1.25965 + } 1.25966 + } 1.25967 + if(this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Ext.form.VTypes[this.vtype+'Mask']))){ 1.25968 + this.el.on("keypress", this.filterKeys, this); 1.25969 + } 1.25970 + if(this.grow){ 1.25971 + this.el.on("keyup", this.onKeyUpBuffered, this, {buffer:50}); 1.25972 + this.el.on("click", this.autoSize, this); 1.25973 + } 1.25974 + 1.25975 + if(this.enableKeyEvents){ 1.25976 + this.el.on("keyup", this.onKeyUp, this); 1.25977 + this.el.on("keydown", this.onKeyDown, this); 1.25978 + this.el.on("keypress", this.onKeyPress, this); 1.25979 + } 1.25980 + }, 1.25981 + 1.25982 + processValue : function(value){ 1.25983 + if(this.stripCharsRe){ 1.25984 + var newValue = value.replace(this.stripCharsRe, ''); 1.25985 + if(newValue !== value){ 1.25986 + this.setRawValue(newValue); 1.25987 + return newValue; 1.25988 + } 1.25989 + } 1.25990 + return value; 1.25991 + }, 1.25992 + 1.25993 + filterValidation : function(e){ 1.25994 + if(!e.isNavKeyPress()){ 1.25995 + this.validationTask.delay(this.validationDelay); 1.25996 + } 1.25997 + }, 1.25998 + 1.25999 + onKeyUpBuffered : function(e){ 1.26000 + if(!e.isNavKeyPress()){ 1.26001 + this.autoSize(); 1.26002 + } 1.26003 + }, 1.26004 + 1.26005 + onKeyUp : function(e){ 1.26006 + this.fireEvent('keyup', this, e); 1.26007 + }, 1.26008 + 1.26009 + onKeyDown : function(e){ 1.26010 + this.fireEvent('keydown', this, e); 1.26011 + }, 1.26012 + 1.26013 + onKeyPress : function(e){ 1.26014 + this.fireEvent('keypress', this, e); 1.26015 + }, 1.26016 + 1.26017 + 1.26018 + reset : function(){ 1.26019 + Ext.form.TextField.superclass.reset.call(this); 1.26020 + this.applyEmptyText(); 1.26021 + }, 1.26022 + 1.26023 + applyEmptyText : function(){ 1.26024 + if(this.rendered && this.emptyText && this.getRawValue().length < 1){ 1.26025 + this.setRawValue(this.emptyText); 1.26026 + this.el.addClass(this.emptyClass); 1.26027 + } 1.26028 + }, 1.26029 + 1.26030 + preFocus : function(){ 1.26031 + if(this.emptyText){ 1.26032 + if(this.el.dom.value == this.emptyText){ 1.26033 + this.setRawValue(''); 1.26034 + } 1.26035 + this.el.removeClass(this.emptyClass); 1.26036 + } 1.26037 + if(this.selectOnFocus){ 1.26038 + this.el.dom.select(); 1.26039 + } 1.26040 + }, 1.26041 + 1.26042 + postBlur : function(){ 1.26043 + this.applyEmptyText(); 1.26044 + }, 1.26045 + 1.26046 + filterKeys : function(e){ 1.26047 + var k = e.getKey(); 1.26048 + if(!Ext.isIE && (e.isNavKeyPress() || k == e.BACKSPACE || (k == e.DELETE && e.button == -1))){ 1.26049 + return; 1.26050 + } 1.26051 + var c = e.getCharCode(), cc = String.fromCharCode(c); 1.26052 + if(Ext.isIE && (e.isSpecialKey() || !cc)){ 1.26053 + return; 1.26054 + } 1.26055 + if(!this.maskRe.test(cc)){ 1.26056 + e.stopEvent(); 1.26057 + } 1.26058 + }, 1.26059 + 1.26060 + setValue : function(v){ 1.26061 + if(this.emptyText && this.el && v !== undefined && v !== null && v !== ''){ 1.26062 + this.el.removeClass(this.emptyClass); 1.26063 + } 1.26064 + Ext.form.TextField.superclass.setValue.apply(this, arguments); 1.26065 + this.applyEmptyText(); 1.26066 + this.autoSize(); 1.26067 + }, 1.26068 + 1.26069 + 1.26070 + validateValue : function(value){ 1.26071 + if(value.length < 1 || value === this.emptyText){ if(this.allowBlank){ 1.26072 + this.clearInvalid(); 1.26073 + return true; 1.26074 + }else{ 1.26075 + this.markInvalid(this.blankText); 1.26076 + return false; 1.26077 + } 1.26078 + } 1.26079 + if(value.length < this.minLength){ 1.26080 + this.markInvalid(String.format(this.minLengthText, this.minLength)); 1.26081 + return false; 1.26082 + } 1.26083 + if(value.length > this.maxLength){ 1.26084 + this.markInvalid(String.format(this.maxLengthText, this.maxLength)); 1.26085 + return false; 1.26086 + } 1.26087 + if(this.vtype){ 1.26088 + var vt = Ext.form.VTypes; 1.26089 + if(!vt[this.vtype](value, this)){ 1.26090 + this.markInvalid(this.vtypeText || vt[this.vtype +'Text']); 1.26091 + return false; 1.26092 + } 1.26093 + } 1.26094 + if(typeof this.validator == "function"){ 1.26095 + var msg = this.validator(value); 1.26096 + if(msg !== true){ 1.26097 + this.markInvalid(msg); 1.26098 + return false; 1.26099 + } 1.26100 + } 1.26101 + if(this.regex && !this.regex.test(value)){ 1.26102 + this.markInvalid(this.regexText); 1.26103 + return false; 1.26104 + } 1.26105 + return true; 1.26106 + }, 1.26107 + 1.26108 + 1.26109 + selectText : function(start, end){ 1.26110 + var v = this.getRawValue(); 1.26111 + if(v.length > 0){ 1.26112 + start = start === undefined ? 0 : start; 1.26113 + end = end === undefined ? v.length : end; 1.26114 + var d = this.el.dom; 1.26115 + if(d.setSelectionRange){ 1.26116 + d.setSelectionRange(start, end); 1.26117 + }else if(d.createTextRange){ 1.26118 + var range = d.createTextRange(); 1.26119 + range.moveStart("character", start); 1.26120 + range.moveEnd("character", end-v.length); 1.26121 + range.select(); 1.26122 + } 1.26123 + } 1.26124 + }, 1.26125 + 1.26126 + 1.26127 + autoSize : function(){ 1.26128 + if(!this.grow || !this.rendered){ 1.26129 + return; 1.26130 + } 1.26131 + if(!this.metrics){ 1.26132 + this.metrics = Ext.util.TextMetrics.createInstance(this.el); 1.26133 + } 1.26134 + var el = this.el; 1.26135 + var v = el.dom.value; 1.26136 + var d = document.createElement('div'); 1.26137 + d.appendChild(document.createTextNode(v)); 1.26138 + v = d.innerHTML; 1.26139 + d = null; 1.26140 + v += " "; 1.26141 + var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + 10, this.growMin)); 1.26142 + this.el.setWidth(w); 1.26143 + this.fireEvent("autosize", this, w); 1.26144 + } 1.26145 +}); 1.26146 +Ext.reg('textfield', Ext.form.TextField); 1.26147 + 1.26148 + 1.26149 +Ext.form.TriggerField = Ext.extend(Ext.form.TextField, { 1.26150 + 1.26151 + 1.26152 + defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"}, 1.26153 + 1.26154 + hideTrigger:false, 1.26155 + 1.26156 + 1.26157 + autoSize: Ext.emptyFn, 1.26158 + monitorTab : true, 1.26159 + deferHeight : true, 1.26160 + mimicing : false, 1.26161 + 1.26162 + onResize : function(w, h){ 1.26163 + Ext.form.TriggerField.superclass.onResize.call(this, w, h); 1.26164 + if(typeof w == 'number'){ 1.26165 + this.el.setWidth(this.adjustWidth('input', w - this.trigger.getWidth())); 1.26166 + } 1.26167 + this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth()); 1.26168 + }, 1.26169 + 1.26170 + adjustSize : Ext.BoxComponent.prototype.adjustSize, 1.26171 + 1.26172 + getResizeEl : function(){ 1.26173 + return this.wrap; 1.26174 + }, 1.26175 + 1.26176 + getPositionEl : function(){ 1.26177 + return this.wrap; 1.26178 + }, 1.26179 + 1.26180 + alignErrorIcon : function(){ 1.26181 + this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); 1.26182 + }, 1.26183 + 1.26184 + onRender : function(ct, position){ 1.26185 + Ext.form.TriggerField.superclass.onRender.call(this, ct, position); 1.26186 + this.wrap = this.el.wrap({cls: "x-form-field-wrap"}); 1.26187 + this.trigger = this.wrap.createChild(this.triggerConfig || 1.26188 + {tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass}); 1.26189 + if(this.hideTrigger){ 1.26190 + this.trigger.setDisplayed(false); 1.26191 + } 1.26192 + this.initTrigger(); 1.26193 + if(!this.width){ 1.26194 + this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth()); 1.26195 + } 1.26196 + }, 1.26197 + 1.26198 + initTrigger : function(){ 1.26199 + this.trigger.on("click", this.onTriggerClick, this, {preventDefault:true}); 1.26200 + this.trigger.addClassOnOver('x-form-trigger-over'); 1.26201 + this.trigger.addClassOnClick('x-form-trigger-click'); 1.26202 + }, 1.26203 + 1.26204 + onDestroy : function(){ 1.26205 + if(this.trigger){ 1.26206 + this.trigger.removeAllListeners(); 1.26207 + this.trigger.remove(); 1.26208 + } 1.26209 + if(this.wrap){ 1.26210 + this.wrap.remove(); 1.26211 + } 1.26212 + Ext.form.TriggerField.superclass.onDestroy.call(this); 1.26213 + }, 1.26214 + 1.26215 + onFocus : function(){ 1.26216 + Ext.form.TriggerField.superclass.onFocus.call(this); 1.26217 + if(!this.mimicing){ 1.26218 + this.wrap.addClass('x-trigger-wrap-focus'); 1.26219 + this.mimicing = true; 1.26220 + Ext.get(Ext.isIE ? document.body : document).on("mousedown", this.mimicBlur, this, {delay: 10}); 1.26221 + if(this.monitorTab){ 1.26222 + this.el.on("keydown", this.checkTab, this); 1.26223 + } 1.26224 + } 1.26225 + }, 1.26226 + 1.26227 + checkTab : function(e){ 1.26228 + if(e.getKey() == e.TAB){ 1.26229 + this.triggerBlur(); 1.26230 + } 1.26231 + }, 1.26232 + 1.26233 + onBlur : function(){ 1.26234 + }, 1.26235 + 1.26236 + mimicBlur : function(e){ 1.26237 + if(!this.wrap.contains(e.target) && this.validateBlur(e)){ 1.26238 + this.triggerBlur(); 1.26239 + } 1.26240 + }, 1.26241 + 1.26242 + triggerBlur : function(){ 1.26243 + this.mimicing = false; 1.26244 + Ext.get(Ext.isIE ? document.body : document).un("mousedown", this.mimicBlur); 1.26245 + if(this.monitorTab){ 1.26246 + this.el.un("keydown", this.checkTab, this); 1.26247 + } 1.26248 + this.beforeBlur(); 1.26249 + this.wrap.removeClass('x-trigger-wrap-focus'); 1.26250 + Ext.form.TriggerField.superclass.onBlur.call(this); 1.26251 + }, 1.26252 + 1.26253 + beforeBlur : Ext.emptyFn, 1.26254 + 1.26255 + validateBlur : function(e){ 1.26256 + return true; 1.26257 + }, 1.26258 + 1.26259 + onDisable : function(){ 1.26260 + Ext.form.TriggerField.superclass.onDisable.call(this); 1.26261 + if(this.wrap){ 1.26262 + this.wrap.addClass('x-item-disabled'); 1.26263 + } 1.26264 + }, 1.26265 + 1.26266 + onEnable : function(){ 1.26267 + Ext.form.TriggerField.superclass.onEnable.call(this); 1.26268 + if(this.wrap){ 1.26269 + this.wrap.removeClass('x-item-disabled'); 1.26270 + } 1.26271 + }, 1.26272 + 1.26273 + 1.26274 + onShow : function(){ 1.26275 + if(this.wrap){ 1.26276 + this.wrap.dom.style.display = ''; 1.26277 + this.wrap.dom.style.visibility = 'visible'; 1.26278 + } 1.26279 + }, 1.26280 + 1.26281 + onHide : function(){ 1.26282 + this.wrap.dom.style.display = 'none'; 1.26283 + }, 1.26284 + 1.26285 + 1.26286 + onTriggerClick : Ext.emptyFn 1.26287 + 1.26288 + 1.26289 + 1.26290 + 1.26291 +}); 1.26292 + 1.26293 +Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, { 1.26294 + initComponent : function(){ 1.26295 + Ext.form.TwinTriggerField.superclass.initComponent.call(this); 1.26296 + 1.26297 + this.triggerConfig = { 1.26298 + tag:'span', cls:'x-form-twin-triggers', cn:[ 1.26299 + {tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.trigger1Class}, 1.26300 + {tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.trigger2Class} 1.26301 + ]}; 1.26302 + }, 1.26303 + 1.26304 + getTrigger : function(index){ 1.26305 + return this.triggers[index]; 1.26306 + }, 1.26307 + 1.26308 + initTrigger : function(){ 1.26309 + var ts = this.trigger.select('.x-form-trigger', true); 1.26310 + this.wrap.setStyle('overflow', 'hidden'); 1.26311 + var triggerField = this; 1.26312 + ts.each(function(t, all, index){ 1.26313 + t.hide = function(){ 1.26314 + var w = triggerField.wrap.getWidth(); 1.26315 + this.dom.style.display = 'none'; 1.26316 + triggerField.el.setWidth(w-triggerField.trigger.getWidth()); 1.26317 + }; 1.26318 + t.show = function(){ 1.26319 + var w = triggerField.wrap.getWidth(); 1.26320 + this.dom.style.display = ''; 1.26321 + triggerField.el.setWidth(w-triggerField.trigger.getWidth()); 1.26322 + }; 1.26323 + var triggerIndex = 'Trigger'+(index+1); 1.26324 + 1.26325 + if(this['hide'+triggerIndex]){ 1.26326 + t.dom.style.display = 'none'; 1.26327 + } 1.26328 + t.on("click", this['on'+triggerIndex+'Click'], this, {preventDefault:true}); 1.26329 + t.addClassOnOver('x-form-trigger-over'); 1.26330 + t.addClassOnClick('x-form-trigger-click'); 1.26331 + }, this); 1.26332 + this.triggers = ts.elements; 1.26333 + }, 1.26334 + 1.26335 + onTrigger1Click : Ext.emptyFn, 1.26336 + onTrigger2Click : Ext.emptyFn 1.26337 +}); 1.26338 +Ext.reg('trigger', Ext.form.TriggerField); 1.26339 + 1.26340 +Ext.form.TextArea = Ext.extend(Ext.form.TextField, { 1.26341 + 1.26342 + growMin : 60, 1.26343 + 1.26344 + growMax: 1000, 1.26345 + growAppend : ' \n ', 1.26346 + growPad : 0, 1.26347 + 1.26348 + enterIsSpecial : false, 1.26349 + 1.26350 + 1.26351 + preventScrollbars: false, 1.26352 + 1.26353 + 1.26354 + onRender : function(ct, position){ 1.26355 + if(!this.el){ 1.26356 + this.defaultAutoCreate = { 1.26357 + tag: "textarea", 1.26358 + style:"width:100px;height:60px;", 1.26359 + autocomplete: "off" 1.26360 + }; 1.26361 + } 1.26362 + Ext.form.TextArea.superclass.onRender.call(this, ct, position); 1.26363 + if(this.grow){ 1.26364 + this.textSizeEl = Ext.DomHelper.append(document.body, { 1.26365 + tag: "pre", cls: "x-form-grow-sizer" 1.26366 + }); 1.26367 + if(this.preventScrollbars){ 1.26368 + this.el.setStyle("overflow", "hidden"); 1.26369 + } 1.26370 + this.el.setHeight(this.growMin); 1.26371 + } 1.26372 + }, 1.26373 + 1.26374 + onDestroy : function(){ 1.26375 + if(this.textSizeEl){ 1.26376 + Ext.removeNode(this.textSizeEl); 1.26377 + } 1.26378 + Ext.form.TextArea.superclass.onDestroy.call(this); 1.26379 + }, 1.26380 + 1.26381 + fireKey : function(e){ 1.26382 + if(e.isSpecialKey() && (this.enterIsSpecial || (e.getKey() != e.ENTER || e.hasModifier()))){ 1.26383 + this.fireEvent("specialkey", this, e); 1.26384 + } 1.26385 + }, 1.26386 + 1.26387 + onKeyUp : function(e){ 1.26388 + if(!e.isNavKeyPress() || e.getKey() == e.ENTER){ 1.26389 + this.autoSize(); 1.26390 + } 1.26391 + }, 1.26392 + 1.26393 + 1.26394 + autoSize : function(){ 1.26395 + if(!this.grow || !this.textSizeEl){ 1.26396 + return; 1.26397 + } 1.26398 + var el = this.el; 1.26399 + var v = el.dom.value; 1.26400 + var ts = this.textSizeEl; 1.26401 + ts.innerHTML = ''; 1.26402 + ts.appendChild(document.createTextNode(v)); 1.26403 + v = ts.innerHTML; 1.26404 + 1.26405 + Ext.fly(ts).setWidth(this.el.getWidth()); 1.26406 + if(v.length < 1){ 1.26407 + v = "  "; 1.26408 + }else{ 1.26409 + if(Ext.isIE){ 1.26410 + v = v.replace(/\n/g, '<p> </p>'); 1.26411 + } 1.26412 + v += this.growAppend; 1.26413 + } 1.26414 + ts.innerHTML = v; 1.26415 + var h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin)+this.growPad); 1.26416 + if(h != this.lastHeight){ 1.26417 + this.lastHeight = h; 1.26418 + this.el.setHeight(h); 1.26419 + this.fireEvent("autosize", this, h); 1.26420 + } 1.26421 + } 1.26422 +}); 1.26423 +Ext.reg('textarea', Ext.form.TextArea); 1.26424 + 1.26425 +Ext.form.NumberField = Ext.extend(Ext.form.TextField, { 1.26426 + 1.26427 + fieldClass: "x-form-field x-form-num-field", 1.26428 + 1.26429 + allowDecimals : true, 1.26430 + 1.26431 + decimalSeparator : ".", 1.26432 + 1.26433 + decimalPrecision : 2, 1.26434 + 1.26435 + allowNegative : true, 1.26436 + 1.26437 + minValue : Number.NEGATIVE_INFINITY, 1.26438 + 1.26439 + maxValue : Number.MAX_VALUE, 1.26440 + 1.26441 + minText : "The minimum value for this field is {0}", 1.26442 + 1.26443 + maxText : "The maximum value for this field is {0}", 1.26444 + 1.26445 + nanText : "{0} is not a valid number", 1.26446 + 1.26447 + baseChars : "0123456789", 1.26448 + 1.26449 + initEvents : function(){ 1.26450 + Ext.form.NumberField.superclass.initEvents.call(this); 1.26451 + var allowed = this.baseChars+''; 1.26452 + if(this.allowDecimals){ 1.26453 + allowed += this.decimalSeparator; 1.26454 + } 1.26455 + if(this.allowNegative){ 1.26456 + allowed += "-"; 1.26457 + } 1.26458 + this.stripCharsRe = new RegExp('[^'+allowed+']', 'gi'); 1.26459 + var keyPress = function(e){ 1.26460 + var k = e.getKey(); 1.26461 + if(!Ext.isIE && (e.isSpecialKey() || k == e.BACKSPACE || k == e.DELETE)){ 1.26462 + return; 1.26463 + } 1.26464 + var c = e.getCharCode(); 1.26465 + if(allowed.indexOf(String.fromCharCode(c)) === -1){ 1.26466 + e.stopEvent(); 1.26467 + } 1.26468 + }; 1.26469 + this.el.on("keypress", keyPress, this); 1.26470 + }, 1.26471 + 1.26472 + validateValue : function(value){ 1.26473 + if(!Ext.form.NumberField.superclass.validateValue.call(this, value)){ 1.26474 + return false; 1.26475 + } 1.26476 + if(value.length < 1){ return true; 1.26477 + } 1.26478 + value = String(value).replace(this.decimalSeparator, "."); 1.26479 + if(isNaN(value)){ 1.26480 + this.markInvalid(String.format(this.nanText, value)); 1.26481 + return false; 1.26482 + } 1.26483 + var num = this.parseValue(value); 1.26484 + if(num < this.minValue){ 1.26485 + this.markInvalid(String.format(this.minText, this.minValue)); 1.26486 + return false; 1.26487 + } 1.26488 + if(num > this.maxValue){ 1.26489 + this.markInvalid(String.format(this.maxText, this.maxValue)); 1.26490 + return false; 1.26491 + } 1.26492 + return true; 1.26493 + }, 1.26494 + 1.26495 + getValue : function(){ 1.26496 + return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this))); 1.26497 + }, 1.26498 + 1.26499 + setValue : function(v){ 1.26500 + v = typeof v == 'number' ? v : parseFloat(String(v).replace(this.decimalSeparator, ".")); 1.26501 + v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator); 1.26502 + Ext.form.NumberField.superclass.setValue.call(this, v); 1.26503 + }, 1.26504 + 1.26505 + parseValue : function(value){ 1.26506 + value = parseFloat(String(value).replace(this.decimalSeparator, ".")); 1.26507 + return isNaN(value) ? '' : value; 1.26508 + }, 1.26509 + 1.26510 + fixPrecision : function(value){ 1.26511 + var nan = isNaN(value); 1.26512 + if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){ 1.26513 + return nan ? '' : value; 1.26514 + } 1.26515 + return parseFloat(parseFloat(value).toFixed(this.decimalPrecision)); 1.26516 + }, 1.26517 + 1.26518 + beforeBlur : function(){ 1.26519 + var v = this.parseValue(this.getRawValue()); 1.26520 + if(v){ 1.26521 + this.setValue(this.fixPrecision(v)); 1.26522 + } 1.26523 + } 1.26524 +}); 1.26525 +Ext.reg('numberfield', Ext.form.NumberField); 1.26526 + 1.26527 +Ext.form.DateField = Ext.extend(Ext.form.TriggerField, { 1.26528 + 1.26529 + format : "m/d/Y", 1.26530 + 1.26531 + altFormats : "m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d", 1.26532 + 1.26533 + disabledDays : null, 1.26534 + 1.26535 + disabledDaysText : "Disabled", 1.26536 + 1.26537 + disabledDates : null, 1.26538 + 1.26539 + disabledDatesText : "Disabled", 1.26540 + 1.26541 + minValue : null, 1.26542 + 1.26543 + maxValue : null, 1.26544 + 1.26545 + minText : "The date in this field must be equal to or after {0}", 1.26546 + 1.26547 + maxText : "The date in this field must be equal to or before {0}", 1.26548 + 1.26549 + invalidText : "{0} is not a valid date - it must be in the format {1}", 1.26550 + 1.26551 + triggerClass : 'x-form-date-trigger', 1.26552 + 1.26553 + 1.26554 + defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"}, 1.26555 + 1.26556 + initComponent : function(){ 1.26557 + Ext.form.DateField.superclass.initComponent.call(this); 1.26558 + if(typeof this.minValue == "string"){ 1.26559 + this.minValue = this.parseDate(this.minValue); 1.26560 + } 1.26561 + if(typeof this.maxValue == "string"){ 1.26562 + this.maxValue = this.parseDate(this.maxValue); 1.26563 + } 1.26564 + this.ddMatch = null; 1.26565 + if(this.disabledDates){ 1.26566 + var dd = this.disabledDates; 1.26567 + var re = "(?:"; 1.26568 + for(var i = 0; i < dd.length; i++){ 1.26569 + re += dd[i]; 1.26570 + if(i != dd.length-1) re += "|"; 1.26571 + } 1.26572 + this.ddMatch = new RegExp(re + ")"); 1.26573 + } 1.26574 + }, 1.26575 + 1.26576 + validateValue : function(value){ 1.26577 + value = this.formatDate(value); 1.26578 + if(!Ext.form.DateField.superclass.validateValue.call(this, value)){ 1.26579 + return false; 1.26580 + } 1.26581 + if(value.length < 1){ return true; 1.26582 + } 1.26583 + var svalue = value; 1.26584 + value = this.parseDate(value); 1.26585 + if(!value){ 1.26586 + this.markInvalid(String.format(this.invalidText, svalue, this.format)); 1.26587 + return false; 1.26588 + } 1.26589 + var time = value.getTime(); 1.26590 + if(this.minValue && time < this.minValue.getTime()){ 1.26591 + this.markInvalid(String.format(this.minText, this.formatDate(this.minValue))); 1.26592 + return false; 1.26593 + } 1.26594 + if(this.maxValue && time > this.maxValue.getTime()){ 1.26595 + this.markInvalid(String.format(this.maxText, this.formatDate(this.maxValue))); 1.26596 + return false; 1.26597 + } 1.26598 + if(this.disabledDays){ 1.26599 + var day = value.getDay(); 1.26600 + for(var i = 0; i < this.disabledDays.length; i++) { 1.26601 + if(day === this.disabledDays[i]){ 1.26602 + this.markInvalid(this.disabledDaysText); 1.26603 + return false; 1.26604 + } 1.26605 + } 1.26606 + } 1.26607 + var fvalue = this.formatDate(value); 1.26608 + if(this.ddMatch && this.ddMatch.test(fvalue)){ 1.26609 + this.markInvalid(String.format(this.disabledDatesText, fvalue)); 1.26610 + return false; 1.26611 + } 1.26612 + return true; 1.26613 + }, 1.26614 + 1.26615 + validateBlur : function(){ 1.26616 + return !this.menu || !this.menu.isVisible(); 1.26617 + }, 1.26618 + 1.26619 + 1.26620 + getValue : function(){ 1.26621 + return this.parseDate(Ext.form.DateField.superclass.getValue.call(this)) || ""; 1.26622 + }, 1.26623 + 1.26624 + 1.26625 + setValue : function(date){ 1.26626 + Ext.form.DateField.superclass.setValue.call(this, this.formatDate(this.parseDate(date))); 1.26627 + }, 1.26628 + 1.26629 + parseDate : function(value){ 1.26630 + if(!value || Ext.isDate(value)){ 1.26631 + return value; 1.26632 + } 1.26633 + var v = Date.parseDate(value, this.format); 1.26634 + if(!v && this.altFormats){ 1.26635 + if(!this.altFormatsArray){ 1.26636 + this.altFormatsArray = this.altFormats.split("|"); 1.26637 + } 1.26638 + for(var i = 0, len = this.altFormatsArray.length; i < len && !v; i++){ 1.26639 + v = Date.parseDate(value, this.altFormatsArray[i]); 1.26640 + } 1.26641 + } 1.26642 + return v; 1.26643 + }, 1.26644 + 1.26645 + onDestroy : function(){ 1.26646 + if(this.menu) { 1.26647 + this.menu.destroy(); 1.26648 + } 1.26649 + if(this.wrap){ 1.26650 + this.wrap.remove(); 1.26651 + } 1.26652 + Ext.form.DateField.superclass.onDestroy.call(this); 1.26653 + }, 1.26654 + 1.26655 + formatDate : function(date){ 1.26656 + return Ext.isDate(date) ? date.dateFormat(this.format) : date; 1.26657 + }, 1.26658 + 1.26659 + menuListeners : { 1.26660 + select: function(m, d){ 1.26661 + this.setValue(d); 1.26662 + }, 1.26663 + show : function(){ this.onFocus(); 1.26664 + }, 1.26665 + hide : function(){ 1.26666 + this.focus.defer(10, this); 1.26667 + var ml = this.menuListeners; 1.26668 + this.menu.un("select", ml.select, this); 1.26669 + this.menu.un("show", ml.show, this); 1.26670 + this.menu.un("hide", ml.hide, this); 1.26671 + } 1.26672 + }, 1.26673 + 1.26674 + onTriggerClick : function(){ 1.26675 + if(this.disabled){ 1.26676 + return; 1.26677 + } 1.26678 + if(this.menu == null){ 1.26679 + this.menu = new Ext.menu.DateMenu(); 1.26680 + } 1.26681 + Ext.apply(this.menu.picker, { 1.26682 + minDate : this.minValue, 1.26683 + maxDate : this.maxValue, 1.26684 + disabledDatesRE : this.ddMatch, 1.26685 + disabledDatesText : this.disabledDatesText, 1.26686 + disabledDays : this.disabledDays, 1.26687 + disabledDaysText : this.disabledDaysText, 1.26688 + format : this.format, 1.26689 + minText : String.format(this.minText, this.formatDate(this.minValue)), 1.26690 + maxText : String.format(this.maxText, this.formatDate(this.maxValue)) 1.26691 + }); 1.26692 + this.menu.on(Ext.apply({}, this.menuListeners, { 1.26693 + scope:this 1.26694 + })); 1.26695 + this.menu.picker.setValue(this.getValue() || new Date()); 1.26696 + this.menu.show(this.el, "tl-bl?"); 1.26697 + }, 1.26698 + 1.26699 + beforeBlur : function(){ 1.26700 + var v = this.parseDate(this.getRawValue()); 1.26701 + if(v){ 1.26702 + this.setValue(v); 1.26703 + } 1.26704 + } 1.26705 + 1.26706 + 1.26707 + 1.26708 + 1.26709 + 1.26710 +}); 1.26711 +Ext.reg('datefield', Ext.form.DateField); 1.26712 + 1.26713 +Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, { 1.26714 + 1.26715 + 1.26716 + 1.26717 + 1.26718 + 1.26719 + 1.26720 + defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"}, 1.26721 + 1.26722 + 1.26723 + 1.26724 + 1.26725 + 1.26726 + 1.26727 + listClass: '', 1.26728 + 1.26729 + selectedClass: 'x-combo-selected', 1.26730 + 1.26731 + triggerClass : 'x-form-arrow-trigger', 1.26732 + 1.26733 + shadow:'sides', 1.26734 + 1.26735 + listAlign: 'tl-bl?', 1.26736 + 1.26737 + maxHeight: 300, 1.26738 + 1.26739 + minHeight: 90, 1.26740 + 1.26741 + triggerAction: 'query', 1.26742 + 1.26743 + minChars : 4, 1.26744 + 1.26745 + typeAhead: false, 1.26746 + 1.26747 + queryDelay: 500, 1.26748 + 1.26749 + pageSize: 0, 1.26750 + 1.26751 + selectOnFocus:false, 1.26752 + 1.26753 + queryParam: 'query', 1.26754 + 1.26755 + loadingText: 'Loading...', 1.26756 + 1.26757 + resizable: false, 1.26758 + 1.26759 + handleHeight : 8, 1.26760 + 1.26761 + editable: true, 1.26762 + 1.26763 + allQuery: '', 1.26764 + 1.26765 + mode: 'remote', 1.26766 + 1.26767 + minListWidth : 70, 1.26768 + 1.26769 + forceSelection:false, 1.26770 + 1.26771 + typeAheadDelay : 250, 1.26772 + 1.26773 + 1.26774 + 1.26775 + lazyInit : true, 1.26776 + 1.26777 + initComponent : function(){ 1.26778 + Ext.form.ComboBox.superclass.initComponent.call(this); 1.26779 + this.addEvents( 1.26780 + 1.26781 + 'expand', 1.26782 + 1.26783 + 'collapse', 1.26784 + 1.26785 + 'beforeselect', 1.26786 + 1.26787 + 'select', 1.26788 + 1.26789 + 'beforequery' 1.26790 + ); 1.26791 + if(this.transform){ 1.26792 + this.allowDomMove = false; 1.26793 + var s = Ext.getDom(this.transform); 1.26794 + if(!this.hiddenName){ 1.26795 + this.hiddenName = s.name; 1.26796 + } 1.26797 + if(!this.store){ 1.26798 + this.mode = 'local'; 1.26799 + var d = [], opts = s.options; 1.26800 + for(var i = 0, len = opts.length;i < len; i++){ 1.26801 + var o = opts[i]; 1.26802 + var value = (Ext.isIE ? o.getAttributeNode('value').specified : o.hasAttribute('value')) ? o.value : o.text; 1.26803 + if(o.selected) { 1.26804 + this.value = value; 1.26805 + } 1.26806 + d.push([value, o.text]); 1.26807 + } 1.26808 + this.store = new Ext.data.SimpleStore({ 1.26809 + 'id': 0, 1.26810 + fields: ['value', 'text'], 1.26811 + data : d 1.26812 + }); 1.26813 + this.valueField = 'value'; 1.26814 + this.displayField = 'text'; 1.26815 + } 1.26816 + s.name = Ext.id(); if(!this.lazyRender){ 1.26817 + this.target = true; 1.26818 + this.el = Ext.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate); 1.26819 + Ext.removeNode(s); this.render(this.el.parentNode); 1.26820 + }else{ 1.26821 + Ext.removeNode(s); } 1.26822 + } 1.26823 + else if(Ext.isArray(this.store)){ 1.26824 + if (Ext.isArray(this.store[0])){ 1.26825 + this.store = new Ext.data.SimpleStore({ 1.26826 + fields: ['value','text'], 1.26827 + data: this.store 1.26828 + }); 1.26829 + this.valueField = 'value'; 1.26830 + }else{ 1.26831 + this.store = new Ext.data.SimpleStore({ 1.26832 + fields: ['text'], 1.26833 + data: this.store, 1.26834 + expandData: true 1.26835 + }); 1.26836 + this.valueField = 'text'; 1.26837 + } 1.26838 + this.displayField = 'text'; 1.26839 + this.mode = 'local'; 1.26840 + } 1.26841 + 1.26842 + this.selectedIndex = -1; 1.26843 + if(this.mode == 'local'){ 1.26844 + if(this.initialConfig.queryDelay === undefined){ 1.26845 + this.queryDelay = 10; 1.26846 + } 1.26847 + if(this.initialConfig.minChars === undefined){ 1.26848 + this.minChars = 0; 1.26849 + } 1.26850 + } 1.26851 + }, 1.26852 + 1.26853 + onRender : function(ct, position){ 1.26854 + Ext.form.ComboBox.superclass.onRender.call(this, ct, position); 1.26855 + if(this.hiddenName){ 1.26856 + this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id: (this.hiddenId||this.hiddenName)}, 1.26857 + 'before', true); 1.26858 + this.hiddenField.value = 1.26859 + this.hiddenValue !== undefined ? this.hiddenValue : 1.26860 + this.value !== undefined ? this.value : ''; 1.26861 + 1.26862 + this.el.dom.removeAttribute('name'); 1.26863 + } 1.26864 + if(Ext.isGecko){ 1.26865 + this.el.dom.setAttribute('autocomplete', 'off'); 1.26866 + } 1.26867 + 1.26868 + if(!this.lazyInit){ 1.26869 + this.initList(); 1.26870 + }else{ 1.26871 + this.on('focus', this.initList, this, {single: true}); 1.26872 + } 1.26873 + 1.26874 + if(!this.editable){ 1.26875 + this.editable = true; 1.26876 + this.setEditable(false); 1.26877 + } 1.26878 + }, 1.26879 + 1.26880 + initList : function(){ 1.26881 + if(!this.list){ 1.26882 + var cls = 'x-combo-list'; 1.26883 + 1.26884 + this.list = new Ext.Layer({ 1.26885 + shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false 1.26886 + }); 1.26887 + 1.26888 + var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth); 1.26889 + this.list.setWidth(lw); 1.26890 + this.list.swallowEvent('mousewheel'); 1.26891 + this.assetHeight = 0; 1.26892 + 1.26893 + if(this.title){ 1.26894 + this.header = this.list.createChild({cls:cls+'-hd', html: this.title}); 1.26895 + this.assetHeight += this.header.getHeight(); 1.26896 + } 1.26897 + 1.26898 + this.innerList = this.list.createChild({cls:cls+'-inner'}); 1.26899 + this.innerList.on('mouseover', this.onViewOver, this); 1.26900 + this.innerList.on('mousemove', this.onViewMove, this); 1.26901 + this.innerList.setWidth(lw - this.list.getFrameWidth('lr')); 1.26902 + 1.26903 + if(this.pageSize){ 1.26904 + this.footer = this.list.createChild({cls:cls+'-ft'}); 1.26905 + this.pageTb = new Ext.PagingToolbar({ 1.26906 + store:this.store, 1.26907 + pageSize: this.pageSize, 1.26908 + renderTo:this.footer 1.26909 + }); 1.26910 + this.assetHeight += this.footer.getHeight(); 1.26911 + } 1.26912 + 1.26913 + if(!this.tpl){ 1.26914 + 1.26915 + this.tpl = '<tpl for="."><div class="'+cls+'-item">{' + this.displayField + '}</div></tpl>'; 1.26916 + 1.26917 + } 1.26918 + 1.26919 + 1.26920 + this.view = new Ext.DataView({ 1.26921 + applyTo: this.innerList, 1.26922 + tpl: this.tpl, 1.26923 + singleSelect: true, 1.26924 + selectedClass: this.selectedClass, 1.26925 + itemSelector: this.itemSelector || '.' + cls + '-item' 1.26926 + }); 1.26927 + 1.26928 + this.view.on('click', this.onViewClick, this); 1.26929 + 1.26930 + this.bindStore(this.store, true); 1.26931 + 1.26932 + if(this.resizable){ 1.26933 + this.resizer = new Ext.Resizable(this.list, { 1.26934 + pinned:true, handles:'se' 1.26935 + }); 1.26936 + this.resizer.on('resize', function(r, w, h){ 1.26937 + this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight; 1.26938 + this.listWidth = w; 1.26939 + this.innerList.setWidth(w - this.list.getFrameWidth('lr')); 1.26940 + this.restrictHeight(); 1.26941 + }, this); 1.26942 + this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px'); 1.26943 + } 1.26944 + } 1.26945 + }, 1.26946 + 1.26947 + 1.26948 + bindStore : function(store, initial){ 1.26949 + if(this.store && !initial){ 1.26950 + this.store.un('beforeload', this.onBeforeLoad, this); 1.26951 + this.store.un('load', this.onLoad, this); 1.26952 + this.store.un('loadexception', this.collapse, this); 1.26953 + if(!store){ 1.26954 + this.store = null; 1.26955 + if(this.view){ 1.26956 + this.view.setStore(null); 1.26957 + } 1.26958 + } 1.26959 + } 1.26960 + if(store){ 1.26961 + this.store = Ext.StoreMgr.lookup(store); 1.26962 + 1.26963 + this.store.on('beforeload', this.onBeforeLoad, this); 1.26964 + this.store.on('load', this.onLoad, this); 1.26965 + this.store.on('loadexception', this.collapse, this); 1.26966 + 1.26967 + if(this.view){ 1.26968 + this.view.setStore(store); 1.26969 + } 1.26970 + } 1.26971 + }, 1.26972 + 1.26973 + initEvents : function(){ 1.26974 + Ext.form.ComboBox.superclass.initEvents.call(this); 1.26975 + 1.26976 + this.keyNav = new Ext.KeyNav(this.el, { 1.26977 + "up" : function(e){ 1.26978 + this.inKeyMode = true; 1.26979 + this.selectPrev(); 1.26980 + }, 1.26981 + 1.26982 + "down" : function(e){ 1.26983 + if(!this.isExpanded()){ 1.26984 + this.onTriggerClick(); 1.26985 + }else{ 1.26986 + this.inKeyMode = true; 1.26987 + this.selectNext(); 1.26988 + } 1.26989 + }, 1.26990 + 1.26991 + "enter" : function(e){ 1.26992 + this.onViewClick(); 1.26993 + this.delayedCheck = true; 1.26994 + this.unsetDelayCheck.defer(10, this); 1.26995 + }, 1.26996 + 1.26997 + "esc" : function(e){ 1.26998 + this.collapse(); 1.26999 + }, 1.27000 + 1.27001 + "tab" : function(e){ 1.27002 + this.onViewClick(false); 1.27003 + return true; 1.27004 + }, 1.27005 + 1.27006 + scope : this, 1.27007 + 1.27008 + doRelay : function(foo, bar, hname){ 1.27009 + if(hname == 'down' || this.scope.isExpanded()){ 1.27010 + return Ext.KeyNav.prototype.doRelay.apply(this, arguments); 1.27011 + } 1.27012 + return true; 1.27013 + }, 1.27014 + 1.27015 + forceKeyDown : true 1.27016 + }); 1.27017 + this.queryDelay = Math.max(this.queryDelay || 10, 1.27018 + this.mode == 'local' ? 10 : 250); 1.27019 + this.dqTask = new Ext.util.DelayedTask(this.initQuery, this); 1.27020 + if(this.typeAhead){ 1.27021 + this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this); 1.27022 + } 1.27023 + if(this.editable !== false){ 1.27024 + this.el.on("keyup", this.onKeyUp, this); 1.27025 + } 1.27026 + if(this.forceSelection){ 1.27027 + this.on('blur', this.doForce, this); 1.27028 + } 1.27029 + }, 1.27030 + 1.27031 + onDestroy : function(){ 1.27032 + if(this.view){ 1.27033 + this.view.el.removeAllListeners(); 1.27034 + this.view.el.remove(); 1.27035 + this.view.purgeListeners(); 1.27036 + } 1.27037 + if(this.list){ 1.27038 + this.list.destroy(); 1.27039 + } 1.27040 + this.bindStore(null); 1.27041 + Ext.form.ComboBox.superclass.onDestroy.call(this); 1.27042 + }, 1.27043 + 1.27044 + unsetDelayCheck : function(){ 1.27045 + delete this.delayedCheck; 1.27046 + }, 1.27047 + fireKey : function(e){ 1.27048 + if(e.isNavKeyPress() && !this.isExpanded() && !this.delayedCheck){ 1.27049 + this.fireEvent("specialkey", this, e); 1.27050 + } 1.27051 + }, 1.27052 + 1.27053 + onResize: function(w, h){ 1.27054 + Ext.form.ComboBox.superclass.onResize.apply(this, arguments); 1.27055 + if(this.list && this.listWidth === undefined){ 1.27056 + var lw = Math.max(w, this.minListWidth); 1.27057 + this.list.setWidth(lw); 1.27058 + this.innerList.setWidth(lw - this.list.getFrameWidth('lr')); 1.27059 + } 1.27060 + }, 1.27061 + 1.27062 + onEnable: function(){ 1.27063 + Ext.form.ComboBox.superclass.onEnable.apply(this, arguments); 1.27064 + if(this.hiddenField){ 1.27065 + this.hiddenField.disabled = false; 1.27066 + } 1.27067 + }, 1.27068 + 1.27069 + onDisable: function(){ 1.27070 + Ext.form.ComboBox.superclass.onDisable.apply(this, arguments); 1.27071 + if(this.hiddenField){ 1.27072 + this.hiddenField.disabled = true; 1.27073 + } 1.27074 + }, 1.27075 + 1.27076 + 1.27077 + setEditable : function(value){ 1.27078 + if(value == this.editable){ 1.27079 + return; 1.27080 + } 1.27081 + this.editable = value; 1.27082 + if(!value){ 1.27083 + this.el.dom.setAttribute('readOnly', true); 1.27084 + this.el.on('mousedown', this.onTriggerClick, this); 1.27085 + this.el.addClass('x-combo-noedit'); 1.27086 + }else{ 1.27087 + this.el.dom.setAttribute('readOnly', false); 1.27088 + this.el.un('mousedown', this.onTriggerClick, this); 1.27089 + this.el.removeClass('x-combo-noedit'); 1.27090 + } 1.27091 + }, 1.27092 + 1.27093 + onBeforeLoad : function(){ 1.27094 + if(!this.hasFocus){ 1.27095 + return; 1.27096 + } 1.27097 + this.innerList.update(this.loadingText ? 1.27098 + '<div class="loading-indicator">'+this.loadingText+'</div>' : ''); 1.27099 + this.restrictHeight(); 1.27100 + this.selectedIndex = -1; 1.27101 + }, 1.27102 + 1.27103 + onLoad : function(){ 1.27104 + if(!this.hasFocus){ 1.27105 + return; 1.27106 + } 1.27107 + if(this.store.getCount() > 0){ 1.27108 + this.expand(); 1.27109 + this.restrictHeight(); 1.27110 + if(this.lastQuery == this.allQuery){ 1.27111 + if(this.editable){ 1.27112 + this.el.dom.select(); 1.27113 + } 1.27114 + if(!this.selectByValue(this.value, true)){ 1.27115 + this.select(0, true); 1.27116 + } 1.27117 + }else{ 1.27118 + this.selectNext(); 1.27119 + if(this.typeAhead && this.lastKey != Ext.EventObject.BACKSPACE && this.lastKey != Ext.EventObject.DELETE){ 1.27120 + this.taTask.delay(this.typeAheadDelay); 1.27121 + } 1.27122 + } 1.27123 + }else{ 1.27124 + this.onEmptyResults(); 1.27125 + } 1.27126 + }, 1.27127 + 1.27128 + onTypeAhead : function(){ 1.27129 + if(this.store.getCount() > 0){ 1.27130 + var r = this.store.getAt(0); 1.27131 + var newValue = r.data[this.displayField]; 1.27132 + var len = newValue.length; 1.27133 + var selStart = this.getRawValue().length; 1.27134 + if(selStart != len){ 1.27135 + this.setRawValue(newValue); 1.27136 + this.selectText(selStart, newValue.length); 1.27137 + } 1.27138 + } 1.27139 + }, 1.27140 + 1.27141 + onSelect : function(record, index){ 1.27142 + if(this.fireEvent('beforeselect', this, record, index) !== false){ 1.27143 + this.setValue(record.data[this.valueField || this.displayField]); 1.27144 + this.collapse(); 1.27145 + this.fireEvent('select', this, record, index); 1.27146 + } 1.27147 + }, 1.27148 + 1.27149 + 1.27150 + getValue : function(){ 1.27151 + if(this.valueField){ 1.27152 + return typeof this.value != 'undefined' ? this.value : ''; 1.27153 + }else{ 1.27154 + return Ext.form.ComboBox.superclass.getValue.call(this); 1.27155 + } 1.27156 + }, 1.27157 + 1.27158 + 1.27159 + clearValue : function(){ 1.27160 + if(this.hiddenField){ 1.27161 + this.hiddenField.value = ''; 1.27162 + } 1.27163 + this.setRawValue(''); 1.27164 + this.lastSelectionText = ''; 1.27165 + this.applyEmptyText(); 1.27166 + this.value = ''; 1.27167 + }, 1.27168 + 1.27169 + 1.27170 + setValue : function(v){ 1.27171 + var text = v; 1.27172 + if(this.valueField){ 1.27173 + var r = this.findRecord(this.valueField, v); 1.27174 + if(r){ 1.27175 + text = r.data[this.displayField]; 1.27176 + }else if(this.valueNotFoundText !== undefined){ 1.27177 + text = this.valueNotFoundText; 1.27178 + } 1.27179 + } 1.27180 + this.lastSelectionText = text; 1.27181 + if(this.hiddenField){ 1.27182 + this.hiddenField.value = v; 1.27183 + } 1.27184 + Ext.form.ComboBox.superclass.setValue.call(this, text); 1.27185 + this.value = v; 1.27186 + }, 1.27187 + 1.27188 + findRecord : function(prop, value){ 1.27189 + var record; 1.27190 + if(this.store.getCount() > 0){ 1.27191 + this.store.each(function(r){ 1.27192 + if(r.data[prop] == value){ 1.27193 + record = r; 1.27194 + return false; 1.27195 + } 1.27196 + }); 1.27197 + } 1.27198 + return record; 1.27199 + }, 1.27200 + 1.27201 + onViewMove : function(e, t){ 1.27202 + this.inKeyMode = false; 1.27203 + }, 1.27204 + 1.27205 + onViewOver : function(e, t){ 1.27206 + if(this.inKeyMode){ return; 1.27207 + } 1.27208 + var item = this.view.findItemFromChild(t); 1.27209 + if(item){ 1.27210 + var index = this.view.indexOf(item); 1.27211 + this.select(index, false); 1.27212 + } 1.27213 + }, 1.27214 + 1.27215 + onViewClick : function(doFocus){ 1.27216 + var index = this.view.getSelectedIndexes()[0]; 1.27217 + var r = this.store.getAt(index); 1.27218 + if(r){ 1.27219 + this.onSelect(r, index); 1.27220 + } 1.27221 + if(doFocus !== false){ 1.27222 + this.el.focus(); 1.27223 + } 1.27224 + }, 1.27225 + 1.27226 + restrictHeight : function(){ 1.27227 + this.innerList.dom.style.height = ''; 1.27228 + var inner = this.innerList.dom; 1.27229 + var pad = this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight; 1.27230 + var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight); 1.27231 + var ha = this.getPosition()[1]-Ext.getBody().getScroll().top; 1.27232 + var hb = Ext.lib.Dom.getViewHeight()-ha-this.getSize().height; 1.27233 + var space = Math.max(ha, hb, this.minHeight || 0)-this.list.shadowOffset-pad-5; 1.27234 + h = Math.min(h, space, this.maxHeight); 1.27235 + 1.27236 + this.innerList.setHeight(h); 1.27237 + this.list.beginUpdate(); 1.27238 + this.list.setHeight(h+pad); 1.27239 + this.list.alignTo(this.wrap, this.listAlign); 1.27240 + this.list.endUpdate(); 1.27241 + }, 1.27242 + 1.27243 + onEmptyResults : function(){ 1.27244 + this.collapse(); 1.27245 + }, 1.27246 + 1.27247 + 1.27248 + isExpanded : function(){ 1.27249 + return this.list && this.list.isVisible(); 1.27250 + }, 1.27251 + 1.27252 + 1.27253 + selectByValue : function(v, scrollIntoView){ 1.27254 + if(v !== undefined && v !== null){ 1.27255 + var r = this.findRecord(this.valueField || this.displayField, v); 1.27256 + if(r){ 1.27257 + this.select(this.store.indexOf(r), scrollIntoView); 1.27258 + return true; 1.27259 + } 1.27260 + } 1.27261 + return false; 1.27262 + }, 1.27263 + 1.27264 + 1.27265 + select : function(index, scrollIntoView){ 1.27266 + this.selectedIndex = index; 1.27267 + this.view.select(index); 1.27268 + if(scrollIntoView !== false){ 1.27269 + var el = this.view.getNode(index); 1.27270 + if(el){ 1.27271 + this.innerList.scrollChildIntoView(el, false); 1.27272 + } 1.27273 + } 1.27274 + }, 1.27275 + 1.27276 + selectNext : function(){ 1.27277 + var ct = this.store.getCount(); 1.27278 + if(ct > 0){ 1.27279 + if(this.selectedIndex == -1){ 1.27280 + this.select(0); 1.27281 + }else if(this.selectedIndex < ct-1){ 1.27282 + this.select(this.selectedIndex+1); 1.27283 + } 1.27284 + } 1.27285 + }, 1.27286 + 1.27287 + selectPrev : function(){ 1.27288 + var ct = this.store.getCount(); 1.27289 + if(ct > 0){ 1.27290 + if(this.selectedIndex == -1){ 1.27291 + this.select(0); 1.27292 + }else if(this.selectedIndex != 0){ 1.27293 + this.select(this.selectedIndex-1); 1.27294 + } 1.27295 + } 1.27296 + }, 1.27297 + 1.27298 + onKeyUp : function(e){ 1.27299 + if(this.editable !== false && !e.isSpecialKey()){ 1.27300 + this.lastKey = e.getKey(); 1.27301 + this.dqTask.delay(this.queryDelay); 1.27302 + } 1.27303 + }, 1.27304 + 1.27305 + validateBlur : function(){ 1.27306 + return !this.list || !this.list.isVisible(); 1.27307 + }, 1.27308 + 1.27309 + initQuery : function(){ 1.27310 + this.doQuery(this.getRawValue()); 1.27311 + }, 1.27312 + 1.27313 + doForce : function(){ 1.27314 + if(this.el.dom.value.length > 0){ 1.27315 + this.el.dom.value = 1.27316 + this.lastSelectionText === undefined ? '' : this.lastSelectionText; 1.27317 + this.applyEmptyText(); 1.27318 + } 1.27319 + }, 1.27320 + 1.27321 + 1.27322 + doQuery : function(q, forceAll){ 1.27323 + if(q === undefined || q === null){ 1.27324 + q = ''; 1.27325 + } 1.27326 + var qe = { 1.27327 + query: q, 1.27328 + forceAll: forceAll, 1.27329 + combo: this, 1.27330 + cancel:false 1.27331 + }; 1.27332 + if(this.fireEvent('beforequery', qe)===false || qe.cancel){ 1.27333 + return false; 1.27334 + } 1.27335 + q = qe.query; 1.27336 + forceAll = qe.forceAll; 1.27337 + if(forceAll === true || (q.length >= this.minChars)){ 1.27338 + if(this.lastQuery !== q){ 1.27339 + this.lastQuery = q; 1.27340 + if(this.mode == 'local'){ 1.27341 + this.selectedIndex = -1; 1.27342 + if(forceAll){ 1.27343 + this.store.clearFilter(); 1.27344 + }else{ 1.27345 + this.store.filter(this.displayField, q); 1.27346 + } 1.27347 + this.onLoad(); 1.27348 + }else{ 1.27349 + this.store.baseParams[this.queryParam] = q; 1.27350 + this.store.load({ 1.27351 + params: this.getParams(q) 1.27352 + }); 1.27353 + this.expand(); 1.27354 + } 1.27355 + }else{ 1.27356 + this.selectedIndex = -1; 1.27357 + this.onLoad(); 1.27358 + } 1.27359 + } 1.27360 + }, 1.27361 + 1.27362 + getParams : function(q){ 1.27363 + var p = {}; 1.27364 + if(this.pageSize){ 1.27365 + p.start = 0; 1.27366 + p.limit = this.pageSize; 1.27367 + } 1.27368 + return p; 1.27369 + }, 1.27370 + 1.27371 + 1.27372 + collapse : function(){ 1.27373 + if(!this.isExpanded()){ 1.27374 + return; 1.27375 + } 1.27376 + this.list.hide(); 1.27377 + Ext.getDoc().un('mousewheel', this.collapseIf, this); 1.27378 + Ext.getDoc().un('mousedown', this.collapseIf, this); 1.27379 + this.fireEvent('collapse', this); 1.27380 + }, 1.27381 + 1.27382 + collapseIf : function(e){ 1.27383 + if(!e.within(this.wrap) && !e.within(this.list)){ 1.27384 + this.collapse(); 1.27385 + } 1.27386 + }, 1.27387 + 1.27388 + 1.27389 + expand : function(){ 1.27390 + if(this.isExpanded() || !this.hasFocus){ 1.27391 + return; 1.27392 + } 1.27393 + this.list.alignTo(this.wrap, this.listAlign); 1.27394 + this.list.show(); 1.27395 + this.innerList.setOverflow('auto'); Ext.getDoc().on('mousewheel', this.collapseIf, this); 1.27396 + Ext.getDoc().on('mousedown', this.collapseIf, this); 1.27397 + this.fireEvent('expand', this); 1.27398 + }, 1.27399 + 1.27400 + onTriggerClick : function(){ 1.27401 + if(this.disabled){ 1.27402 + return; 1.27403 + } 1.27404 + if(this.isExpanded()){ 1.27405 + this.collapse(); 1.27406 + this.el.focus(); 1.27407 + }else { 1.27408 + this.onFocus({}); 1.27409 + if(this.triggerAction == 'all') { 1.27410 + this.doQuery(this.allQuery, true); 1.27411 + } else { 1.27412 + this.doQuery(this.getRawValue()); 1.27413 + } 1.27414 + this.el.focus(); 1.27415 + } 1.27416 + } 1.27417 + 1.27418 + 1.27419 + 1.27420 + 1.27421 + 1.27422 + 1.27423 +}); 1.27424 +Ext.reg('combo', Ext.form.ComboBox); 1.27425 + 1.27426 +Ext.form.Checkbox = Ext.extend(Ext.form.Field, { 1.27427 + 1.27428 + focusClass : undefined, 1.27429 + 1.27430 + fieldClass: "x-form-field", 1.27431 + 1.27432 + checked: false, 1.27433 + 1.27434 + defaultAutoCreate : { tag: "input", type: 'checkbox', autocomplete: "off"}, 1.27435 + 1.27436 + 1.27437 + 1.27438 + initComponent : function(){ 1.27439 + Ext.form.Checkbox.superclass.initComponent.call(this); 1.27440 + this.addEvents( 1.27441 + 1.27442 + 'check' 1.27443 + ); 1.27444 + }, 1.27445 + 1.27446 + onResize : function(){ 1.27447 + Ext.form.Checkbox.superclass.onResize.apply(this, arguments); 1.27448 + if(!this.boxLabel){ 1.27449 + this.el.alignTo(this.wrap, 'c-c'); 1.27450 + } 1.27451 + }, 1.27452 + 1.27453 + initEvents : function(){ 1.27454 + Ext.form.Checkbox.superclass.initEvents.call(this); 1.27455 + this.el.on("click", this.onClick, this); 1.27456 + this.el.on("change", this.onClick, this); 1.27457 + }, 1.27458 + 1.27459 + getResizeEl : function(){ 1.27460 + return this.wrap; 1.27461 + }, 1.27462 + 1.27463 + getPositionEl : function(){ 1.27464 + return this.wrap; 1.27465 + }, 1.27466 + 1.27467 + 1.27468 + markInvalid : Ext.emptyFn, 1.27469 + 1.27470 + clearInvalid : Ext.emptyFn, 1.27471 + 1.27472 + onRender : function(ct, position){ 1.27473 + Ext.form.Checkbox.superclass.onRender.call(this, ct, position); 1.27474 + if(this.inputValue !== undefined){ 1.27475 + this.el.dom.value = this.inputValue; 1.27476 + } 1.27477 + this.wrap = this.el.wrap({cls: "x-form-check-wrap"}); 1.27478 + if(this.boxLabel){ 1.27479 + this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel}); 1.27480 + } 1.27481 + if(this.checked){ 1.27482 + this.setValue(true); 1.27483 + }else{ 1.27484 + this.checked = this.el.dom.checked; 1.27485 + } 1.27486 + }, 1.27487 + 1.27488 + onDestroy : function(){ 1.27489 + if(this.wrap){ 1.27490 + this.wrap.remove(); 1.27491 + } 1.27492 + Ext.form.Checkbox.superclass.onDestroy.call(this); 1.27493 + }, 1.27494 + 1.27495 + initValue : Ext.emptyFn, 1.27496 + 1.27497 + 1.27498 + getValue : function(){ 1.27499 + if(this.rendered){ 1.27500 + return this.el.dom.checked; 1.27501 + } 1.27502 + return false; 1.27503 + }, 1.27504 + 1.27505 + onClick : function(){ 1.27506 + if(this.el.dom.checked != this.checked){ 1.27507 + this.setValue(this.el.dom.checked); 1.27508 + } 1.27509 + }, 1.27510 + 1.27511 + 1.27512 + setValue : function(v){ 1.27513 + this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on'); 1.27514 + if(this.el && this.el.dom){ 1.27515 + this.el.dom.checked = this.checked; 1.27516 + this.el.dom.defaultChecked = this.checked; 1.27517 + } 1.27518 + this.fireEvent("check", this, this.checked); 1.27519 + } 1.27520 +}); 1.27521 +Ext.reg('checkbox', Ext.form.Checkbox); 1.27522 + 1.27523 +Ext.form.Radio = Ext.extend(Ext.form.Checkbox, { 1.27524 + inputType: 'radio', 1.27525 + 1.27526 + 1.27527 + markInvalid : Ext.emptyFn, 1.27528 + 1.27529 + clearInvalid : Ext.emptyFn, 1.27530 + 1.27531 + 1.27532 + getGroupValue : function(){ 1.27533 + var p = this.el.up('form') || Ext.getBody(); 1.27534 + var c = p.child('input[name='+this.el.dom.name+']:checked', true); 1.27535 + return c ? c.value : null; 1.27536 + }, 1.27537 + 1.27538 + onClick : function(){ 1.27539 + if(this.el.dom.checked != this.checked){ 1.27540 + var p = this.el.up('form') || Ext.getBody(); 1.27541 + var els = p.select('input[name='+this.el.dom.name+']'); 1.27542 + els.each(function(el){ 1.27543 + if(el.dom.id == this.id){ 1.27544 + this.setValue(true); 1.27545 + }else{ 1.27546 + Ext.getCmp(el.dom.id).setValue(false); 1.27547 + } 1.27548 + }, this); 1.27549 + } 1.27550 + }, 1.27551 + 1.27552 + 1.27553 + setValue : function(v){ 1.27554 + if (typeof v == 'boolean') { 1.27555 + Ext.form.Radio.superclass.setValue.call(this, v); 1.27556 + } else { 1.27557 + var r = this.el.up('form').child('input[name='+this.el.dom.name+'][value='+v+']', true); 1.27558 + if (r){ 1.27559 + r.checked = true; 1.27560 + }; 1.27561 + } 1.27562 + } 1.27563 +}); 1.27564 +Ext.reg('radio', Ext.form.Radio); 1.27565 + 1.27566 +Ext.form.Hidden = Ext.extend(Ext.form.Field, { 1.27567 + 1.27568 + inputType : 'hidden', 1.27569 + 1.27570 + 1.27571 + onRender : function(){ 1.27572 + Ext.form.Hidden.superclass.onRender.apply(this, arguments); 1.27573 + }, 1.27574 + 1.27575 + 1.27576 + initEvents : function(){ 1.27577 + this.originalValue = this.getValue(); 1.27578 + }, 1.27579 + 1.27580 + 1.27581 + setSize : Ext.emptyFn, 1.27582 + setWidth : Ext.emptyFn, 1.27583 + setHeight : Ext.emptyFn, 1.27584 + setPosition : Ext.emptyFn, 1.27585 + setPagePosition : Ext.emptyFn, 1.27586 + markInvalid : Ext.emptyFn, 1.27587 + clearInvalid : Ext.emptyFn 1.27588 +}); 1.27589 +Ext.reg('hidden', Ext.form.Hidden); 1.27590 + 1.27591 +Ext.form.BasicForm = function(el, config){ 1.27592 + Ext.apply(this, config); 1.27593 + 1.27594 + this.items = new Ext.util.MixedCollection(false, function(o){ 1.27595 + return o.id || (o.id = Ext.id()); 1.27596 + }); 1.27597 + this.addEvents( 1.27598 + 1.27599 + 'beforeaction', 1.27600 + 1.27601 + 'actionfailed', 1.27602 + 1.27603 + 'actioncomplete' 1.27604 + ); 1.27605 + 1.27606 + if(el){ 1.27607 + this.initEl(el); 1.27608 + } 1.27609 + Ext.form.BasicForm.superclass.constructor.call(this); 1.27610 +}; 1.27611 + 1.27612 +Ext.extend(Ext.form.BasicForm, Ext.util.Observable, { 1.27613 + 1.27614 + 1.27615 + 1.27616 + 1.27617 + 1.27618 + 1.27619 + 1.27620 + timeout: 30, 1.27621 + 1.27622 + activeAction : null, 1.27623 + 1.27624 + 1.27625 + trackResetOnLoad : false, 1.27626 + 1.27627 + 1.27628 + 1.27629 + 1.27630 + initEl : function(el){ 1.27631 + this.el = Ext.get(el); 1.27632 + this.id = this.el.id || Ext.id(); 1.27633 + if(!this.standardSubmit){ 1.27634 + this.el.on('submit', this.onSubmit, this); 1.27635 + } 1.27636 + this.el.addClass('x-form'); 1.27637 + }, 1.27638 + 1.27639 + 1.27640 + getEl: function(){ 1.27641 + return this.el; 1.27642 + }, 1.27643 + 1.27644 + onSubmit : function(e){ 1.27645 + e.stopEvent(); 1.27646 + }, 1.27647 + 1.27648 + destroy: function() { 1.27649 + this.items.each(function(f){ 1.27650 + Ext.destroy(f); 1.27651 + }); 1.27652 + if(this.el){ 1.27653 + this.el.removeAllListeners(); 1.27654 + this.el.remove(); 1.27655 + } 1.27656 + this.purgeListeners(); 1.27657 + }, 1.27658 + 1.27659 + 1.27660 + isValid : function(){ 1.27661 + var valid = true; 1.27662 + this.items.each(function(f){ 1.27663 + if(!f.validate()){ 1.27664 + valid = false; 1.27665 + } 1.27666 + }); 1.27667 + return valid; 1.27668 + }, 1.27669 + 1.27670 + 1.27671 + isDirty : function(){ 1.27672 + var dirty = false; 1.27673 + this.items.each(function(f){ 1.27674 + if(f.isDirty()){ 1.27675 + dirty = true; 1.27676 + return false; 1.27677 + } 1.27678 + }); 1.27679 + return dirty; 1.27680 + }, 1.27681 + 1.27682 + 1.27683 + doAction : function(action, options){ 1.27684 + if(typeof action == 'string'){ 1.27685 + action = new Ext.form.Action.ACTION_TYPES[action](this, options); 1.27686 + } 1.27687 + if(this.fireEvent('beforeaction', this, action) !== false){ 1.27688 + this.beforeAction(action); 1.27689 + action.run.defer(100, action); 1.27690 + } 1.27691 + return this; 1.27692 + }, 1.27693 + 1.27694 + 1.27695 + submit : function(options){ 1.27696 + if(this.standardSubmit){ 1.27697 + var v = this.isValid(); 1.27698 + if(v){ 1.27699 + this.el.dom.submit(); 1.27700 + } 1.27701 + return v; 1.27702 + } 1.27703 + this.doAction('submit', options); 1.27704 + return this; 1.27705 + }, 1.27706 + 1.27707 + 1.27708 + load : function(options){ 1.27709 + this.doAction('load', options); 1.27710 + return this; 1.27711 + }, 1.27712 + 1.27713 + 1.27714 + updateRecord : function(record){ 1.27715 + record.beginEdit(); 1.27716 + var fs = record.fields; 1.27717 + fs.each(function(f){ 1.27718 + var field = this.findField(f.name); 1.27719 + if(field){ 1.27720 + record.set(f.name, field.getValue()); 1.27721 + } 1.27722 + }, this); 1.27723 + record.endEdit(); 1.27724 + return this; 1.27725 + }, 1.27726 + 1.27727 + 1.27728 + loadRecord : function(record){ 1.27729 + this.setValues(record.data); 1.27730 + return this; 1.27731 + }, 1.27732 + 1.27733 + beforeAction : function(action){ 1.27734 + var o = action.options; 1.27735 + if(o.waitMsg){ 1.27736 + if(this.waitMsgTarget === true){ 1.27737 + this.el.mask(o.waitMsg, 'x-mask-loading'); 1.27738 + }else if(this.waitMsgTarget){ 1.27739 + this.waitMsgTarget = Ext.get(this.waitMsgTarget); 1.27740 + this.waitMsgTarget.mask(o.waitMsg, 'x-mask-loading'); 1.27741 + }else{ 1.27742 + Ext.MessageBox.wait(o.waitMsg, o.waitTitle || this.waitTitle || 'Please Wait...'); 1.27743 + } 1.27744 + } 1.27745 + }, 1.27746 + 1.27747 + afterAction : function(action, success){ 1.27748 + this.activeAction = null; 1.27749 + var o = action.options; 1.27750 + if(o.waitMsg){ 1.27751 + if(this.waitMsgTarget === true){ 1.27752 + this.el.unmask(); 1.27753 + }else if(this.waitMsgTarget){ 1.27754 + this.waitMsgTarget.unmask(); 1.27755 + }else{ 1.27756 + Ext.MessageBox.updateProgress(1); 1.27757 + Ext.MessageBox.hide(); 1.27758 + } 1.27759 + } 1.27760 + if(success){ 1.27761 + if(o.reset){ 1.27762 + this.reset(); 1.27763 + } 1.27764 + Ext.callback(o.success, o.scope, [this, action]); 1.27765 + this.fireEvent('actioncomplete', this, action); 1.27766 + }else{ 1.27767 + Ext.callback(o.failure, o.scope, [this, action]); 1.27768 + this.fireEvent('actionfailed', this, action); 1.27769 + } 1.27770 + }, 1.27771 + 1.27772 + 1.27773 + findField : function(id){ 1.27774 + var field = this.items.get(id); 1.27775 + if(!field){ 1.27776 + this.items.each(function(f){ 1.27777 + if(f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)){ 1.27778 + field = f; 1.27779 + return false; 1.27780 + } 1.27781 + }); 1.27782 + } 1.27783 + return field || null; 1.27784 + }, 1.27785 + 1.27786 + 1.27787 + 1.27788 + markInvalid : function(errors){ 1.27789 + if(Ext.isArray(errors)){ 1.27790 + for(var i = 0, len = errors.length; i < len; i++){ 1.27791 + var fieldError = errors[i]; 1.27792 + var f = this.findField(fieldError.id); 1.27793 + if(f){ 1.27794 + f.markInvalid(fieldError.msg); 1.27795 + } 1.27796 + } 1.27797 + }else{ 1.27798 + var field, id; 1.27799 + for(id in errors){ 1.27800 + if(typeof errors[id] != 'function' && (field = this.findField(id))){ 1.27801 + field.markInvalid(errors[id]); 1.27802 + } 1.27803 + } 1.27804 + } 1.27805 + return this; 1.27806 + }, 1.27807 + 1.27808 + 1.27809 + setValues : function(values){ 1.27810 + if(Ext.isArray(values)){ for(var i = 0, len = values.length; i < len; i++){ 1.27811 + var v = values[i]; 1.27812 + var f = this.findField(v.id); 1.27813 + if(f){ 1.27814 + f.setValue(v.value); 1.27815 + if(this.trackResetOnLoad){ 1.27816 + f.originalValue = f.getValue(); 1.27817 + } 1.27818 + } 1.27819 + } 1.27820 + }else{ var field, id; 1.27821 + for(id in values){ 1.27822 + if(typeof values[id] != 'function' && (field = this.findField(id))){ 1.27823 + field.setValue(values[id]); 1.27824 + if(this.trackResetOnLoad){ 1.27825 + field.originalValue = field.getValue(); 1.27826 + } 1.27827 + } 1.27828 + } 1.27829 + } 1.27830 + return this; 1.27831 + }, 1.27832 + 1.27833 + 1.27834 + getValues : function(asString){ 1.27835 + var fs = Ext.lib.Ajax.serializeForm(this.el.dom); 1.27836 + if(asString === true){ 1.27837 + return fs; 1.27838 + } 1.27839 + return Ext.urlDecode(fs); 1.27840 + }, 1.27841 + 1.27842 + 1.27843 + clearInvalid : function(){ 1.27844 + this.items.each(function(f){ 1.27845 + f.clearInvalid(); 1.27846 + }); 1.27847 + return this; 1.27848 + }, 1.27849 + 1.27850 + 1.27851 + reset : function(){ 1.27852 + this.items.each(function(f){ 1.27853 + f.reset(); 1.27854 + }); 1.27855 + return this; 1.27856 + }, 1.27857 + 1.27858 + 1.27859 + add : function(){ 1.27860 + this.items.addAll(Array.prototype.slice.call(arguments, 0)); 1.27861 + return this; 1.27862 + }, 1.27863 + 1.27864 + 1.27865 + 1.27866 + remove : function(field){ 1.27867 + this.items.remove(field); 1.27868 + return this; 1.27869 + }, 1.27870 + 1.27871 + 1.27872 + render : function(){ 1.27873 + this.items.each(function(f){ 1.27874 + if(f.isFormField && !f.rendered && document.getElementById(f.id)){ f.applyToMarkup(f.id); 1.27875 + } 1.27876 + }); 1.27877 + return this; 1.27878 + }, 1.27879 + 1.27880 + 1.27881 + applyToFields : function(o){ 1.27882 + this.items.each(function(f){ 1.27883 + Ext.apply(f, o); 1.27884 + }); 1.27885 + return this; 1.27886 + }, 1.27887 + 1.27888 + 1.27889 + applyIfToFields : function(o){ 1.27890 + this.items.each(function(f){ 1.27891 + Ext.applyIf(f, o); 1.27892 + }); 1.27893 + return this; 1.27894 + } 1.27895 +}); 1.27896 + 1.27897 +Ext.BasicForm = Ext.form.BasicForm; 1.27898 + 1.27899 +Ext.FormPanel = Ext.extend(Ext.Panel, { 1.27900 + 1.27901 + 1.27902 + 1.27903 + 1.27904 + buttonAlign:'center', 1.27905 + 1.27906 + 1.27907 + minButtonWidth:75, 1.27908 + 1.27909 + 1.27910 + labelAlign:'left', 1.27911 + 1.27912 + 1.27913 + monitorValid : false, 1.27914 + 1.27915 + 1.27916 + monitorPoll : 200, 1.27917 + 1.27918 + 1.27919 + layout: 'form', 1.27920 + 1.27921 + initComponent :function(){ 1.27922 + this.form = this.createForm(); 1.27923 + 1.27924 + Ext.FormPanel.superclass.initComponent.call(this); 1.27925 + 1.27926 + this.addEvents( 1.27927 + 1.27928 + 'clientvalidation' 1.27929 + ); 1.27930 + 1.27931 + this.relayEvents(this.form, ['beforeaction', 'actionfailed', 'actioncomplete']); 1.27932 + }, 1.27933 + 1.27934 + createForm: function(){ 1.27935 + delete this.initialConfig.listeners; 1.27936 + return new Ext.form.BasicForm(null, this.initialConfig); 1.27937 + }, 1.27938 + 1.27939 + initFields : function(){ 1.27940 + var f = this.form; 1.27941 + var formPanel = this; 1.27942 + var fn = function(c){ 1.27943 + if(c.doLayout && c != formPanel){ 1.27944 + Ext.applyIf(c, { 1.27945 + labelAlign: c.ownerCt.labelAlign, 1.27946 + labelWidth: c.ownerCt.labelWidth, 1.27947 + itemCls: c.ownerCt.itemCls 1.27948 + }); 1.27949 + if(c.items){ 1.27950 + c.items.each(fn); 1.27951 + } 1.27952 + }else if(c.isFormField){ 1.27953 + f.add(c); 1.27954 + } 1.27955 + } 1.27956 + this.items.each(fn); 1.27957 + }, 1.27958 + 1.27959 + getLayoutTarget : function(){ 1.27960 + return this.form.el; 1.27961 + }, 1.27962 + 1.27963 + 1.27964 + getForm : function(){ 1.27965 + return this.form; 1.27966 + }, 1.27967 + 1.27968 + onRender : function(ct, position){ 1.27969 + this.initFields(); 1.27970 + 1.27971 + Ext.FormPanel.superclass.onRender.call(this, ct, position); 1.27972 + var o = { 1.27973 + tag: 'form', 1.27974 + method : this.method || 'POST', 1.27975 + id : this.formId || Ext.id() 1.27976 + }; 1.27977 + if(this.fileUpload) { 1.27978 + o.enctype = 'multipart/form-data'; 1.27979 + } 1.27980 + this.form.initEl(this.body.createChild(o)); 1.27981 + }, 1.27982 + 1.27983 + beforeDestroy: function(){ 1.27984 + Ext.FormPanel.superclass.beforeDestroy.call(this); 1.27985 + Ext.destroy(this.form); 1.27986 + }, 1.27987 + 1.27988 + initEvents : function(){ 1.27989 + Ext.FormPanel.superclass.initEvents.call(this); 1.27990 + this.items.on('remove', this.onRemove, this); 1.27991 + this.items.on('add', this.onAdd, this); 1.27992 + if(this.monitorValid){ this.startMonitoring(); 1.27993 + } 1.27994 + }, 1.27995 + 1.27996 + onAdd : function(ct, c) { 1.27997 + if (c.isFormField) { 1.27998 + this.form.add(c); 1.27999 + } 1.28000 + }, 1.28001 + 1.28002 + onRemove : function(c) { 1.28003 + if (c.isFormField) { 1.28004 + Ext.destroy(c.container.up('.x-form-item')); 1.28005 + this.form.remove(c); 1.28006 + } 1.28007 + }, 1.28008 + 1.28009 + 1.28010 + startMonitoring : function(){ 1.28011 + if(!this.bound){ 1.28012 + this.bound = true; 1.28013 + Ext.TaskMgr.start({ 1.28014 + run : this.bindHandler, 1.28015 + interval : this.monitorPoll || 200, 1.28016 + scope: this 1.28017 + }); 1.28018 + } 1.28019 + }, 1.28020 + 1.28021 + 1.28022 + stopMonitoring : function(){ 1.28023 + this.bound = false; 1.28024 + }, 1.28025 + 1.28026 + 1.28027 + load : function(){ 1.28028 + this.form.load.apply(this.form, arguments); 1.28029 + }, 1.28030 + 1.28031 + onDisable : function(){ 1.28032 + Ext.FormPanel.superclass.onDisable.call(this); 1.28033 + if(this.form){ 1.28034 + this.form.items.each(function(){ 1.28035 + this.disable(); 1.28036 + }); 1.28037 + } 1.28038 + }, 1.28039 + 1.28040 + onEnable : function(){ 1.28041 + Ext.FormPanel.superclass.onEnable.call(this); 1.28042 + if(this.form){ 1.28043 + this.form.items.each(function(){ 1.28044 + this.enable(); 1.28045 + }); 1.28046 + } 1.28047 + }, 1.28048 + 1.28049 + bindHandler : function(){ 1.28050 + if(!this.bound){ 1.28051 + return false; } 1.28052 + var valid = true; 1.28053 + this.form.items.each(function(f){ 1.28054 + if(!f.isValid(true)){ 1.28055 + valid = false; 1.28056 + return false; 1.28057 + } 1.28058 + }); 1.28059 + if(this.buttons){ 1.28060 + for(var i = 0, len = this.buttons.length; i < len; i++){ 1.28061 + var btn = this.buttons[i]; 1.28062 + if(btn.formBind === true && btn.disabled === valid){ 1.28063 + btn.setDisabled(!valid); 1.28064 + } 1.28065 + } 1.28066 + } 1.28067 + this.fireEvent('clientvalidation', this, valid); 1.28068 + } 1.28069 +}); 1.28070 +Ext.reg('form', Ext.FormPanel); 1.28071 + 1.28072 +Ext.form.FormPanel = Ext.FormPanel; 1.28073 + 1.28074 + 1.28075 + 1.28076 +Ext.form.FieldSet = Ext.extend(Ext.Panel, { 1.28077 + 1.28078 + 1.28079 + 1.28080 + 1.28081 + 1.28082 + baseCls:'x-fieldset', 1.28083 + 1.28084 + layout: 'form', 1.28085 + 1.28086 + 1.28087 + onRender : function(ct, position){ 1.28088 + if(!this.el){ 1.28089 + this.el = document.createElement('fieldset'); 1.28090 + this.el.id = this.id; 1.28091 + if (this.title || this.header || this.checkboxToggle) { 1.28092 + this.el.appendChild(document.createElement('legend')).className = 'x-fieldset-header'; 1.28093 + } 1.28094 + } 1.28095 + 1.28096 + Ext.form.FieldSet.superclass.onRender.call(this, ct, position); 1.28097 + 1.28098 + if(this.checkboxToggle){ 1.28099 + var o = typeof this.checkboxToggle == 'object' ? 1.28100 + this.checkboxToggle : 1.28101 + {tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'}; 1.28102 + this.checkbox = this.header.insertFirst(o); 1.28103 + this.checkbox.dom.checked = !this.collapsed; 1.28104 + this.checkbox.on('click', this.onCheckClick, this); 1.28105 + } 1.28106 + }, 1.28107 + 1.28108 + 1.28109 + onCollapse : function(doAnim, animArg){ 1.28110 + if(this.checkbox){ 1.28111 + this.checkbox.dom.checked = false; 1.28112 + } 1.28113 + this.afterCollapse(); 1.28114 + 1.28115 + }, 1.28116 + 1.28117 + 1.28118 + onExpand : function(doAnim, animArg){ 1.28119 + if(this.checkbox){ 1.28120 + this.checkbox.dom.checked = true; 1.28121 + } 1.28122 + this.afterExpand(); 1.28123 + }, 1.28124 + 1.28125 + 1.28126 + onCheckClick : function(){ 1.28127 + this[this.checkbox.dom.checked ? 'expand' : 'collapse'](); 1.28128 + } 1.28129 + 1.28130 + 1.28131 + 1.28132 + 1.28133 + 1.28134 + 1.28135 + 1.28136 + 1.28137 + 1.28138 + 1.28139 + 1.28140 + 1.28141 + 1.28142 + 1.28143 + 1.28144 + 1.28145 + 1.28146 + 1.28147 + 1.28148 + 1.28149 + 1.28150 + 1.28151 + 1.28152 + 1.28153 + 1.28154 + 1.28155 + 1.28156 + 1.28157 + 1.28158 + 1.28159 + 1.28160 + 1.28161 + 1.28162 + 1.28163 + 1.28164 + 1.28165 + 1.28166 + 1.28167 +}); 1.28168 +Ext.reg('fieldset', Ext.form.FieldSet); 1.28169 + 1.28170 + 1.28171 + 1.28172 + 1.28173 +Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, { 1.28174 + 1.28175 + enableFormat : true, 1.28176 + 1.28177 + enableFontSize : true, 1.28178 + 1.28179 + enableColors : true, 1.28180 + 1.28181 + enableAlignments : true, 1.28182 + 1.28183 + enableLists : true, 1.28184 + 1.28185 + enableSourceEdit : true, 1.28186 + 1.28187 + enableLinks : true, 1.28188 + 1.28189 + enableFont : true, 1.28190 + 1.28191 + createLinkText : 'Please enter the URL for the link:', 1.28192 + 1.28193 + defaultLinkValue : 'http:/'+'/', 1.28194 + 1.28195 + fontFamilies : [ 1.28196 + 'Arial', 1.28197 + 'Courier New', 1.28198 + 'Tahoma', 1.28199 + 'Times New Roman', 1.28200 + 'Verdana' 1.28201 + ], 1.28202 + defaultFont: 'tahoma', 1.28203 + 1.28204 + 1.28205 + validationEvent : false, 1.28206 + deferHeight: true, 1.28207 + initialized : false, 1.28208 + activated : false, 1.28209 + sourceEditMode : false, 1.28210 + onFocus : Ext.emptyFn, 1.28211 + iframePad:3, 1.28212 + hideMode:'offsets', 1.28213 + defaultAutoCreate : { 1.28214 + tag: "textarea", 1.28215 + style:"width:500px;height:300px;", 1.28216 + autocomplete: "off" 1.28217 + }, 1.28218 + 1.28219 + 1.28220 + initComponent : function(){ 1.28221 + this.addEvents( 1.28222 + 1.28223 + 'initialize', 1.28224 + 1.28225 + 'activate', 1.28226 + 1.28227 + 'beforesync', 1.28228 + 1.28229 + 'beforepush', 1.28230 + 1.28231 + 'sync', 1.28232 + 1.28233 + 'push', 1.28234 + 1.28235 + 'editmodechange' 1.28236 + ) 1.28237 + }, 1.28238 + 1.28239 + 1.28240 + createFontOptions : function(){ 1.28241 + var buf = [], fs = this.fontFamilies, ff, lc; 1.28242 + for(var i = 0, len = fs.length; i< len; i++){ 1.28243 + ff = fs[i]; 1.28244 + lc = ff.toLowerCase(); 1.28245 + buf.push( 1.28246 + '<option value="',lc,'" style="font-family:',ff,';"', 1.28247 + (this.defaultFont == lc ? ' selected="true">' : '>'), 1.28248 + ff, 1.28249 + '</option>' 1.28250 + ); 1.28251 + } 1.28252 + return buf.join(''); 1.28253 + }, 1.28254 + 1.28255 + 1.28256 + createToolbar : function(editor){ 1.28257 + 1.28258 + var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled(); 1.28259 + 1.28260 + function btn(id, toggle, handler){ 1.28261 + return { 1.28262 + itemId : id, 1.28263 + cls : 'x-btn-icon x-edit-'+id, 1.28264 + enableToggle:toggle !== false, 1.28265 + scope: editor, 1.28266 + handler:handler||editor.relayBtnCmd, 1.28267 + clickEvent:'mousedown', 1.28268 + tooltip: tipsEnabled ? editor.buttonTips[id] || undefined : undefined, 1.28269 + tabIndex:-1 1.28270 + }; 1.28271 + } 1.28272 + 1.28273 + 1.28274 + var tb = new Ext.Toolbar({ 1.28275 + renderTo:this.wrap.dom.firstChild 1.28276 + }); 1.28277 + 1.28278 + 1.28279 + tb.el.on('click', function(e){ 1.28280 + e.preventDefault(); 1.28281 + }); 1.28282 + 1.28283 + if(this.enableFont && !Ext.isSafari){ 1.28284 + this.fontSelect = tb.el.createChild({ 1.28285 + tag:'select', 1.28286 + cls:'x-font-select', 1.28287 + html: this.createFontOptions() 1.28288 + }); 1.28289 + this.fontSelect.on('change', function(){ 1.28290 + var font = this.fontSelect.dom.value; 1.28291 + this.relayCmd('fontname', font); 1.28292 + this.deferFocus(); 1.28293 + }, this); 1.28294 + tb.add( 1.28295 + this.fontSelect.dom, 1.28296 + '-' 1.28297 + ); 1.28298 + }; 1.28299 + 1.28300 + if(this.enableFormat){ 1.28301 + tb.add( 1.28302 + btn('bold'), 1.28303 + btn('italic'), 1.28304 + btn('underline') 1.28305 + ); 1.28306 + }; 1.28307 + 1.28308 + if(this.enableFontSize){ 1.28309 + tb.add( 1.28310 + '-', 1.28311 + btn('increasefontsize', false, this.adjustFont), 1.28312 + btn('decreasefontsize', false, this.adjustFont) 1.28313 + ); 1.28314 + }; 1.28315 + 1.28316 + if(this.enableColors){ 1.28317 + tb.add( 1.28318 + '-', { 1.28319 + itemId:'forecolor', 1.28320 + cls:'x-btn-icon x-edit-forecolor', 1.28321 + clickEvent:'mousedown', 1.28322 + tooltip: tipsEnabled ? editor.buttonTips['forecolor'] || undefined : undefined, 1.28323 + tabIndex:-1, 1.28324 + menu : new Ext.menu.ColorMenu({ 1.28325 + allowReselect: true, 1.28326 + focus: Ext.emptyFn, 1.28327 + value:'000000', 1.28328 + plain:true, 1.28329 + selectHandler: function(cp, color){ 1.28330 + this.execCmd('forecolor', Ext.isSafari || Ext.isIE ? '#'+color : color); 1.28331 + this.deferFocus(); 1.28332 + }, 1.28333 + scope: this, 1.28334 + clickEvent:'mousedown' 1.28335 + }) 1.28336 + }, { 1.28337 + itemId:'backcolor', 1.28338 + cls:'x-btn-icon x-edit-backcolor', 1.28339 + clickEvent:'mousedown', 1.28340 + tooltip: tipsEnabled ? editor.buttonTips['backcolor'] || undefined : undefined, 1.28341 + tabIndex:-1, 1.28342 + menu : new Ext.menu.ColorMenu({ 1.28343 + focus: Ext.emptyFn, 1.28344 + value:'FFFFFF', 1.28345 + plain:true, 1.28346 + allowReselect: true, 1.28347 + selectHandler: function(cp, color){ 1.28348 + if(Ext.isGecko){ 1.28349 + this.execCmd('useCSS', false); 1.28350 + this.execCmd('hilitecolor', color); 1.28351 + this.execCmd('useCSS', true); 1.28352 + this.deferFocus(); 1.28353 + }else{ 1.28354 + this.execCmd(Ext.isOpera ? 'hilitecolor' : 'backcolor', Ext.isSafari || Ext.isIE ? '#'+color : color); 1.28355 + this.deferFocus(); 1.28356 + } 1.28357 + }, 1.28358 + scope:this, 1.28359 + clickEvent:'mousedown' 1.28360 + }) 1.28361 + } 1.28362 + ); 1.28363 + }; 1.28364 + 1.28365 + if(this.enableAlignments){ 1.28366 + tb.add( 1.28367 + '-', 1.28368 + btn('justifyleft'), 1.28369 + btn('justifycenter'), 1.28370 + btn('justifyright') 1.28371 + ); 1.28372 + }; 1.28373 + 1.28374 + if(!Ext.isSafari){ 1.28375 + if(this.enableLinks){ 1.28376 + tb.add( 1.28377 + '-', 1.28378 + btn('createlink', false, this.createLink) 1.28379 + ); 1.28380 + }; 1.28381 + 1.28382 + if(this.enableLists){ 1.28383 + tb.add( 1.28384 + '-', 1.28385 + btn('insertorderedlist'), 1.28386 + btn('insertunorderedlist') 1.28387 + ); 1.28388 + } 1.28389 + if(this.enableSourceEdit){ 1.28390 + tb.add( 1.28391 + '-', 1.28392 + btn('sourceedit', true, function(btn){ 1.28393 + this.toggleSourceEdit(btn.pressed); 1.28394 + }) 1.28395 + ); 1.28396 + } 1.28397 + } 1.28398 + 1.28399 + this.tb = tb; 1.28400 + }, 1.28401 + 1.28402 + 1.28403 + getDocMarkup : function(){ 1.28404 + return '<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>'; 1.28405 + }, 1.28406 + 1.28407 + 1.28408 + getEditorBody : function(){ 1.28409 + return this.doc.body || this.doc.documentElement; 1.28410 + }, 1.28411 + 1.28412 + 1.28413 + onRender : function(ct, position){ 1.28414 + Ext.form.HtmlEditor.superclass.onRender.call(this, ct, position); 1.28415 + this.el.dom.style.border = '0 none'; 1.28416 + this.el.dom.setAttribute('tabIndex', -1); 1.28417 + this.el.addClass('x-hidden'); 1.28418 + if(Ext.isIE){ 1.28419 + this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;') 1.28420 + } 1.28421 + this.wrap = this.el.wrap({ 1.28422 + cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'} 1.28423 + }); 1.28424 + 1.28425 + this.createToolbar(this); 1.28426 + 1.28427 + this.tb.items.each(function(item){ 1.28428 + if(item.itemId != 'sourceedit'){ 1.28429 + item.disable(); 1.28430 + } 1.28431 + }); 1.28432 + 1.28433 + var iframe = document.createElement('iframe'); 1.28434 + iframe.name = Ext.id(); 1.28435 + iframe.frameBorder = 'no'; 1.28436 + 1.28437 + iframe.src=(Ext.SSL_SECURE_URL || "javascript:false"); 1.28438 + 1.28439 + this.wrap.dom.appendChild(iframe); 1.28440 + 1.28441 + this.iframe = iframe; 1.28442 + 1.28443 + if(Ext.isIE){ 1.28444 + iframe.contentWindow.document.designMode = 'on'; 1.28445 + this.doc = iframe.contentWindow.document; 1.28446 + this.win = iframe.contentWindow; 1.28447 + } else { 1.28448 + this.doc = (iframe.contentDocument || window.frames[iframe.name].document); 1.28449 + this.win = window.frames[iframe.name]; 1.28450 + this.doc.designMode = 'on'; 1.28451 + } 1.28452 + this.doc.open(); 1.28453 + this.doc.write(this.getDocMarkup()) 1.28454 + this.doc.close(); 1.28455 + 1.28456 + var task = { 1.28457 + run : function(){ 1.28458 + if(this.doc.body || this.doc.readyState == 'complete'){ 1.28459 + Ext.TaskMgr.stop(task); 1.28460 + this.doc.designMode="on"; 1.28461 + this.initEditor.defer(10, this); 1.28462 + } 1.28463 + }, 1.28464 + interval : 10, 1.28465 + duration:10000, 1.28466 + scope: this 1.28467 + }; 1.28468 + Ext.TaskMgr.start(task); 1.28469 + 1.28470 + if(!this.width){ 1.28471 + this.setSize(this.el.getSize()); 1.28472 + } 1.28473 + }, 1.28474 + 1.28475 + 1.28476 + onResize : function(w, h){ 1.28477 + Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments); 1.28478 + if(this.el && this.iframe){ 1.28479 + if(typeof w == 'number'){ 1.28480 + var aw = w - this.wrap.getFrameWidth('lr'); 1.28481 + this.el.setWidth(this.adjustWidth('textarea', aw)); 1.28482 + this.iframe.style.width = aw + 'px'; 1.28483 + } 1.28484 + if(typeof h == 'number'){ 1.28485 + var ah = h - this.wrap.getFrameWidth('tb') - this.tb.el.getHeight(); 1.28486 + this.el.setHeight(this.adjustWidth('textarea', ah)); 1.28487 + this.iframe.style.height = ah + 'px'; 1.28488 + if(this.doc){ 1.28489 + this.getEditorBody().style.height = (ah - (this.iframePad*2)) + 'px'; 1.28490 + } 1.28491 + } 1.28492 + } 1.28493 + }, 1.28494 + 1.28495 + 1.28496 + toggleSourceEdit : function(sourceEditMode){ 1.28497 + if(sourceEditMode === undefined){ 1.28498 + sourceEditMode = !this.sourceEditMode; 1.28499 + } 1.28500 + this.sourceEditMode = sourceEditMode === true; 1.28501 + var btn = this.tb.items.get('sourceedit'); 1.28502 + if(btn.pressed !== this.sourceEditMode){ 1.28503 + btn.toggle(this.sourceEditMode); 1.28504 + return; 1.28505 + } 1.28506 + if(this.sourceEditMode){ 1.28507 + this.tb.items.each(function(item){ 1.28508 + if(item.itemId != 'sourceedit'){ 1.28509 + item.disable(); 1.28510 + } 1.28511 + }); 1.28512 + this.syncValue(); 1.28513 + this.iframe.className = 'x-hidden'; 1.28514 + this.el.removeClass('x-hidden'); 1.28515 + this.el.dom.removeAttribute('tabIndex'); 1.28516 + this.el.focus(); 1.28517 + }else{ 1.28518 + if(this.initialized){ 1.28519 + this.tb.items.each(function(item){ 1.28520 + item.enable(); 1.28521 + }); 1.28522 + } 1.28523 + this.pushValue(); 1.28524 + this.iframe.className = ''; 1.28525 + this.el.addClass('x-hidden'); 1.28526 + this.el.dom.setAttribute('tabIndex', -1); 1.28527 + this.deferFocus(); 1.28528 + } 1.28529 + var lastSize = this.lastSize; 1.28530 + if(lastSize){ 1.28531 + delete this.lastSize; 1.28532 + this.setSize(lastSize); 1.28533 + } 1.28534 + this.fireEvent('editmodechange', this, this.sourceEditMode); 1.28535 + }, 1.28536 + 1.28537 + 1.28538 + createLink : function(){ 1.28539 + var url = prompt(this.createLinkText, this.defaultLinkValue); 1.28540 + if(url && url != 'http:/'+'/'){ 1.28541 + this.relayCmd('createlink', url); 1.28542 + } 1.28543 + }, 1.28544 + 1.28545 + 1.28546 + adjustSize : Ext.BoxComponent.prototype.adjustSize, 1.28547 + 1.28548 + 1.28549 + getResizeEl : function(){ 1.28550 + return this.wrap; 1.28551 + }, 1.28552 + 1.28553 + 1.28554 + getPositionEl : function(){ 1.28555 + return this.wrap; 1.28556 + }, 1.28557 + 1.28558 + 1.28559 + initEvents : function(){ 1.28560 + this.originalValue = this.getValue(); 1.28561 + }, 1.28562 + 1.28563 + 1.28564 + markInvalid : Ext.emptyFn, 1.28565 + 1.28566 + 1.28567 + clearInvalid : Ext.emptyFn, 1.28568 + 1.28569 + 1.28570 + setValue : function(v){ 1.28571 + Ext.form.HtmlEditor.superclass.setValue.call(this, v); 1.28572 + this.pushValue(); 1.28573 + }, 1.28574 + 1.28575 + 1.28576 + cleanHtml : function(html){ 1.28577 + html = String(html); 1.28578 + if(html.length > 5){ 1.28579 + if(Ext.isSafari){ 1.28580 + html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, ''); 1.28581 + } 1.28582 + } 1.28583 + if(html == ' '){ 1.28584 + html = ''; 1.28585 + } 1.28586 + return html; 1.28587 + }, 1.28588 + 1.28589 + 1.28590 + syncValue : function(){ 1.28591 + if(this.initialized){ 1.28592 + var bd = this.getEditorBody(); 1.28593 + var html = bd.innerHTML; 1.28594 + if(Ext.isSafari){ 1.28595 + var bs = bd.getAttribute('style'); 1.28596 + var m = bs.match(/text-align:(.*?);/i); 1.28597 + if(m && m[1]){ 1.28598 + html = '<div style="'+m[0]+'">' + html + '</div>'; 1.28599 + } 1.28600 + } 1.28601 + html = this.cleanHtml(html); 1.28602 + if(this.fireEvent('beforesync', this, html) !== false){ 1.28603 + this.el.dom.value = html; 1.28604 + this.fireEvent('sync', this, html); 1.28605 + } 1.28606 + } 1.28607 + }, 1.28608 + 1.28609 + 1.28610 + pushValue : function(){ 1.28611 + if(this.initialized){ 1.28612 + var v = this.el.dom.value; 1.28613 + if(!this.activated && v.length < 1){ 1.28614 + v = ' '; 1.28615 + } 1.28616 + if(this.fireEvent('beforepush', this, v) !== false){ 1.28617 + this.getEditorBody().innerHTML = v; 1.28618 + this.fireEvent('push', this, v); 1.28619 + } 1.28620 + } 1.28621 + }, 1.28622 + 1.28623 + 1.28624 + deferFocus : function(){ 1.28625 + this.focus.defer(10, this); 1.28626 + }, 1.28627 + 1.28628 + 1.28629 + focus : function(){ 1.28630 + if(this.win && !this.sourceEditMode){ 1.28631 + this.win.focus(); 1.28632 + }else{ 1.28633 + this.el.focus(); 1.28634 + } 1.28635 + }, 1.28636 + 1.28637 + 1.28638 + initEditor : function(){ 1.28639 + var dbody = this.getEditorBody(); 1.28640 + var ss = this.el.getStyles('font-size', 'font-family', 'background-image', 'background-repeat'); 1.28641 + ss['background-attachment'] = 'fixed'; 1.28642 + dbody.bgProperties = 'fixed'; 1.28643 + Ext.DomHelper.applyStyles(dbody, ss); 1.28644 + Ext.EventManager.on(this.doc, { 1.28645 + 'mousedown': this.onEditorEvent, 1.28646 + 'dblclick': this.onEditorEvent, 1.28647 + 'click': this.onEditorEvent, 1.28648 + 'keyup': this.onEditorEvent, 1.28649 + buffer:100, 1.28650 + scope: this 1.28651 + }); 1.28652 + if(Ext.isGecko){ 1.28653 + Ext.EventManager.on(this.doc, 'keypress', this.applyCommand, this); 1.28654 + } 1.28655 + if(Ext.isIE || Ext.isSafari || Ext.isOpera){ 1.28656 + Ext.EventManager.on(this.doc, 'keydown', this.fixKeys, this); 1.28657 + } 1.28658 + this.initialized = true; 1.28659 + 1.28660 + this.fireEvent('initialize', this); 1.28661 + this.pushValue(); 1.28662 + }, 1.28663 + 1.28664 + 1.28665 + onDestroy : function(){ 1.28666 + if(this.rendered){ 1.28667 + this.tb.items.each(function(item){ 1.28668 + if(item.menu){ 1.28669 + item.menu.removeAll(); 1.28670 + if(item.menu.el){ 1.28671 + item.menu.el.destroy(); 1.28672 + } 1.28673 + } 1.28674 + item.destroy(); 1.28675 + }); 1.28676 + this.wrap.dom.innerHTML = ''; 1.28677 + this.wrap.remove(); 1.28678 + } 1.28679 + }, 1.28680 + 1.28681 + 1.28682 + onFirstFocus : function(){ 1.28683 + this.activated = true; 1.28684 + this.tb.items.each(function(item){ 1.28685 + item.enable(); 1.28686 + }); 1.28687 + if(Ext.isGecko){ 1.28688 + this.win.focus(); 1.28689 + var s = this.win.getSelection(); 1.28690 + if(!s.focusNode || s.focusNode.nodeType != 3){ 1.28691 + var r = s.getRangeAt(0); 1.28692 + r.selectNodeContents(this.getEditorBody()); 1.28693 + r.collapse(true); 1.28694 + this.deferFocus(); 1.28695 + } 1.28696 + try{ 1.28697 + this.execCmd('useCSS', true); 1.28698 + this.execCmd('styleWithCSS', false); 1.28699 + }catch(e){} 1.28700 + } 1.28701 + this.fireEvent('activate', this); 1.28702 + }, 1.28703 + 1.28704 + 1.28705 + adjustFont: function(btn){ 1.28706 + var adjust = btn.itemId == 'increasefontsize' ? 1 : -1; 1.28707 + 1.28708 + var v = parseInt(this.doc.queryCommandValue('FontSize') || 2, 10); 1.28709 + if(Ext.isSafari3 || Ext.isAir){ 1.28710 + 1.28711 + 1.28712 + if(v <= 10){ 1.28713 + v = 1 + adjust; 1.28714 + }else if(v <= 13){ 1.28715 + v = 2 + adjust; 1.28716 + }else if(v <= 16){ 1.28717 + v = 3 + adjust; 1.28718 + }else if(v <= 18){ 1.28719 + v = 4 + adjust; 1.28720 + }else if(v <= 24){ 1.28721 + v = 5 + adjust; 1.28722 + }else { 1.28723 + v = 6 + adjust; 1.28724 + } 1.28725 + v = v.constrain(1, 6); 1.28726 + }else{ 1.28727 + if(Ext.isSafari){ 1.28728 + adjust *= 2; 1.28729 + } 1.28730 + v = Math.max(1, v+adjust) + (Ext.isSafari ? 'px' : 0); 1.28731 + } 1.28732 + this.execCmd('FontSize', v); 1.28733 + }, 1.28734 + 1.28735 + 1.28736 + onEditorEvent : function(e){ 1.28737 + this.updateToolbar(); 1.28738 + }, 1.28739 + 1.28740 + 1.28741 + 1.28742 + updateToolbar: function(){ 1.28743 + 1.28744 + if(!this.activated){ 1.28745 + this.onFirstFocus(); 1.28746 + return; 1.28747 + } 1.28748 + 1.28749 + var btns = this.tb.items.map, doc = this.doc; 1.28750 + 1.28751 + if(this.enableFont && !Ext.isSafari){ 1.28752 + var name = (this.doc.queryCommandValue('FontName')||this.defaultFont).toLowerCase(); 1.28753 + if(name != this.fontSelect.dom.value){ 1.28754 + this.fontSelect.dom.value = name; 1.28755 + } 1.28756 + } 1.28757 + if(this.enableFormat){ 1.28758 + btns.bold.toggle(doc.queryCommandState('bold')); 1.28759 + btns.italic.toggle(doc.queryCommandState('italic')); 1.28760 + btns.underline.toggle(doc.queryCommandState('underline')); 1.28761 + } 1.28762 + if(this.enableAlignments){ 1.28763 + btns.justifyleft.toggle(doc.queryCommandState('justifyleft')); 1.28764 + btns.justifycenter.toggle(doc.queryCommandState('justifycenter')); 1.28765 + btns.justifyright.toggle(doc.queryCommandState('justifyright')); 1.28766 + } 1.28767 + if(!Ext.isSafari && this.enableLists){ 1.28768 + btns.insertorderedlist.toggle(doc.queryCommandState('insertorderedlist')); 1.28769 + btns.insertunorderedlist.toggle(doc.queryCommandState('insertunorderedlist')); 1.28770 + } 1.28771 + 1.28772 + Ext.menu.MenuMgr.hideAll(); 1.28773 + 1.28774 + this.syncValue(); 1.28775 + }, 1.28776 + 1.28777 + 1.28778 + relayBtnCmd : function(btn){ 1.28779 + this.relayCmd(btn.itemId); 1.28780 + }, 1.28781 + 1.28782 + 1.28783 + relayCmd : function(cmd, value){ 1.28784 + this.win.focus(); 1.28785 + this.execCmd(cmd, value); 1.28786 + this.updateToolbar(); 1.28787 + this.deferFocus(); 1.28788 + }, 1.28789 + 1.28790 + 1.28791 + execCmd : function(cmd, value){ 1.28792 + this.doc.execCommand(cmd, false, value === undefined ? null : value); 1.28793 + this.syncValue(); 1.28794 + }, 1.28795 + 1.28796 + 1.28797 + applyCommand : function(e){ 1.28798 + if(e.ctrlKey){ 1.28799 + var c = e.getCharCode(), cmd; 1.28800 + if(c > 0){ 1.28801 + c = String.fromCharCode(c); 1.28802 + switch(c){ 1.28803 + case 'b': 1.28804 + cmd = 'bold'; 1.28805 + break; 1.28806 + case 'i': 1.28807 + cmd = 'italic'; 1.28808 + break; 1.28809 + case 'u': 1.28810 + cmd = 'underline'; 1.28811 + break; 1.28812 + } 1.28813 + if(cmd){ 1.28814 + this.win.focus(); 1.28815 + this.execCmd(cmd); 1.28816 + this.deferFocus(); 1.28817 + e.preventDefault(); 1.28818 + } 1.28819 + } 1.28820 + } 1.28821 + }, 1.28822 + 1.28823 + 1.28824 + insertAtCursor : function(text){ 1.28825 + if(!this.activated){ 1.28826 + return; 1.28827 + } 1.28828 + if(Ext.isIE){ 1.28829 + this.win.focus(); 1.28830 + var r = this.doc.selection.createRange(); 1.28831 + if(r){ 1.28832 + r.collapse(true); 1.28833 + r.pasteHTML(text); 1.28834 + this.syncValue(); 1.28835 + this.deferFocus(); 1.28836 + } 1.28837 + }else if(Ext.isGecko || Ext.isOpera){ 1.28838 + this.win.focus(); 1.28839 + this.execCmd('InsertHTML', text); 1.28840 + this.deferFocus(); 1.28841 + }else if(Ext.isSafari){ 1.28842 + this.execCmd('InsertText', text); 1.28843 + this.deferFocus(); 1.28844 + } 1.28845 + }, 1.28846 + 1.28847 + 1.28848 + fixKeys : function(){ 1.28849 + if(Ext.isIE){ 1.28850 + return function(e){ 1.28851 + var k = e.getKey(), r; 1.28852 + if(k == e.TAB){ 1.28853 + e.stopEvent(); 1.28854 + r = this.doc.selection.createRange(); 1.28855 + if(r){ 1.28856 + r.collapse(true); 1.28857 + r.pasteHTML(' '); 1.28858 + this.deferFocus(); 1.28859 + } 1.28860 + }else if(k == e.ENTER){ 1.28861 + r = this.doc.selection.createRange(); 1.28862 + if(r){ 1.28863 + var target = r.parentElement(); 1.28864 + if(!target || target.tagName.toLowerCase() != 'li'){ 1.28865 + e.stopEvent(); 1.28866 + r.pasteHTML('<br />'); 1.28867 + r.collapse(false); 1.28868 + r.select(); 1.28869 + } 1.28870 + } 1.28871 + } 1.28872 + }; 1.28873 + }else if(Ext.isOpera){ 1.28874 + return function(e){ 1.28875 + var k = e.getKey(); 1.28876 + if(k == e.TAB){ 1.28877 + e.stopEvent(); 1.28878 + this.win.focus(); 1.28879 + this.execCmd('InsertHTML',' '); 1.28880 + this.deferFocus(); 1.28881 + } 1.28882 + }; 1.28883 + }else if(Ext.isSafari){ 1.28884 + return function(e){ 1.28885 + var k = e.getKey(); 1.28886 + if(k == e.TAB){ 1.28887 + e.stopEvent(); 1.28888 + this.execCmd('InsertText','\t'); 1.28889 + this.deferFocus(); 1.28890 + } 1.28891 + }; 1.28892 + } 1.28893 + }(), 1.28894 + 1.28895 + 1.28896 + getToolbar : function(){ 1.28897 + return this.tb; 1.28898 + }, 1.28899 + 1.28900 + 1.28901 + buttonTips : { 1.28902 + bold : { 1.28903 + title: 'Bold (Ctrl+B)', 1.28904 + text: 'Make the selected text bold.', 1.28905 + cls: 'x-html-editor-tip' 1.28906 + }, 1.28907 + italic : { 1.28908 + title: 'Italic (Ctrl+I)', 1.28909 + text: 'Make the selected text italic.', 1.28910 + cls: 'x-html-editor-tip' 1.28911 + }, 1.28912 + underline : { 1.28913 + title: 'Underline (Ctrl+U)', 1.28914 + text: 'Underline the selected text.', 1.28915 + cls: 'x-html-editor-tip' 1.28916 + }, 1.28917 + increasefontsize : { 1.28918 + title: 'Grow Text', 1.28919 + text: 'Increase the font size.', 1.28920 + cls: 'x-html-editor-tip' 1.28921 + }, 1.28922 + decreasefontsize : { 1.28923 + title: 'Shrink Text', 1.28924 + text: 'Decrease the font size.', 1.28925 + cls: 'x-html-editor-tip' 1.28926 + }, 1.28927 + backcolor : { 1.28928 + title: 'Text Highlight Color', 1.28929 + text: 'Change the background color of the selected text.', 1.28930 + cls: 'x-html-editor-tip' 1.28931 + }, 1.28932 + forecolor : { 1.28933 + title: 'Font Color', 1.28934 + text: 'Change the color of the selected text.', 1.28935 + cls: 'x-html-editor-tip' 1.28936 + }, 1.28937 + justifyleft : { 1.28938 + title: 'Align Text Left', 1.28939 + text: 'Align text to the left.', 1.28940 + cls: 'x-html-editor-tip' 1.28941 + }, 1.28942 + justifycenter : { 1.28943 + title: 'Center Text', 1.28944 + text: 'Center text in the editor.', 1.28945 + cls: 'x-html-editor-tip' 1.28946 + }, 1.28947 + justifyright : { 1.28948 + title: 'Align Text Right', 1.28949 + text: 'Align text to the right.', 1.28950 + cls: 'x-html-editor-tip' 1.28951 + }, 1.28952 + insertunorderedlist : { 1.28953 + title: 'Bullet List', 1.28954 + text: 'Start a bulleted list.', 1.28955 + cls: 'x-html-editor-tip' 1.28956 + }, 1.28957 + insertorderedlist : { 1.28958 + title: 'Numbered List', 1.28959 + text: 'Start a numbered list.', 1.28960 + cls: 'x-html-editor-tip' 1.28961 + }, 1.28962 + createlink : { 1.28963 + title: 'Hyperlink', 1.28964 + text: 'Make the selected text a hyperlink.', 1.28965 + cls: 'x-html-editor-tip' 1.28966 + }, 1.28967 + sourceedit : { 1.28968 + title: 'Source Edit', 1.28969 + text: 'Switch to source editing mode.', 1.28970 + cls: 'x-html-editor-tip' 1.28971 + } 1.28972 + } 1.28973 + 1.28974 + 1.28975 + 1.28976 + 1.28977 + 1.28978 + 1.28979 + 1.28980 + 1.28981 + 1.28982 + 1.28983 + 1.28984 + 1.28985 + 1.28986 + 1.28987 + 1.28988 + 1.28989 + 1.28990 + 1.28991 + 1.28992 + 1.28993 + 1.28994 + 1.28995 + 1.28996 + 1.28997 + 1.28998 + 1.28999 + 1.29000 + 1.29001 + 1.29002 + 1.29003 + 1.29004 + 1.29005 + 1.29006 + 1.29007 + 1.29008 +}); 1.29009 +Ext.reg('htmleditor', Ext.form.HtmlEditor); 1.29010 + 1.29011 +Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, { 1.29012 + 1.29013 + minValue : null, 1.29014 + 1.29015 + maxValue : null, 1.29016 + 1.29017 + minText : "The time in this field must be equal to or after {0}", 1.29018 + 1.29019 + maxText : "The time in this field must be equal to or before {0}", 1.29020 + 1.29021 + invalidText : "{0} is not a valid time", 1.29022 + 1.29023 + format : "g:i A", 1.29024 + 1.29025 + altFormats : "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H", 1.29026 + 1.29027 + increment: 15, 1.29028 + 1.29029 + 1.29030 + mode: 'local', 1.29031 + 1.29032 + triggerAction: 'all', 1.29033 + 1.29034 + typeAhead: false, 1.29035 + 1.29036 + 1.29037 + initComponent : function(){ 1.29038 + Ext.form.TimeField.superclass.initComponent.call(this); 1.29039 + 1.29040 + if(typeof this.minValue == "string"){ 1.29041 + this.minValue = this.parseDate(this.minValue); 1.29042 + } 1.29043 + if(typeof this.maxValue == "string"){ 1.29044 + this.maxValue = this.parseDate(this.maxValue); 1.29045 + } 1.29046 + 1.29047 + if(!this.store){ 1.29048 + var min = this.parseDate(this.minValue); 1.29049 + if(!min){ 1.29050 + min = new Date().clearTime(); 1.29051 + } 1.29052 + var max = this.parseDate(this.maxValue); 1.29053 + if(!max){ 1.29054 + max = new Date().clearTime().add('mi', (24 * 60) - 1); 1.29055 + } 1.29056 + var times = []; 1.29057 + while(min <= max){ 1.29058 + times.push([min.dateFormat(this.format)]); 1.29059 + min = min.add('mi', this.increment); 1.29060 + } 1.29061 + this.store = new Ext.data.SimpleStore({ 1.29062 + fields: ['text'], 1.29063 + data : times 1.29064 + }); 1.29065 + this.displayField = 'text'; 1.29066 + } 1.29067 + }, 1.29068 + 1.29069 + 1.29070 + getValue : function(){ 1.29071 + var v = Ext.form.TimeField.superclass.getValue.call(this); 1.29072 + return this.formatDate(this.parseDate(v)) || ''; 1.29073 + }, 1.29074 + 1.29075 + 1.29076 + setValue : function(value){ 1.29077 + Ext.form.TimeField.superclass.setValue.call(this, this.formatDate(this.parseDate(value))); 1.29078 + }, 1.29079 + 1.29080 + 1.29081 + validateValue : Ext.form.DateField.prototype.validateValue, 1.29082 + parseDate : Ext.form.DateField.prototype.parseDate, 1.29083 + formatDate : Ext.form.DateField.prototype.formatDate, 1.29084 + 1.29085 + 1.29086 + beforeBlur : function(){ 1.29087 + var v = this.parseDate(this.getRawValue()); 1.29088 + if(v){ 1.29089 + this.setValue(v.dateFormat(this.format)); 1.29090 + } 1.29091 + } 1.29092 + 1.29093 + 1.29094 + 1.29095 + 1.29096 + 1.29097 +}); 1.29098 +Ext.reg('timefield', Ext.form.TimeField); 1.29099 + 1.29100 +Ext.form.Label = Ext.extend(Ext.BoxComponent, { 1.29101 + 1.29102 + 1.29103 + 1.29104 + onRender : function(ct, position){ 1.29105 + if(!this.el){ 1.29106 + this.el = document.createElement('label'); 1.29107 + this.el.id = this.getId(); 1.29108 + this.el.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || ''); 1.29109 + if(this.forId){ 1.29110 + this.el.setAttribute('htmlFor', this.forId); 1.29111 + } 1.29112 + } 1.29113 + Ext.form.Label.superclass.onRender.call(this, ct, position); 1.29114 + } 1.29115 +}); 1.29116 + 1.29117 +Ext.reg('label', Ext.form.Label); 1.29118 + 1.29119 +Ext.form.Action = function(form, options){ 1.29120 + this.form = form; 1.29121 + this.options = options || {}; 1.29122 +}; 1.29123 + 1.29124 + 1.29125 +Ext.form.Action.CLIENT_INVALID = 'client'; 1.29126 + 1.29127 +Ext.form.Action.SERVER_INVALID = 'server'; 1.29128 + 1.29129 +Ext.form.Action.CONNECT_FAILURE = 'connect'; 1.29130 + 1.29131 +Ext.form.Action.LOAD_FAILURE = 'load'; 1.29132 + 1.29133 +Ext.form.Action.prototype = { 1.29134 + 1.29135 + 1.29136 + 1.29137 + 1.29138 + 1.29139 + 1.29140 + 1.29141 + 1.29142 + 1.29143 + 1.29144 + 1.29145 + type : 'default', 1.29146 + 1.29147 + 1.29148 + run : function(options){ 1.29149 + 1.29150 + }, 1.29151 + 1.29152 + success : function(response){ 1.29153 + 1.29154 + }, 1.29155 + 1.29156 + handleResponse : function(response){ 1.29157 + 1.29158 + }, 1.29159 + 1.29160 + failure : function(response){ 1.29161 + this.response = response; 1.29162 + this.failureType = Ext.form.Action.CONNECT_FAILURE; 1.29163 + this.form.afterAction(this, false); 1.29164 + }, 1.29165 + 1.29166 + processResponse : function(response){ 1.29167 + this.response = response; 1.29168 + if(!response.responseText){ 1.29169 + return true; 1.29170 + } 1.29171 + this.result = this.handleResponse(response); 1.29172 + return this.result; 1.29173 + }, 1.29174 + 1.29175 + getUrl : function(appendParams){ 1.29176 + var url = this.options.url || this.form.url || this.form.el.dom.action; 1.29177 + if(appendParams){ 1.29178 + var p = this.getParams(); 1.29179 + if(p){ 1.29180 + url += (url.indexOf('?') != -1 ? '&' : '?') + p; 1.29181 + } 1.29182 + } 1.29183 + return url; 1.29184 + }, 1.29185 + 1.29186 + getMethod : function(){ 1.29187 + return (this.options.method || this.form.method || this.form.el.dom.method || 'POST').toUpperCase(); 1.29188 + }, 1.29189 + 1.29190 + getParams : function(){ 1.29191 + var bp = this.form.baseParams; 1.29192 + var p = this.options.params; 1.29193 + if(p){ 1.29194 + if(typeof p == "object"){ 1.29195 + p = Ext.urlEncode(Ext.applyIf(p, bp)); 1.29196 + }else if(typeof p == 'string' && bp){ 1.29197 + p += '&' + Ext.urlEncode(bp); 1.29198 + } 1.29199 + }else if(bp){ 1.29200 + p = Ext.urlEncode(bp); 1.29201 + } 1.29202 + return p; 1.29203 + }, 1.29204 + 1.29205 + createCallback : function(opts){ 1.29206 + var opts = opts || {}; 1.29207 + return { 1.29208 + success: this.success, 1.29209 + failure: this.failure, 1.29210 + scope: this, 1.29211 + timeout: (opts.timeout*1000) || (this.form.timeout*1000), 1.29212 + upload: this.form.fileUpload ? this.success : undefined 1.29213 + }; 1.29214 + } 1.29215 +}; 1.29216 + 1.29217 + 1.29218 +Ext.form.Action.Submit = function(form, options){ 1.29219 + Ext.form.Action.Submit.superclass.constructor.call(this, form, options); 1.29220 +}; 1.29221 + 1.29222 +Ext.extend(Ext.form.Action.Submit, Ext.form.Action, { 1.29223 + 1.29224 + type : 'submit', 1.29225 + 1.29226 + run : function(){ 1.29227 + var o = this.options; 1.29228 + var method = this.getMethod(); 1.29229 + var isGet = method == 'GET'; 1.29230 + if(o.clientValidation === false || this.form.isValid()){ 1.29231 + Ext.Ajax.request(Ext.apply(this.createCallback(o), { 1.29232 + form:this.form.el.dom, 1.29233 + url:this.getUrl(isGet), 1.29234 + method: method, 1.29235 + headers: o.headers, 1.29236 + params:!isGet ? this.getParams() : null, 1.29237 + isUpload: this.form.fileUpload 1.29238 + })); 1.29239 + }else if (o.clientValidation !== false){ this.failureType = Ext.form.Action.CLIENT_INVALID; 1.29240 + this.form.afterAction(this, false); 1.29241 + } 1.29242 + }, 1.29243 + 1.29244 + success : function(response){ 1.29245 + var result = this.processResponse(response); 1.29246 + if(result === true || result.success){ 1.29247 + this.form.afterAction(this, true); 1.29248 + return; 1.29249 + } 1.29250 + if(result.errors){ 1.29251 + this.form.markInvalid(result.errors); 1.29252 + this.failureType = Ext.form.Action.SERVER_INVALID; 1.29253 + } 1.29254 + this.form.afterAction(this, false); 1.29255 + }, 1.29256 + 1.29257 + handleResponse : function(response){ 1.29258 + if(this.form.errorReader){ 1.29259 + var rs = this.form.errorReader.read(response); 1.29260 + var errors = []; 1.29261 + if(rs.records){ 1.29262 + for(var i = 0, len = rs.records.length; i < len; i++) { 1.29263 + var r = rs.records[i]; 1.29264 + errors[i] = r.data; 1.29265 + } 1.29266 + } 1.29267 + if(errors.length < 1){ 1.29268 + errors = null; 1.29269 + } 1.29270 + return { 1.29271 + success : rs.success, 1.29272 + errors : errors 1.29273 + }; 1.29274 + } 1.29275 + return Ext.decode(response.responseText); 1.29276 + } 1.29277 +}); 1.29278 + 1.29279 + 1.29280 + 1.29281 +Ext.form.Action.Load = function(form, options){ 1.29282 + Ext.form.Action.Load.superclass.constructor.call(this, form, options); 1.29283 + this.reader = this.form.reader; 1.29284 +}; 1.29285 + 1.29286 +Ext.extend(Ext.form.Action.Load, Ext.form.Action, { 1.29287 + type : 'load', 1.29288 + 1.29289 + run : function(){ 1.29290 + Ext.Ajax.request(Ext.apply( 1.29291 + this.createCallback(this.options), { 1.29292 + method:this.getMethod(), 1.29293 + url:this.getUrl(false), 1.29294 + headers: this.options.headers, 1.29295 + params:this.getParams() 1.29296 + })); 1.29297 + }, 1.29298 + 1.29299 + success : function(response){ 1.29300 + var result = this.processResponse(response); 1.29301 + if(result === true || !result.success || !result.data){ 1.29302 + this.failureType = Ext.form.Action.LOAD_FAILURE; 1.29303 + this.form.afterAction(this, false); 1.29304 + return; 1.29305 + } 1.29306 + this.form.clearInvalid(); 1.29307 + this.form.setValues(result.data); 1.29308 + this.form.afterAction(this, true); 1.29309 + }, 1.29310 + 1.29311 + handleResponse : function(response){ 1.29312 + if(this.form.reader){ 1.29313 + var rs = this.form.reader.read(response); 1.29314 + var data = rs.records && rs.records[0] ? rs.records[0].data : null; 1.29315 + return { 1.29316 + success : rs.success, 1.29317 + data : data 1.29318 + }; 1.29319 + } 1.29320 + return Ext.decode(response.responseText); 1.29321 + } 1.29322 +}); 1.29323 + 1.29324 +Ext.form.Action.ACTION_TYPES = { 1.29325 + 'load' : Ext.form.Action.Load, 1.29326 + 'submit' : Ext.form.Action.Submit 1.29327 +}; 1.29328 + 1.29329 + 1.29330 +Ext.form.VTypes = function(){ 1.29331 + var alpha = /^[a-zA-Z_]+$/; 1.29332 + var alphanum = /^[a-zA-Z0-9_]+$/; 1.29333 + var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/; 1.29334 + var url = /(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; 1.29335 + 1.29336 + return { 1.29337 + 1.29338 + 'email' : function(v){ 1.29339 + return email.test(v); 1.29340 + }, 1.29341 + 1.29342 + 'emailText' : 'This field should be an e-mail address in the format "user@domain.com"', 1.29343 + 1.29344 + 'emailMask' : /[a-z0-9_\.\-@]/i, 1.29345 + 1.29346 + 1.29347 + 'url' : function(v){ 1.29348 + return url.test(v); 1.29349 + }, 1.29350 + 1.29351 + 'urlText' : 'This field should be a URL in the format "http:/'+'/www.domain.com"', 1.29352 + 1.29353 + 1.29354 + 'alpha' : function(v){ 1.29355 + return alpha.test(v); 1.29356 + }, 1.29357 + 1.29358 + 'alphaText' : 'This field should only contain letters and _', 1.29359 + 1.29360 + 'alphaMask' : /[a-z_]/i, 1.29361 + 1.29362 + 1.29363 + 'alphanum' : function(v){ 1.29364 + return alphanum.test(v); 1.29365 + }, 1.29366 + 1.29367 + 'alphanumText' : 'This field should only contain letters, numbers and _', 1.29368 + 1.29369 + 'alphanumMask' : /[a-z0-9_]/i 1.29370 + }; 1.29371 +}(); 1.29372 + 1.29373 +Ext.grid.GridPanel = Ext.extend(Ext.Panel, { 1.29374 + 1.29375 + 1.29376 + 1.29377 + 1.29378 + 1.29379 + 1.29380 + 1.29381 + 1.29382 + 1.29383 + 1.29384 + 1.29385 + 1.29386 + 1.29387 + 1.29388 + ddText : "{0} selected row{1}", 1.29389 + 1.29390 + minColumnWidth : 25, 1.29391 + 1.29392 + trackMouseOver : true, 1.29393 + 1.29394 + enableDragDrop : false, 1.29395 + 1.29396 + enableColumnMove : true, 1.29397 + 1.29398 + enableColumnHide : true, 1.29399 + 1.29400 + enableHdMenu : true, 1.29401 + 1.29402 + stripeRows : false, 1.29403 + 1.29404 + autoExpandColumn : false, 1.29405 + 1.29406 + autoExpandMin : 50, 1.29407 + 1.29408 + autoExpandMax : 1000, 1.29409 + 1.29410 + view : null, 1.29411 + 1.29412 + loadMask : false, 1.29413 + 1.29414 + 1.29415 + rendered : false, 1.29416 + 1.29417 + viewReady: false, 1.29418 + 1.29419 + stateEvents: ["columnmove", "columnresize", "sortchange"], 1.29420 + 1.29421 + 1.29422 + initComponent : function(){ 1.29423 + Ext.grid.GridPanel.superclass.initComponent.call(this); 1.29424 + 1.29425 + 1.29426 + 1.29427 + this.autoScroll = false; 1.29428 + this.autoWidth = false; 1.29429 + 1.29430 + if(Ext.isArray(this.columns)){ 1.29431 + this.colModel = new Ext.grid.ColumnModel(this.columns); 1.29432 + delete this.columns; 1.29433 + } 1.29434 + 1.29435 + 1.29436 + if(this.ds){ 1.29437 + this.store = this.ds; 1.29438 + delete this.ds; 1.29439 + } 1.29440 + if(this.cm){ 1.29441 + this.colModel = this.cm; 1.29442 + delete this.cm; 1.29443 + } 1.29444 + if(this.sm){ 1.29445 + this.selModel = this.sm; 1.29446 + delete this.sm; 1.29447 + } 1.29448 + this.store = Ext.StoreMgr.lookup(this.store); 1.29449 + 1.29450 + this.addEvents( 1.29451 + 1.29452 + 1.29453 + "click", 1.29454 + 1.29455 + "dblclick", 1.29456 + 1.29457 + "contextmenu", 1.29458 + 1.29459 + "mousedown", 1.29460 + 1.29461 + "mouseup", 1.29462 + 1.29463 + "mouseover", 1.29464 + 1.29465 + "mouseout", 1.29466 + 1.29467 + "keypress", 1.29468 + 1.29469 + "keydown", 1.29470 + 1.29471 + 1.29472 + 1.29473 + "cellmousedown", 1.29474 + 1.29475 + "rowmousedown", 1.29476 + 1.29477 + "headermousedown", 1.29478 + 1.29479 + 1.29480 + "cellclick", 1.29481 + 1.29482 + "celldblclick", 1.29483 + 1.29484 + "rowclick", 1.29485 + 1.29486 + "rowdblclick", 1.29487 + 1.29488 + "headerclick", 1.29489 + 1.29490 + "headerdblclick", 1.29491 + 1.29492 + "rowcontextmenu", 1.29493 + 1.29494 + "cellcontextmenu", 1.29495 + 1.29496 + "headercontextmenu", 1.29497 + 1.29498 + "bodyscroll", 1.29499 + 1.29500 + "columnresize", 1.29501 + 1.29502 + "columnmove", 1.29503 + 1.29504 + "sortchange" 1.29505 + ); 1.29506 + }, 1.29507 + 1.29508 + 1.29509 + onRender : function(ct, position){ 1.29510 + Ext.grid.GridPanel.superclass.onRender.apply(this, arguments); 1.29511 + 1.29512 + var c = this.body; 1.29513 + 1.29514 + this.el.addClass('x-grid-panel'); 1.29515 + 1.29516 + var view = this.getView(); 1.29517 + view.init(this); 1.29518 + 1.29519 + c.on("mousedown", this.onMouseDown, this); 1.29520 + c.on("click", this.onClick, this); 1.29521 + c.on("dblclick", this.onDblClick, this); 1.29522 + c.on("contextmenu", this.onContextMenu, this); 1.29523 + c.on("keydown", this.onKeyDown, this); 1.29524 + 1.29525 + this.relayEvents(c, ["mousedown","mouseup","mouseover","mouseout","keypress"]); 1.29526 + 1.29527 + this.getSelectionModel().init(this); 1.29528 + this.view.render(); 1.29529 + }, 1.29530 + 1.29531 + 1.29532 + initEvents : function(){ 1.29533 + Ext.grid.GridPanel.superclass.initEvents.call(this); 1.29534 + 1.29535 + if(this.loadMask){ 1.29536 + this.loadMask = new Ext.LoadMask(this.bwrap, 1.29537 + Ext.apply({store:this.store}, this.loadMask)); 1.29538 + } 1.29539 + }, 1.29540 + 1.29541 + initStateEvents : function(){ 1.29542 + Ext.grid.GridPanel.superclass.initStateEvents.call(this); 1.29543 + this.colModel.on('hiddenchange', this.saveState, this, {delay: 100}); 1.29544 + }, 1.29545 + 1.29546 + applyState : function(state){ 1.29547 + var cm = this.colModel; 1.29548 + var cs = state.columns; 1.29549 + if(cs){ 1.29550 + for(var i = 0, len = cs.length; i < len; i++){ 1.29551 + var s = cs[i]; 1.29552 + var c = cm.getColumnById(s.id); 1.29553 + if(c){ 1.29554 + c.hidden = s.hidden; 1.29555 + c.width = s.width; 1.29556 + var oldIndex = cm.getIndexById(s.id); 1.29557 + if(oldIndex != i){ 1.29558 + cm.moveColumn(oldIndex, i); 1.29559 + } 1.29560 + } 1.29561 + } 1.29562 + } 1.29563 + if(state.sort){ 1.29564 + this.store[this.store.remoteSort ? 'setDefaultSort' : 'sort'](state.sort.field, state.sort.direction); 1.29565 + } 1.29566 + }, 1.29567 + 1.29568 + getState : function(){ 1.29569 + var o = {columns: []}; 1.29570 + for(var i = 0, c; c = this.colModel.config[i]; i++){ 1.29571 + o.columns[i] = { 1.29572 + id: c.id, 1.29573 + width: c.width 1.29574 + }; 1.29575 + if(c.hidden){ 1.29576 + o.columns[i].hidden = true; 1.29577 + } 1.29578 + } 1.29579 + var ss = this.store.getSortState(); 1.29580 + if(ss){ 1.29581 + o.sort = ss; 1.29582 + } 1.29583 + return o; 1.29584 + }, 1.29585 + 1.29586 + 1.29587 + afterRender : function(){ 1.29588 + Ext.grid.GridPanel.superclass.afterRender.call(this); 1.29589 + this.view.layout(); 1.29590 + this.viewReady = true; 1.29591 + }, 1.29592 + 1.29593 + 1.29594 + reconfigure : function(store, colModel){ 1.29595 + if(this.loadMask){ 1.29596 + this.loadMask.destroy(); 1.29597 + this.loadMask = new Ext.LoadMask(this.bwrap, 1.29598 + Ext.apply({store:store}, this.initialConfig.loadMask)); 1.29599 + } 1.29600 + this.view.bind(store, colModel); 1.29601 + this.store = store; 1.29602 + this.colModel = colModel; 1.29603 + if(this.rendered){ 1.29604 + this.view.refresh(true); 1.29605 + } 1.29606 + }, 1.29607 + 1.29608 + 1.29609 + onKeyDown : function(e){ 1.29610 + this.fireEvent("keydown", e); 1.29611 + }, 1.29612 + 1.29613 + 1.29614 + onDestroy : function(){ 1.29615 + if(this.rendered){ 1.29616 + if(this.loadMask){ 1.29617 + this.loadMask.destroy(); 1.29618 + } 1.29619 + var c = this.body; 1.29620 + c.removeAllListeners(); 1.29621 + this.view.destroy(); 1.29622 + c.update(""); 1.29623 + } 1.29624 + this.colModel.purgeListeners(); 1.29625 + Ext.grid.GridPanel.superclass.onDestroy.call(this); 1.29626 + }, 1.29627 + 1.29628 + 1.29629 + processEvent : function(name, e){ 1.29630 + this.fireEvent(name, e); 1.29631 + var t = e.getTarget(); 1.29632 + var v = this.view; 1.29633 + var header = v.findHeaderIndex(t); 1.29634 + if(header !== false){ 1.29635 + this.fireEvent("header" + name, this, header, e); 1.29636 + }else{ 1.29637 + var row = v.findRowIndex(t); 1.29638 + var cell = v.findCellIndex(t); 1.29639 + if(row !== false){ 1.29640 + this.fireEvent("row" + name, this, row, e); 1.29641 + if(cell !== false){ 1.29642 + this.fireEvent("cell" + name, this, row, cell, e); 1.29643 + } 1.29644 + } 1.29645 + } 1.29646 + }, 1.29647 + 1.29648 + 1.29649 + onClick : function(e){ 1.29650 + this.processEvent("click", e); 1.29651 + }, 1.29652 + 1.29653 + 1.29654 + onMouseDown : function(e){ 1.29655 + this.processEvent("mousedown", e); 1.29656 + }, 1.29657 + 1.29658 + 1.29659 + onContextMenu : function(e, t){ 1.29660 + this.processEvent("contextmenu", e); 1.29661 + }, 1.29662 + 1.29663 + 1.29664 + onDblClick : function(e){ 1.29665 + this.processEvent("dblclick", e); 1.29666 + }, 1.29667 + 1.29668 + 1.29669 + walkCells : function(row, col, step, fn, scope){ 1.29670 + var cm = this.colModel, clen = cm.getColumnCount(); 1.29671 + var ds = this.store, rlen = ds.getCount(), first = true; 1.29672 + if(step < 0){ 1.29673 + if(col < 0){ 1.29674 + row--; 1.29675 + first = false; 1.29676 + } 1.29677 + while(row >= 0){ 1.29678 + if(!first){ 1.29679 + col = clen-1; 1.29680 + } 1.29681 + first = false; 1.29682 + while(col >= 0){ 1.29683 + if(fn.call(scope || this, row, col, cm) === true){ 1.29684 + return [row, col]; 1.29685 + } 1.29686 + col--; 1.29687 + } 1.29688 + row--; 1.29689 + } 1.29690 + } else { 1.29691 + if(col >= clen){ 1.29692 + row++; 1.29693 + first = false; 1.29694 + } 1.29695 + while(row < rlen){ 1.29696 + if(!first){ 1.29697 + col = 0; 1.29698 + } 1.29699 + first = false; 1.29700 + while(col < clen){ 1.29701 + if(fn.call(scope || this, row, col, cm) === true){ 1.29702 + return [row, col]; 1.29703 + } 1.29704 + col++; 1.29705 + } 1.29706 + row++; 1.29707 + } 1.29708 + } 1.29709 + return null; 1.29710 + }, 1.29711 + 1.29712 + 1.29713 + getSelections : function(){ 1.29714 + return this.selModel.getSelections(); 1.29715 + }, 1.29716 + 1.29717 + 1.29718 + onResize : function(){ 1.29719 + Ext.grid.GridPanel.superclass.onResize.apply(this, arguments); 1.29720 + if(this.viewReady){ 1.29721 + this.view.layout(); 1.29722 + } 1.29723 + }, 1.29724 + 1.29725 + 1.29726 + getGridEl : function(){ 1.29727 + return this.body; 1.29728 + }, 1.29729 + 1.29730 + 1.29731 + stopEditing : function(){}, 1.29732 + 1.29733 + 1.29734 + getSelectionModel : function(){ 1.29735 + if(!this.selModel){ 1.29736 + this.selModel = new Ext.grid.RowSelectionModel( 1.29737 + this.disableSelection ? {selectRow: Ext.emptyFn} : null); 1.29738 + } 1.29739 + return this.selModel; 1.29740 + }, 1.29741 + 1.29742 + 1.29743 + getStore : function(){ 1.29744 + return this.store; 1.29745 + }, 1.29746 + 1.29747 + 1.29748 + getColumnModel : function(){ 1.29749 + return this.colModel; 1.29750 + }, 1.29751 + 1.29752 + 1.29753 + getView : function(){ 1.29754 + if(!this.view){ 1.29755 + this.view = new Ext.grid.GridView(this.viewConfig); 1.29756 + } 1.29757 + return this.view; 1.29758 + }, 1.29759 + 1.29760 + getDragDropText : function(){ 1.29761 + var count = this.selModel.getCount(); 1.29762 + return String.format(this.ddText, count, count == 1 ? '' : 's'); 1.29763 + } 1.29764 + 1.29765 + 1.29766 + 1.29767 + 1.29768 + 1.29769 + 1.29770 + 1.29771 + 1.29772 + 1.29773 + 1.29774 + 1.29775 + 1.29776 + 1.29777 + 1.29778 + 1.29779 + 1.29780 + 1.29781 + 1.29782 + 1.29783 + 1.29784 + 1.29785 + 1.29786 + 1.29787 + 1.29788 + 1.29789 + 1.29790 + 1.29791 + 1.29792 + 1.29793 + 1.29794 + 1.29795 + 1.29796 + 1.29797 + 1.29798 + 1.29799 + 1.29800 + 1.29801 + 1.29802 + 1.29803 + 1.29804 + 1.29805 + 1.29806 + 1.29807 + 1.29808 + 1.29809 + 1.29810 + 1.29811 + 1.29812 + 1.29813 + 1.29814 +}); 1.29815 +Ext.reg('grid', Ext.grid.GridPanel); 1.29816 + 1.29817 +Ext.grid.GridView = function(config){ 1.29818 + Ext.apply(this, config); 1.29819 + this.addEvents( 1.29820 + 1.29821 + "beforerowremoved", 1.29822 + 1.29823 + "beforerowsinserted", 1.29824 + 1.29825 + "beforerefresh", 1.29826 + 1.29827 + "rowremoved", 1.29828 + 1.29829 + "rowsinserted", 1.29830 + 1.29831 + "rowupdated", 1.29832 + 1.29833 + "refresh" 1.29834 + ); 1.29835 + Ext.grid.GridView.superclass.constructor.call(this); 1.29836 +}; 1.29837 + 1.29838 +Ext.extend(Ext.grid.GridView, Ext.util.Observable, { 1.29839 + 1.29840 + 1.29841 + 1.29842 + 1.29843 + deferEmptyText: true, 1.29844 + 1.29845 + scrollOffset: 19, 1.29846 + 1.29847 + autoFill: false, 1.29848 + 1.29849 + forceFit: false, 1.29850 + 1.29851 + sortClasses : ["sort-asc", "sort-desc"], 1.29852 + 1.29853 + sortAscText : "Sort Ascending", 1.29854 + 1.29855 + sortDescText : "Sort Descending", 1.29856 + 1.29857 + columnsText : "Columns", 1.29858 + 1.29859 + borderWidth: 2, 1.29860 + 1.29861 + 1.29862 + 1.29863 + initTemplates : function(){ 1.29864 + var ts = this.templates || {}; 1.29865 + if(!ts.master){ 1.29866 + ts.master = new Ext.Template( 1.29867 + '<div class="x-grid3" hidefocus="true">', 1.29868 + '<div class="x-grid3-viewport">', 1.29869 + '<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>', 1.29870 + '<div class="x-grid3-scroller"><div class="x-grid3-body">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>', 1.29871 + "</div>", 1.29872 + '<div class="x-grid3-resize-marker"> </div>', 1.29873 + '<div class="x-grid3-resize-proxy"> </div>', 1.29874 + "</div>" 1.29875 + ); 1.29876 + } 1.29877 + 1.29878 + if(!ts.header){ 1.29879 + ts.header = new Ext.Template( 1.29880 + '<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">', 1.29881 + '<thead><tr class="x-grid3-hd-row">{cells}</tr></thead>', 1.29882 + "</table>" 1.29883 + ); 1.29884 + } 1.29885 + 1.29886 + if(!ts.hcell){ 1.29887 + ts.hcell = new Ext.Template( 1.29888 + '<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id}" style="{style}"><div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">', this.grid.enableHdMenu ? '<a class="x-grid3-hd-btn" href="#"></a>' : '', 1.29889 + '{value}<img class="x-grid3-sort-icon" src="', Ext.BLANK_IMAGE_URL, '" />', 1.29890 + "</div></td>" 1.29891 + ); 1.29892 + } 1.29893 + 1.29894 + if(!ts.body){ 1.29895 + ts.body = new Ext.Template('{rows}'); 1.29896 + } 1.29897 + 1.29898 + if(!ts.row){ 1.29899 + ts.row = new Ext.Template( 1.29900 + '<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">', 1.29901 + '<tbody><tr>{cells}</tr>', 1.29902 + (this.enableRowBody ? '<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>' : ''), 1.29903 + '</tbody></table></div>' 1.29904 + ); 1.29905 + } 1.29906 + 1.29907 + if(!ts.cell){ 1.29908 + ts.cell = new Ext.Template( 1.29909 + '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>', 1.29910 + '<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>', 1.29911 + "</td>" 1.29912 + ); 1.29913 + } 1.29914 + 1.29915 + for(var k in ts){ 1.29916 + var t = ts[k]; 1.29917 + if(t && typeof t.compile == 'function' && !t.compiled){ 1.29918 + t.disableFormats = true; 1.29919 + t.compile(); 1.29920 + } 1.29921 + } 1.29922 + 1.29923 + this.templates = ts; 1.29924 + 1.29925 + this.tdClass = 'x-grid3-cell'; 1.29926 + this.cellSelector = 'td.x-grid3-cell'; 1.29927 + this.hdCls = 'x-grid3-hd'; 1.29928 + this.rowSelector = 'div.x-grid3-row'; 1.29929 + this.colRe = new RegExp("x-grid3-td-([^\\s]+)", ""); 1.29930 + }, 1.29931 + 1.29932 + fly : function(el){ 1.29933 + if(!this._flyweight){ 1.29934 + this._flyweight = new Ext.Element.Flyweight(document.body); 1.29935 + } 1.29936 + this._flyweight.dom = el; 1.29937 + return this._flyweight; 1.29938 + }, 1.29939 + 1.29940 + getEditorParent : function(ed){ 1.29941 + return this.scroller.dom; 1.29942 + }, 1.29943 + 1.29944 + initElements : function(){ 1.29945 + var E = Ext.Element; 1.29946 + 1.29947 + var el = this.grid.getGridEl().dom.firstChild; 1.29948 + var cs = el.childNodes; 1.29949 + 1.29950 + this.el = new E(el); 1.29951 + 1.29952 + this.mainWrap = new E(cs[0]); 1.29953 + this.mainHd = new E(this.mainWrap.dom.firstChild); 1.29954 + 1.29955 + if(this.grid.hideHeaders){ 1.29956 + this.mainHd.setDisplayed(false); 1.29957 + } 1.29958 + 1.29959 + this.innerHd = this.mainHd.dom.firstChild; 1.29960 + this.scroller = new E(this.mainWrap.dom.childNodes[1]); 1.29961 + if(this.forceFit){ 1.29962 + this.scroller.setStyle('overflow-x', 'hidden'); 1.29963 + } 1.29964 + this.mainBody = new E(this.scroller.dom.firstChild); 1.29965 + 1.29966 + this.focusEl = new E(this.scroller.dom.childNodes[1]); 1.29967 + this.focusEl.swallowEvent("click", true); 1.29968 + 1.29969 + this.resizeMarker = new E(cs[1]); 1.29970 + this.resizeProxy = new E(cs[2]); 1.29971 + }, 1.29972 + 1.29973 + getRows : function(){ 1.29974 + return this.hasRows() ? this.mainBody.dom.childNodes : []; 1.29975 + }, 1.29976 + 1.29977 + 1.29978 + findCell : function(el){ 1.29979 + if(!el){ 1.29980 + return false; 1.29981 + } 1.29982 + return this.fly(el).findParent(this.cellSelector, 3); 1.29983 + }, 1.29984 + 1.29985 + findCellIndex : function(el, requiredCls){ 1.29986 + var cell = this.findCell(el); 1.29987 + if(cell && (!requiredCls || this.fly(cell).hasClass(requiredCls))){ 1.29988 + return this.getCellIndex(cell); 1.29989 + } 1.29990 + return false; 1.29991 + }, 1.29992 + 1.29993 + getCellIndex : function(el){ 1.29994 + if(el){ 1.29995 + var m = el.className.match(this.colRe); 1.29996 + if(m && m[1]){ 1.29997 + return this.cm.getIndexById(m[1]); 1.29998 + } 1.29999 + } 1.30000 + return false; 1.30001 + }, 1.30002 + 1.30003 + findHeaderCell : function(el){ 1.30004 + var cell = this.findCell(el); 1.30005 + return cell && this.fly(cell).hasClass(this.hdCls) ? cell : null; 1.30006 + }, 1.30007 + 1.30008 + findHeaderIndex : function(el){ 1.30009 + return this.findCellIndex(el, this.hdCls); 1.30010 + }, 1.30011 + 1.30012 + findRow : function(el){ 1.30013 + if(!el){ 1.30014 + return false; 1.30015 + } 1.30016 + return this.fly(el).findParent(this.rowSelector, 10); 1.30017 + }, 1.30018 + 1.30019 + findRowIndex : function(el){ 1.30020 + var r = this.findRow(el); 1.30021 + return r ? r.rowIndex : false; 1.30022 + }, 1.30023 + 1.30024 + 1.30025 + 1.30026 + getRow : function(row){ 1.30027 + return this.getRows()[row]; 1.30028 + }, 1.30029 + 1.30030 + 1.30031 + getCell : function(row, col){ 1.30032 + return this.getRow(row).getElementsByTagName('td')[col]; 1.30033 + }, 1.30034 + 1.30035 + 1.30036 + getHeaderCell : function(index){ 1.30037 + return this.mainHd.dom.getElementsByTagName('td')[index]; 1.30038 + }, 1.30039 + 1.30040 + 1.30041 + addRowClass : function(row, cls){ 1.30042 + var r = this.getRow(row); 1.30043 + if(r){ 1.30044 + this.fly(r).addClass(cls); 1.30045 + } 1.30046 + }, 1.30047 + 1.30048 + removeRowClass : function(row, cls){ 1.30049 + var r = this.getRow(row); 1.30050 + if(r){ 1.30051 + this.fly(r).removeClass(cls); 1.30052 + } 1.30053 + }, 1.30054 + 1.30055 + removeRow : function(row){ 1.30056 + Ext.removeNode(this.getRow(row)); 1.30057 + }, 1.30058 + 1.30059 + removeRows : function(firstRow, lastRow){ 1.30060 + var bd = this.mainBody.dom; 1.30061 + for(var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++){ 1.30062 + Ext.removeNode(bd.childNodes[firstRow]); 1.30063 + } 1.30064 + }, 1.30065 + 1.30066 + 1.30067 + getScrollState : function(){ 1.30068 + var sb = this.scroller.dom; 1.30069 + return {left: sb.scrollLeft, top: sb.scrollTop}; 1.30070 + }, 1.30071 + 1.30072 + restoreScroll : function(state){ 1.30073 + var sb = this.scroller.dom; 1.30074 + sb.scrollLeft = state.left; 1.30075 + sb.scrollTop = state.top; 1.30076 + }, 1.30077 + 1.30078 + 1.30079 + scrollToTop : function(){ 1.30080 + this.scroller.dom.scrollTop = 0; 1.30081 + this.scroller.dom.scrollLeft = 0; 1.30082 + }, 1.30083 + 1.30084 + syncScroll : function(){ 1.30085 + this.syncHeaderScroll(); 1.30086 + var mb = this.scroller.dom; 1.30087 + this.grid.fireEvent("bodyscroll", mb.scrollLeft, mb.scrollTop); 1.30088 + }, 1.30089 + 1.30090 + syncHeaderScroll : function(){ 1.30091 + var mb = this.scroller.dom; 1.30092 + this.innerHd.scrollLeft = mb.scrollLeft; 1.30093 + this.innerHd.scrollLeft = mb.scrollLeft; }, 1.30094 + 1.30095 + updateSortIcon : function(col, dir){ 1.30096 + var sc = this.sortClasses; 1.30097 + var hds = this.mainHd.select('td').removeClass(sc); 1.30098 + hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]); 1.30099 + }, 1.30100 + 1.30101 + updateAllColumnWidths : function(){ 1.30102 + var tw = this.getTotalWidth(); 1.30103 + var clen = this.cm.getColumnCount(); 1.30104 + var ws = []; 1.30105 + for(var i = 0; i < clen; i++){ 1.30106 + ws[i] = this.getColumnWidth(i); 1.30107 + } 1.30108 + 1.30109 + this.innerHd.firstChild.firstChild.style.width = tw; 1.30110 + 1.30111 + for(var i = 0; i < clen; i++){ 1.30112 + var hd = this.getHeaderCell(i); 1.30113 + hd.style.width = ws[i]; 1.30114 + } 1.30115 + 1.30116 + var ns = this.getRows(); 1.30117 + for(var i = 0, len = ns.length; i < len; i++){ 1.30118 + ns[i].style.width = tw; 1.30119 + ns[i].firstChild.style.width = tw; 1.30120 + var row = ns[i].firstChild.rows[0]; 1.30121 + for(var j = 0; j < clen; j++){ 1.30122 + row.childNodes[j].style.width = ws[j]; 1.30123 + } 1.30124 + } 1.30125 + 1.30126 + this.onAllColumnWidthsUpdated(ws, tw); 1.30127 + }, 1.30128 + 1.30129 + updateColumnWidth : function(col, width){ 1.30130 + var w = this.getColumnWidth(col); 1.30131 + var tw = this.getTotalWidth(); 1.30132 + 1.30133 + this.innerHd.firstChild.firstChild.style.width = tw; 1.30134 + var hd = this.getHeaderCell(col); 1.30135 + hd.style.width = w; 1.30136 + 1.30137 + var ns = this.getRows(); 1.30138 + for(var i = 0, len = ns.length; i < len; i++){ 1.30139 + ns[i].style.width = tw; 1.30140 + ns[i].firstChild.style.width = tw; 1.30141 + ns[i].firstChild.rows[0].childNodes[col].style.width = w; 1.30142 + } 1.30143 + 1.30144 + this.onColumnWidthUpdated(col, w, tw); 1.30145 + }, 1.30146 + 1.30147 + updateColumnHidden : function(col, hidden){ 1.30148 + var tw = this.getTotalWidth(); 1.30149 + 1.30150 + this.innerHd.firstChild.firstChild.style.width = tw; 1.30151 + 1.30152 + var display = hidden ? 'none' : ''; 1.30153 + 1.30154 + var hd = this.getHeaderCell(col); 1.30155 + hd.style.display = display; 1.30156 + 1.30157 + var ns = this.getRows(); 1.30158 + for(var i = 0, len = ns.length; i < len; i++){ 1.30159 + ns[i].style.width = tw; 1.30160 + ns[i].firstChild.style.width = tw; 1.30161 + ns[i].firstChild.rows[0].childNodes[col].style.display = display; 1.30162 + } 1.30163 + 1.30164 + this.onColumnHiddenUpdated(col, hidden, tw); 1.30165 + 1.30166 + delete this.lastViewWidth; this.layout(); 1.30167 + }, 1.30168 + 1.30169 + doRender : function(cs, rs, ds, startRow, colCount, stripe){ 1.30170 + var ts = this.templates, ct = ts.cell, rt = ts.row, last = colCount-1; 1.30171 + var tstyle = 'width:'+this.getTotalWidth()+';'; 1.30172 + var buf = [], cb, c, p = {}, rp = {tstyle: tstyle}, r; 1.30173 + for(var j = 0, len = rs.length; j < len; j++){ 1.30174 + r = rs[j]; cb = []; 1.30175 + var rowIndex = (j+startRow); 1.30176 + for(var i = 0; i < colCount; i++){ 1.30177 + c = cs[i]; 1.30178 + p.id = c.id; 1.30179 + p.css = i == 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : ''); 1.30180 + p.attr = p.cellAttr = ""; 1.30181 + p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds); 1.30182 + p.style = c.style; 1.30183 + if(p.value == undefined || p.value === "") p.value = " "; 1.30184 + if(r.dirty && typeof r.modified[c.name] !== 'undefined'){ 1.30185 + p.css += ' x-grid3-dirty-cell'; 1.30186 + } 1.30187 + cb[cb.length] = ct.apply(p); 1.30188 + } 1.30189 + var alt = []; 1.30190 + if(stripe && ((rowIndex+1) % 2 == 0)){ 1.30191 + alt[0] = "x-grid3-row-alt"; 1.30192 + } 1.30193 + if(r.dirty){ 1.30194 + alt[1] = " x-grid3-dirty-row"; 1.30195 + } 1.30196 + rp.cols = colCount; 1.30197 + if(this.getRowClass){ 1.30198 + alt[2] = this.getRowClass(r, rowIndex, rp, ds); 1.30199 + } 1.30200 + rp.alt = alt.join(" "); 1.30201 + rp.cells = cb.join(""); 1.30202 + buf[buf.length] = rt.apply(rp); 1.30203 + } 1.30204 + return buf.join(""); 1.30205 + }, 1.30206 + 1.30207 + processRows : function(startRow, skipStripe){ 1.30208 + if(this.ds.getCount() < 1){ 1.30209 + return; 1.30210 + } 1.30211 + skipStripe = skipStripe || !this.grid.stripeRows; 1.30212 + startRow = startRow || 0; 1.30213 + var rows = this.getRows(); 1.30214 + var cls = ' x-grid3-row-alt '; 1.30215 + for(var i = startRow, len = rows.length; i < len; i++){ 1.30216 + var row = rows[i]; 1.30217 + row.rowIndex = i; 1.30218 + if(!skipStripe){ 1.30219 + var isAlt = ((i+1) % 2 == 0); 1.30220 + var hasAlt = (' '+row.className + ' ').indexOf(cls) != -1; 1.30221 + if(isAlt == hasAlt){ 1.30222 + continue; 1.30223 + } 1.30224 + if(isAlt){ 1.30225 + row.className += " x-grid3-row-alt"; 1.30226 + }else{ 1.30227 + row.className = row.className.replace("x-grid3-row-alt", ""); 1.30228 + } 1.30229 + } 1.30230 + } 1.30231 + }, 1.30232 + 1.30233 + renderUI : function(){ 1.30234 + 1.30235 + var header = this.renderHeaders(); 1.30236 + var body = this.templates.body.apply({rows:''}); 1.30237 + 1.30238 + 1.30239 + var html = this.templates.master.apply({ 1.30240 + body: body, 1.30241 + header: header 1.30242 + }); 1.30243 + 1.30244 + var g = this.grid; 1.30245 + 1.30246 + g.getGridEl().dom.innerHTML = html; 1.30247 + 1.30248 + this.initElements(); 1.30249 + 1.30250 + 1.30251 + this.mainBody.dom.innerHTML = this.renderRows(); 1.30252 + this.processRows(0, true); 1.30253 + 1.30254 + if(this.deferEmptyText !== true){ 1.30255 + this.applyEmptyText(); 1.30256 + } 1.30257 + 1.30258 + Ext.fly(this.innerHd).on("click", this.handleHdDown, this); 1.30259 + this.mainHd.on("mouseover", this.handleHdOver, this); 1.30260 + this.mainHd.on("mouseout", this.handleHdOut, this); 1.30261 + this.mainHd.on("mousemove", this.handleHdMove, this); 1.30262 + 1.30263 + this.scroller.on('scroll', this.syncScroll, this); 1.30264 + if(g.enableColumnResize !== false){ 1.30265 + this.splitone = new Ext.grid.GridView.SplitDragZone(g, this.mainHd.dom); 1.30266 + } 1.30267 + 1.30268 + if(g.enableColumnMove){ 1.30269 + this.columnDrag = new Ext.grid.GridView.ColumnDragZone(g, this.innerHd); 1.30270 + this.columnDrop = new Ext.grid.HeaderDropZone(g, this.mainHd.dom); 1.30271 + } 1.30272 + 1.30273 + if(g.enableHdMenu !== false){ 1.30274 + if(g.enableColumnHide !== false){ 1.30275 + this.colMenu = new Ext.menu.Menu({id:g.id + "-hcols-menu"}); 1.30276 + this.colMenu.on("beforeshow", this.beforeColMenuShow, this); 1.30277 + this.colMenu.on("itemclick", this.handleHdMenuClick, this); 1.30278 + } 1.30279 + this.hmenu = new Ext.menu.Menu({id: g.id + "-hctx"}); 1.30280 + this.hmenu.add( 1.30281 + {id:"asc", text: this.sortAscText, cls: "xg-hmenu-sort-asc"}, 1.30282 + {id:"desc", text: this.sortDescText, cls: "xg-hmenu-sort-desc"} 1.30283 + ); 1.30284 + if(g.enableColumnHide !== false){ 1.30285 + this.hmenu.add('-', 1.30286 + {id:"columns", text: this.columnsText, menu: this.colMenu, iconCls: 'x-cols-icon'} 1.30287 + ); 1.30288 + } 1.30289 + this.hmenu.on("itemclick", this.handleHdMenuClick, this); 1.30290 + 1.30291 + } 1.30292 + 1.30293 + if(g.enableDragDrop || g.enableDrag){ 1.30294 + this.dragZone = new Ext.grid.GridDragZone(g, { 1.30295 + ddGroup : g.ddGroup || 'GridDD' 1.30296 + }); 1.30297 + } 1.30298 + 1.30299 + this.updateHeaderSortState(); 1.30300 + 1.30301 + }, 1.30302 + 1.30303 + layout : function(){ 1.30304 + if(!this.mainBody){ 1.30305 + return; } 1.30306 + var g = this.grid; 1.30307 + var c = g.getGridEl(); 1.30308 + var csize = c.getSize(true); 1.30309 + var vw = csize.width; 1.30310 + 1.30311 + if(vw < 20 || csize.height < 20){ return; 1.30312 + } 1.30313 + 1.30314 + if(g.autoHeight){ 1.30315 + this.scroller.dom.style.overflow = 'visible'; 1.30316 + }else{ 1.30317 + this.el.setSize(csize.width, csize.height); 1.30318 + 1.30319 + var hdHeight = this.mainHd.getHeight(); 1.30320 + var vh = csize.height - (hdHeight); 1.30321 + 1.30322 + this.scroller.setSize(vw, vh); 1.30323 + if(this.innerHd){ 1.30324 + this.innerHd.style.width = (vw)+'px'; 1.30325 + } 1.30326 + } 1.30327 + if(this.forceFit){ 1.30328 + if(this.lastViewWidth != vw){ 1.30329 + this.fitColumns(false, false); 1.30330 + this.lastViewWidth = vw; 1.30331 + } 1.30332 + }else { 1.30333 + this.autoExpand(); 1.30334 + this.syncHeaderScroll(); 1.30335 + } 1.30336 + this.onLayout(vw, vh); 1.30337 + }, 1.30338 + 1.30339 + onLayout : function(vw, vh){ 1.30340 + }, 1.30341 + 1.30342 + onColumnWidthUpdated : function(col, w, tw){ 1.30343 + }, 1.30344 + 1.30345 + onAllColumnWidthsUpdated : function(ws, tw){ 1.30346 + }, 1.30347 + 1.30348 + onColumnHiddenUpdated : function(col, hidden, tw){ 1.30349 + }, 1.30350 + 1.30351 + updateColumnText : function(col, text){ 1.30352 + }, 1.30353 + 1.30354 + afterMove : function(colIndex){ 1.30355 + }, 1.30356 + 1.30357 + 1.30358 + init: function(grid){ 1.30359 + this.grid = grid; 1.30360 + 1.30361 + this.initTemplates(); 1.30362 + this.initData(grid.store, grid.colModel); 1.30363 + this.initUI(grid); 1.30364 + }, 1.30365 + 1.30366 + getColumnId : function(index){ 1.30367 + return this.cm.getColumnId(index); 1.30368 + }, 1.30369 + 1.30370 + renderHeaders : function(){ 1.30371 + var cm = this.cm, ts = this.templates; 1.30372 + var ct = ts.hcell; 1.30373 + 1.30374 + var cb = [], sb = [], p = {}; 1.30375 + 1.30376 + for(var i = 0, len = cm.getColumnCount(); i < len; i++){ 1.30377 + p.id = cm.getColumnId(i); 1.30378 + p.value = cm.getColumnHeader(i) || ""; 1.30379 + p.style = this.getColumnStyle(i, true); 1.30380 + p.tooltip = this.getColumnTooltip(i); 1.30381 + if(cm.config[i].align == 'right'){ 1.30382 + p.istyle = 'padding-right:16px'; 1.30383 + } else { 1.30384 + delete p.istyle; 1.30385 + } 1.30386 + cb[cb.length] = ct.apply(p); 1.30387 + } 1.30388 + return ts.header.apply({cells: cb.join(""), tstyle:'width:'+this.getTotalWidth()+';'}); 1.30389 + }, 1.30390 + 1.30391 + getColumnTooltip : function(i){ 1.30392 + var tt = this.cm.getColumnTooltip(i); 1.30393 + if(tt){ 1.30394 + if(Ext.QuickTips.isEnabled()){ 1.30395 + return 'ext:qtip="'+tt+'"'; 1.30396 + }else{ 1.30397 + return 'title="'+tt+'"'; 1.30398 + } 1.30399 + } 1.30400 + return ""; 1.30401 + }, 1.30402 + 1.30403 + beforeUpdate : function(){ 1.30404 + this.grid.stopEditing(true); 1.30405 + }, 1.30406 + 1.30407 + updateHeaders : function(){ 1.30408 + this.innerHd.firstChild.innerHTML = this.renderHeaders(); 1.30409 + }, 1.30410 + 1.30411 + 1.30412 + focusRow : function(row){ 1.30413 + this.focusCell(row, 0, false); 1.30414 + }, 1.30415 + 1.30416 + 1.30417 + focusCell : function(row, col, hscroll){ 1.30418 + var xy = this.ensureVisible(row, col, hscroll); 1.30419 + this.focusEl.setXY(xy); 1.30420 + if(Ext.isGecko){ 1.30421 + this.focusEl.focus(); 1.30422 + }else{ 1.30423 + this.focusEl.focus.defer(1, this.focusEl); 1.30424 + } 1.30425 + }, 1.30426 + 1.30427 + ensureVisible : function(row, col, hscroll){ 1.30428 + if(typeof row != "number"){ 1.30429 + row = row.rowIndex; 1.30430 + } 1.30431 + if(!this.ds){ 1.30432 + return; 1.30433 + } 1.30434 + if(row < 0 || row >= this.ds.getCount()){ 1.30435 + return; 1.30436 + } 1.30437 + col = (col !== undefined ? col : 0); 1.30438 + 1.30439 + var rowEl = this.getRow(row), cellEl; 1.30440 + if(!(hscroll === false && col === 0)){ 1.30441 + while(this.cm.isHidden(col)){ 1.30442 + col++; 1.30443 + } 1.30444 + cellEl = this.getCell(row, col); 1.30445 + } 1.30446 + if(!rowEl){ 1.30447 + return; 1.30448 + } 1.30449 + 1.30450 + var c = this.scroller.dom; 1.30451 + 1.30452 + var ctop = 0; 1.30453 + var p = rowEl, stop = this.el.dom; 1.30454 + while(p && p != stop){ 1.30455 + ctop += p.offsetTop; 1.30456 + p = p.offsetParent; 1.30457 + } 1.30458 + ctop -= this.mainHd.dom.offsetHeight; 1.30459 + 1.30460 + var cbot = ctop + rowEl.offsetHeight; 1.30461 + 1.30462 + var ch = c.clientHeight; 1.30463 + var stop = parseInt(c.scrollTop, 10); 1.30464 + var sbot = stop + ch; 1.30465 + 1.30466 + if(ctop < stop){ 1.30467 + c.scrollTop = ctop; 1.30468 + }else if(cbot > sbot){ 1.30469 + c.scrollTop = cbot-ch; 1.30470 + } 1.30471 + 1.30472 + if(hscroll !== false){ 1.30473 + var cleft = parseInt(cellEl.offsetLeft, 10); 1.30474 + var cright = cleft + cellEl.offsetWidth; 1.30475 + 1.30476 + var sleft = parseInt(c.scrollLeft, 10); 1.30477 + var sright = sleft + c.clientWidth; 1.30478 + if(cleft < sleft){ 1.30479 + c.scrollLeft = cleft; 1.30480 + }else if(cright > sright){ 1.30481 + c.scrollLeft = cright-c.clientWidth; 1.30482 + } 1.30483 + } 1.30484 + return cellEl ? Ext.fly(cellEl).getXY() : [c.scrollLeft, Ext.fly(rowEl).getY()]; 1.30485 + }, 1.30486 + 1.30487 + insertRows : function(dm, firstRow, lastRow, isUpdate){ 1.30488 + if(!isUpdate && firstRow === 0 && lastRow == dm.getCount()-1){ 1.30489 + this.refresh(); 1.30490 + }else{ 1.30491 + if(!isUpdate){ 1.30492 + this.fireEvent("beforerowsinserted", this, firstRow, lastRow); 1.30493 + } 1.30494 + var html = this.renderRows(firstRow, lastRow); 1.30495 + var before = this.getRow(firstRow); 1.30496 + if(before){ 1.30497 + Ext.DomHelper.insertHtml('beforeBegin', before, html); 1.30498 + }else{ 1.30499 + Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html); 1.30500 + } 1.30501 + if(!isUpdate){ 1.30502 + this.fireEvent("rowsinserted", this, firstRow, lastRow); 1.30503 + this.processRows(firstRow); 1.30504 + } 1.30505 + } 1.30506 + }, 1.30507 + 1.30508 + deleteRows : function(dm, firstRow, lastRow){ 1.30509 + if(dm.getRowCount()<1){ 1.30510 + this.refresh(); 1.30511 + }else{ 1.30512 + this.fireEvent("beforerowsdeleted", this, firstRow, lastRow); 1.30513 + 1.30514 + this.removeRows(firstRow, lastRow); 1.30515 + 1.30516 + this.processRows(firstRow); 1.30517 + this.fireEvent("rowsdeleted", this, firstRow, lastRow); 1.30518 + } 1.30519 + }, 1.30520 + 1.30521 + getColumnStyle : function(col, isHeader){ 1.30522 + var style = !isHeader ? (this.cm.config[col].css || '') : ''; 1.30523 + style += 'width:'+this.getColumnWidth(col)+';'; 1.30524 + if(this.cm.isHidden(col)){ 1.30525 + style += 'display:none;'; 1.30526 + } 1.30527 + var align = this.cm.config[col].align; 1.30528 + if(align){ 1.30529 + style += 'text-align:'+align+';'; 1.30530 + } 1.30531 + return style; 1.30532 + }, 1.30533 + 1.30534 + getColumnWidth : function(col){ 1.30535 + var w = this.cm.getColumnWidth(col); 1.30536 + if(typeof w == 'number'){ 1.30537 + return (Ext.isBorderBox ? w : (w-this.borderWidth > 0 ? w-this.borderWidth:0)) + 'px'; 1.30538 + } 1.30539 + return w; 1.30540 + }, 1.30541 + 1.30542 + getTotalWidth : function(){ 1.30543 + return this.cm.getTotalWidth()+'px'; 1.30544 + }, 1.30545 + 1.30546 + fitColumns : function(preventRefresh, onlyExpand, omitColumn){ 1.30547 + var cm = this.cm, leftOver, dist, i; 1.30548 + var tw = cm.getTotalWidth(false); 1.30549 + var aw = this.grid.getGridEl().getWidth(true)-this.scrollOffset; 1.30550 + 1.30551 + if(aw < 20){ return; 1.30552 + } 1.30553 + var extra = aw - tw; 1.30554 + 1.30555 + if(extra === 0){ 1.30556 + return false; 1.30557 + } 1.30558 + 1.30559 + var vc = cm.getColumnCount(true); 1.30560 + var ac = vc-(typeof omitColumn == 'number' ? 1 : 0); 1.30561 + if(ac === 0){ 1.30562 + ac = 1; 1.30563 + omitColumn = undefined; 1.30564 + } 1.30565 + var colCount = cm.getColumnCount(); 1.30566 + var cols = []; 1.30567 + var extraCol = 0; 1.30568 + var width = 0; 1.30569 + var w; 1.30570 + for (i = 0; i < colCount; i++){ 1.30571 + if(!cm.isHidden(i) && !cm.isFixed(i) && i !== omitColumn){ 1.30572 + w = cm.getColumnWidth(i); 1.30573 + cols.push(i); 1.30574 + extraCol = i; 1.30575 + cols.push(w); 1.30576 + width += w; 1.30577 + } 1.30578 + } 1.30579 + var frac = (aw - cm.getTotalWidth())/width; 1.30580 + while (cols.length){ 1.30581 + w = cols.pop(); 1.30582 + i = cols.pop(); 1.30583 + cm.setColumnWidth(i, Math.max(this.grid.minColumnWidth, Math.floor(w + w*frac)), true); 1.30584 + } 1.30585 + 1.30586 + if((tw = cm.getTotalWidth(false)) > aw){ 1.30587 + var adjustCol = ac != vc ? omitColumn : extraCol; 1.30588 + cm.setColumnWidth(adjustCol, Math.max(1, 1.30589 + cm.getColumnWidth(adjustCol)- (tw-aw)), true); 1.30590 + } 1.30591 + 1.30592 + if(preventRefresh !== true){ 1.30593 + this.updateAllColumnWidths(); 1.30594 + } 1.30595 + 1.30596 + 1.30597 + return true; 1.30598 + }, 1.30599 + 1.30600 + autoExpand : function(preventUpdate){ 1.30601 + var g = this.grid, cm = this.cm; 1.30602 + if(!this.userResized && g.autoExpandColumn){ 1.30603 + var tw = cm.getTotalWidth(false); 1.30604 + var aw = this.grid.getGridEl().getWidth(true)-this.scrollOffset; 1.30605 + if(tw != aw){ 1.30606 + var ci = cm.getIndexById(g.autoExpandColumn); 1.30607 + var currentWidth = cm.getColumnWidth(ci); 1.30608 + var cw = Math.min(Math.max(((aw-tw)+currentWidth), g.autoExpandMin), g.autoExpandMax); 1.30609 + if(cw != currentWidth){ 1.30610 + cm.setColumnWidth(ci, cw, true); 1.30611 + if(preventUpdate !== true){ 1.30612 + this.updateColumnWidth(ci, cw); 1.30613 + } 1.30614 + } 1.30615 + } 1.30616 + } 1.30617 + }, 1.30618 + 1.30619 + getColumnData : function(){ 1.30620 + var cs = [], cm = this.cm, colCount = cm.getColumnCount(); 1.30621 + for(var i = 0; i < colCount; i++){ 1.30622 + var name = cm.getDataIndex(i); 1.30623 + cs[i] = { 1.30624 + name : (typeof name == 'undefined' ? this.ds.fields.get(i).name : name), 1.30625 + renderer : cm.getRenderer(i), 1.30626 + id : cm.getColumnId(i), 1.30627 + style : this.getColumnStyle(i) 1.30628 + }; 1.30629 + } 1.30630 + return cs; 1.30631 + }, 1.30632 + 1.30633 + renderRows : function(startRow, endRow){ 1.30634 + var g = this.grid, cm = g.colModel, ds = g.store, stripe = g.stripeRows; 1.30635 + var colCount = cm.getColumnCount(); 1.30636 + 1.30637 + if(ds.getCount() < 1){ 1.30638 + return ""; 1.30639 + } 1.30640 + 1.30641 + var cs = this.getColumnData(); 1.30642 + 1.30643 + startRow = startRow || 0; 1.30644 + endRow = typeof endRow == "undefined"? ds.getCount()-1 : endRow; 1.30645 + 1.30646 + var rs = ds.getRange(startRow, endRow); 1.30647 + 1.30648 + return this.doRender(cs, rs, ds, startRow, colCount, stripe); 1.30649 + }, 1.30650 + 1.30651 + renderBody : function(){ 1.30652 + var markup = this.renderRows(); 1.30653 + return this.templates.body.apply({rows: markup}); 1.30654 + }, 1.30655 + 1.30656 + refreshRow : function(record){ 1.30657 + var ds = this.ds, index; 1.30658 + if(typeof record == 'number'){ 1.30659 + index = record; 1.30660 + record = ds.getAt(index); 1.30661 + }else{ 1.30662 + index = ds.indexOf(record); 1.30663 + } 1.30664 + var cls = []; 1.30665 + this.insertRows(ds, index, index, true); 1.30666 + this.getRow(index).rowIndex = index; 1.30667 + this.onRemove(ds, record, index+1, true); 1.30668 + this.fireEvent("rowupdated", this, index, record); 1.30669 + }, 1.30670 + 1.30671 + 1.30672 + refresh : function(headersToo){ 1.30673 + this.fireEvent("beforerefresh", this); 1.30674 + this.grid.stopEditing(true); 1.30675 + 1.30676 + var result = this.renderBody(); 1.30677 + this.mainBody.update(result); 1.30678 + 1.30679 + if(headersToo === true){ 1.30680 + this.updateHeaders(); 1.30681 + this.updateHeaderSortState(); 1.30682 + } 1.30683 + this.processRows(0, true); 1.30684 + this.layout(); 1.30685 + this.applyEmptyText(); 1.30686 + this.fireEvent("refresh", this); 1.30687 + }, 1.30688 + 1.30689 + applyEmptyText : function(){ 1.30690 + if(this.emptyText && !this.hasRows()){ 1.30691 + this.mainBody.update('<div class="x-grid-empty">' + this.emptyText + '</div>'); 1.30692 + } 1.30693 + }, 1.30694 + 1.30695 + updateHeaderSortState : function(){ 1.30696 + var state = this.ds.getSortState(); 1.30697 + if(!state){ 1.30698 + return; 1.30699 + } 1.30700 + if(!this.sortState || (this.sortState.field != state.field || this.sortState.direction != state.direction)){ 1.30701 + this.grid.fireEvent('sortchange', this.grid, state); 1.30702 + } 1.30703 + this.sortState = state; 1.30704 + var sortColumn = this.cm.findColumnIndex(state.field); 1.30705 + if(sortColumn != -1){ 1.30706 + var sortDir = state.direction; 1.30707 + this.updateSortIcon(sortColumn, sortDir); 1.30708 + } 1.30709 + }, 1.30710 + 1.30711 + destroy : function(){ 1.30712 + if(this.colMenu){ 1.30713 + this.colMenu.removeAll(); 1.30714 + Ext.menu.MenuMgr.unregister(this.colMenu); 1.30715 + this.colMenu.getEl().remove(); 1.30716 + delete this.colMenu; 1.30717 + } 1.30718 + if(this.hmenu){ 1.30719 + this.hmenu.removeAll(); 1.30720 + Ext.menu.MenuMgr.unregister(this.hmenu); 1.30721 + this.hmenu.getEl().remove(); 1.30722 + delete this.hmenu; 1.30723 + } 1.30724 + if(this.grid.enableColumnMove){ 1.30725 + var dds = Ext.dd.DDM.ids['gridHeader' + this.grid.getGridEl().id]; 1.30726 + if(dds){ 1.30727 + for(var dd in dds){ 1.30728 + if(!dds[dd].config.isTarget && dds[dd].dragElId){ 1.30729 + var elid = dds[dd].dragElId; 1.30730 + dds[dd].unreg(); 1.30731 + Ext.get(elid).remove(); 1.30732 + } else if(dds[dd].config.isTarget){ 1.30733 + dds[dd].proxyTop.remove(); 1.30734 + dds[dd].proxyBottom.remove(); 1.30735 + dds[dd].unreg(); 1.30736 + } 1.30737 + if(Ext.dd.DDM.locationCache[dd]){ 1.30738 + delete Ext.dd.DDM.locationCache[dd]; 1.30739 + } 1.30740 + } 1.30741 + delete Ext.dd.DDM.ids['gridHeader' + this.grid.getGridEl().id]; 1.30742 + } 1.30743 + } 1.30744 + 1.30745 + Ext.destroy(this.resizeMarker, this.resizeProxy); 1.30746 + 1.30747 + if(this.dragZone){ 1.30748 + this.dragZone.unreg(); 1.30749 + } 1.30750 + 1.30751 + this.initData(null, null); 1.30752 + Ext.EventManager.removeResizeListener(this.onWindowResize, this); 1.30753 + }, 1.30754 + 1.30755 + onDenyColumnHide : function(){ 1.30756 + 1.30757 + }, 1.30758 + 1.30759 + render : function(){ 1.30760 + 1.30761 + var cm = this.cm; 1.30762 + var colCount = cm.getColumnCount(); 1.30763 + 1.30764 + if(this.autoFill){ 1.30765 + this.fitColumns(true, true); 1.30766 + }else if(this.forceFit){ 1.30767 + this.fitColumns(true, false); 1.30768 + }else if(this.grid.autoExpandColumn){ 1.30769 + this.autoExpand(true); 1.30770 + } 1.30771 + 1.30772 + this.renderUI(); 1.30773 + }, 1.30774 + 1.30775 + 1.30776 + initData : function(ds, cm){ 1.30777 + if(this.ds){ 1.30778 + this.ds.un("load", this.onLoad, this); 1.30779 + this.ds.un("datachanged", this.onDataChange, this); 1.30780 + this.ds.un("add", this.onAdd, this); 1.30781 + this.ds.un("remove", this.onRemove, this); 1.30782 + this.ds.un("update", this.onUpdate, this); 1.30783 + this.ds.un("clear", this.onClear, this); 1.30784 + } 1.30785 + if(ds){ 1.30786 + ds.on("load", this.onLoad, this); 1.30787 + ds.on("datachanged", this.onDataChange, this); 1.30788 + ds.on("add", this.onAdd, this); 1.30789 + ds.on("remove", this.onRemove, this); 1.30790 + ds.on("update", this.onUpdate, this); 1.30791 + ds.on("clear", this.onClear, this); 1.30792 + } 1.30793 + this.ds = ds; 1.30794 + 1.30795 + if(this.cm){ 1.30796 + this.cm.un("configchange", this.onColConfigChange, this); 1.30797 + this.cm.un("widthchange", this.onColWidthChange, this); 1.30798 + this.cm.un("headerchange", this.onHeaderChange, this); 1.30799 + this.cm.un("hiddenchange", this.onHiddenChange, this); 1.30800 + this.cm.un("columnmoved", this.onColumnMove, this); 1.30801 + this.cm.un("columnlockchange", this.onColumnLock, this); 1.30802 + } 1.30803 + if(cm){ 1.30804 + cm.on("configchange", this.onColConfigChange, this); 1.30805 + cm.on("widthchange", this.onColWidthChange, this); 1.30806 + cm.on("headerchange", this.onHeaderChange, this); 1.30807 + cm.on("hiddenchange", this.onHiddenChange, this); 1.30808 + cm.on("columnmoved", this.onColumnMove, this); 1.30809 + cm.on("columnlockchange", this.onColumnLock, this); 1.30810 + } 1.30811 + this.cm = cm; 1.30812 + }, 1.30813 + 1.30814 + onDataChange : function(){ 1.30815 + this.refresh(); 1.30816 + this.updateHeaderSortState(); 1.30817 + }, 1.30818 + 1.30819 + onClear : function(){ 1.30820 + this.refresh(); 1.30821 + }, 1.30822 + 1.30823 + onUpdate : function(ds, record){ 1.30824 + this.refreshRow(record); 1.30825 + }, 1.30826 + 1.30827 + onAdd : function(ds, records, index){ 1.30828 + this.insertRows(ds, index, index + (records.length-1)); 1.30829 + }, 1.30830 + 1.30831 + onRemove : function(ds, record, index, isUpdate){ 1.30832 + if(isUpdate !== true){ 1.30833 + this.fireEvent("beforerowremoved", this, index, record); 1.30834 + } 1.30835 + this.removeRow(index); 1.30836 + if(isUpdate !== true){ 1.30837 + this.processRows(index); 1.30838 + this.applyEmptyText(); 1.30839 + this.fireEvent("rowremoved", this, index, record); 1.30840 + } 1.30841 + }, 1.30842 + 1.30843 + onLoad : function(){ 1.30844 + this.scrollToTop(); 1.30845 + }, 1.30846 + 1.30847 + onColWidthChange : function(cm, col, width){ 1.30848 + this.updateColumnWidth(col, width); 1.30849 + }, 1.30850 + 1.30851 + onHeaderChange : function(cm, col, text){ 1.30852 + this.updateHeaders(); 1.30853 + }, 1.30854 + 1.30855 + onHiddenChange : function(cm, col, hidden){ 1.30856 + this.updateColumnHidden(col, hidden); 1.30857 + }, 1.30858 + 1.30859 + onColumnMove : function(cm, oldIndex, newIndex){ 1.30860 + this.indexMap = null; 1.30861 + var s = this.getScrollState(); 1.30862 + this.refresh(true); 1.30863 + this.restoreScroll(s); 1.30864 + this.afterMove(newIndex); 1.30865 + }, 1.30866 + 1.30867 + onColConfigChange : function(){ 1.30868 + delete this.lastViewWidth; 1.30869 + this.indexMap = null; 1.30870 + this.refresh(true); 1.30871 + }, 1.30872 + 1.30873 + 1.30874 + initUI : function(grid){ 1.30875 + grid.on("headerclick", this.onHeaderClick, this); 1.30876 + 1.30877 + if(grid.trackMouseOver){ 1.30878 + grid.on("mouseover", this.onRowOver, this); 1.30879 + grid.on("mouseout", this.onRowOut, this); 1.30880 + } 1.30881 + }, 1.30882 + 1.30883 + initEvents : function(){ 1.30884 + 1.30885 + }, 1.30886 + 1.30887 + onHeaderClick : function(g, index){ 1.30888 + if(this.headersDisabled || !this.cm.isSortable(index)){ 1.30889 + return; 1.30890 + } 1.30891 + g.stopEditing(true); 1.30892 + g.store.sort(this.cm.getDataIndex(index)); 1.30893 + }, 1.30894 + 1.30895 + onRowOver : function(e, t){ 1.30896 + var row; 1.30897 + if((row = this.findRowIndex(t)) !== false){ 1.30898 + this.addRowClass(row, "x-grid3-row-over"); 1.30899 + } 1.30900 + }, 1.30901 + 1.30902 + onRowOut : function(e, t){ 1.30903 + var row; 1.30904 + if((row = this.findRowIndex(t)) !== false && row !== this.findRowIndex(e.getRelatedTarget())){ 1.30905 + this.removeRowClass(row, "x-grid3-row-over"); 1.30906 + } 1.30907 + }, 1.30908 + 1.30909 + handleWheel : function(e){ 1.30910 + e.stopPropagation(); 1.30911 + }, 1.30912 + 1.30913 + onRowSelect : function(row){ 1.30914 + this.addRowClass(row, "x-grid3-row-selected"); 1.30915 + }, 1.30916 + 1.30917 + onRowDeselect : function(row){ 1.30918 + this.removeRowClass(row, "x-grid3-row-selected"); 1.30919 + }, 1.30920 + 1.30921 + onCellSelect : function(row, col){ 1.30922 + var cell = this.getCell(row, col); 1.30923 + if(cell){ 1.30924 + this.fly(cell).addClass("x-grid3-cell-selected"); 1.30925 + } 1.30926 + }, 1.30927 + 1.30928 + onCellDeselect : function(row, col){ 1.30929 + var cell = this.getCell(row, col); 1.30930 + if(cell){ 1.30931 + this.fly(cell).removeClass("x-grid3-cell-selected"); 1.30932 + } 1.30933 + }, 1.30934 + 1.30935 + onColumnSplitterMoved : function(i, w){ 1.30936 + this.userResized = true; 1.30937 + var cm = this.grid.colModel; 1.30938 + cm.setColumnWidth(i, w, true); 1.30939 + 1.30940 + if(this.forceFit){ 1.30941 + this.fitColumns(true, false, i); 1.30942 + this.updateAllColumnWidths(); 1.30943 + }else{ 1.30944 + this.updateColumnWidth(i, w); 1.30945 + } 1.30946 + 1.30947 + this.grid.fireEvent("columnresize", i, w); 1.30948 + }, 1.30949 + 1.30950 + handleHdMenuClick : function(item){ 1.30951 + var index = this.hdCtxIndex; 1.30952 + var cm = this.cm, ds = this.ds; 1.30953 + switch(item.id){ 1.30954 + case "asc": 1.30955 + ds.sort(cm.getDataIndex(index), "ASC"); 1.30956 + break; 1.30957 + case "desc": 1.30958 + ds.sort(cm.getDataIndex(index), "DESC"); 1.30959 + break; 1.30960 + default: 1.30961 + index = cm.getIndexById(item.id.substr(4)); 1.30962 + if(index != -1){ 1.30963 + if(item.checked && cm.getColumnsBy(this.isHideableColumn, this).length <= 1){ 1.30964 + this.onDenyColumnHide(); 1.30965 + return false; 1.30966 + } 1.30967 + cm.setHidden(index, item.checked); 1.30968 + } 1.30969 + } 1.30970 + return true; 1.30971 + }, 1.30972 + 1.30973 + isHideableColumn : function(c){ 1.30974 + return !c.hidden && !c.fixed; 1.30975 + }, 1.30976 + 1.30977 + beforeColMenuShow : function(){ 1.30978 + var cm = this.cm, colCount = cm.getColumnCount(); 1.30979 + this.colMenu.removeAll(); 1.30980 + for(var i = 0; i < colCount; i++){ 1.30981 + if(cm.config[i].fixed !== true && cm.config[i].hideable !== false){ 1.30982 + this.colMenu.add(new Ext.menu.CheckItem({ 1.30983 + id: "col-"+cm.getColumnId(i), 1.30984 + text: cm.getColumnHeader(i), 1.30985 + checked: !cm.isHidden(i), 1.30986 + hideOnClick:false, 1.30987 + disabled: cm.config[i].hideable === false 1.30988 + })); 1.30989 + } 1.30990 + } 1.30991 + }, 1.30992 + 1.30993 + handleHdDown : function(e, t){ 1.30994 + if(Ext.fly(t).hasClass('x-grid3-hd-btn')){ 1.30995 + e.stopEvent(); 1.30996 + var hd = this.findHeaderCell(t); 1.30997 + Ext.fly(hd).addClass('x-grid3-hd-menu-open'); 1.30998 + var index = this.getCellIndex(hd); 1.30999 + this.hdCtxIndex = index; 1.31000 + var ms = this.hmenu.items, cm = this.cm; 1.31001 + ms.get("asc").setDisabled(!cm.isSortable(index)); 1.31002 + ms.get("desc").setDisabled(!cm.isSortable(index)); 1.31003 + this.hmenu.on("hide", function(){ 1.31004 + Ext.fly(hd).removeClass('x-grid3-hd-menu-open'); 1.31005 + }, this, {single:true}); 1.31006 + this.hmenu.show(t, "tl-bl?"); 1.31007 + } 1.31008 + }, 1.31009 + 1.31010 + handleHdOver : function(e, t){ 1.31011 + var hd = this.findHeaderCell(t); 1.31012 + if(hd && !this.headersDisabled){ 1.31013 + this.activeHd = hd; 1.31014 + this.activeHdIndex = this.getCellIndex(hd); 1.31015 + var fly = this.fly(hd); 1.31016 + this.activeHdRegion = fly.getRegion(); 1.31017 + if(!this.cm.isMenuDisabled(this.activeHdIndex)){ 1.31018 + fly.addClass("x-grid3-hd-over"); 1.31019 + this.activeHdBtn = fly.child('.x-grid3-hd-btn'); 1.31020 + if(this.activeHdBtn){ 1.31021 + this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px'; 1.31022 + } 1.31023 + } 1.31024 + } 1.31025 + }, 1.31026 + 1.31027 + handleHdMove : function(e, t){ 1.31028 + if(this.activeHd && !this.headersDisabled){ 1.31029 + var hw = this.splitHandleWidth || 5; 1.31030 + var r = this.activeHdRegion; 1.31031 + var x = e.getPageX(); 1.31032 + var ss = this.activeHd.style; 1.31033 + if(x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1)){ 1.31034 + ss.cursor = Ext.isAir ? 'move' : Ext.isSafari ? 'e-resize' : 'col-resize'; }else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){ 1.31035 + ss.cursor = Ext.isAir ? 'move' : Ext.isSafari ? 'w-resize' : 'col-resize'; 1.31036 + }else{ 1.31037 + ss.cursor = ''; 1.31038 + } 1.31039 + } 1.31040 + }, 1.31041 + 1.31042 + handleHdOut : function(e, t){ 1.31043 + var hd = this.findHeaderCell(t); 1.31044 + if(hd && (!Ext.isIE || !e.within(hd, true))){ 1.31045 + this.activeHd = null; 1.31046 + this.fly(hd).removeClass("x-grid3-hd-over"); 1.31047 + hd.style.cursor = ''; 1.31048 + } 1.31049 + }, 1.31050 + 1.31051 + hasRows : function(){ 1.31052 + var fc = this.mainBody.dom.firstChild; 1.31053 + return fc && fc.className != 'x-grid-empty'; 1.31054 + }, 1.31055 + 1.31056 + bind : function(d, c){ 1.31057 + this.initData(d, c); 1.31058 + } 1.31059 +}); 1.31060 + 1.31061 + 1.31062 +Ext.grid.GridView.SplitDragZone = function(grid, hd){ 1.31063 + this.grid = grid; 1.31064 + this.view = grid.getView(); 1.31065 + this.marker = this.view.resizeMarker; 1.31066 + this.proxy = this.view.resizeProxy; 1.31067 + Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, hd, 1.31068 + "gridSplitters" + this.grid.getGridEl().id, { 1.31069 + dragElId : Ext.id(this.proxy.dom), resizeFrame:false 1.31070 + }); 1.31071 + this.scroll = false; 1.31072 + this.hw = this.view.splitHandleWidth || 5; 1.31073 +}; 1.31074 +Ext.extend(Ext.grid.GridView.SplitDragZone, Ext.dd.DDProxy, { 1.31075 + 1.31076 + b4StartDrag : function(x, y){ 1.31077 + this.view.headersDisabled = true; 1.31078 + var h = this.view.mainWrap.getHeight(); 1.31079 + this.marker.setHeight(h); 1.31080 + this.marker.show(); 1.31081 + this.marker.alignTo(this.view.getHeaderCell(this.cellIndex), 'tl-tl', [-2, 0]); 1.31082 + this.proxy.setHeight(h); 1.31083 + var w = this.cm.getColumnWidth(this.cellIndex); 1.31084 + var minw = Math.max(w-this.grid.minColumnWidth, 0); 1.31085 + this.resetConstraints(); 1.31086 + this.setXConstraint(minw, 1000); 1.31087 + this.setYConstraint(0, 0); 1.31088 + this.minX = x - minw; 1.31089 + this.maxX = x + 1000; 1.31090 + this.startPos = x; 1.31091 + Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y); 1.31092 + }, 1.31093 + 1.31094 + 1.31095 + handleMouseDown : function(e){ 1.31096 + var t = this.view.findHeaderCell(e.getTarget()); 1.31097 + if(t){ 1.31098 + var xy = this.view.fly(t).getXY(), x = xy[0], y = xy[1]; 1.31099 + var exy = e.getXY(), ex = exy[0], ey = exy[1]; 1.31100 + var w = t.offsetWidth, adjust = false; 1.31101 + if((ex - x) <= this.hw){ 1.31102 + adjust = -1; 1.31103 + }else if((x+w) - ex <= this.hw){ 1.31104 + adjust = 0; 1.31105 + } 1.31106 + if(adjust !== false){ 1.31107 + this.cm = this.grid.colModel; 1.31108 + var ci = this.view.getCellIndex(t); 1.31109 + if(adjust == -1){ 1.31110 + if (ci + adjust < 0) { 1.31111 + return; 1.31112 + } 1.31113 + while(this.cm.isHidden(ci+adjust)){ 1.31114 + --adjust; 1.31115 + if(ci+adjust < 0){ 1.31116 + return; 1.31117 + } 1.31118 + } 1.31119 + } 1.31120 + this.cellIndex = ci+adjust; 1.31121 + this.split = t.dom; 1.31122 + if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){ 1.31123 + Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this, arguments); 1.31124 + } 1.31125 + }else if(this.view.columnDrag){ 1.31126 + this.view.columnDrag.callHandleMouseDown(e); 1.31127 + } 1.31128 + } 1.31129 + }, 1.31130 + 1.31131 + endDrag : function(e){ 1.31132 + this.marker.hide(); 1.31133 + var v = this.view; 1.31134 + var endX = Math.max(this.minX, e.getPageX()); 1.31135 + var diff = endX - this.startPos; 1.31136 + v.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff); 1.31137 + setTimeout(function(){ 1.31138 + v.headersDisabled = false; 1.31139 + }, 50); 1.31140 + }, 1.31141 + 1.31142 + autoOffset : function(){ 1.31143 + this.setDelta(0,0); 1.31144 + } 1.31145 +}); 1.31146 + 1.31147 + 1.31148 +Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, { 1.31149 + 1.31150 + hideGroupedColumn:false, 1.31151 + 1.31152 + showGroupName:true, 1.31153 + 1.31154 + startCollapsed:false, 1.31155 + 1.31156 + enableGrouping:true, 1.31157 + 1.31158 + enableGroupingMenu:true, 1.31159 + 1.31160 + enableNoGroups:true, 1.31161 + 1.31162 + emptyGroupText : '(None)', 1.31163 + 1.31164 + ignoreAdd: false, 1.31165 + 1.31166 + groupTextTpl : '{text}', 1.31167 + 1.31168 + 1.31169 + 1.31170 + 1.31171 + gidSeed : 1000, 1.31172 + 1.31173 + 1.31174 + initTemplates : function(){ 1.31175 + Ext.grid.GroupingView.superclass.initTemplates.call(this); 1.31176 + this.state = {}; 1.31177 + 1.31178 + var sm = this.grid.getSelectionModel(); 1.31179 + sm.on(sm.selectRow ? 'beforerowselect' : 'beforecellselect', 1.31180 + this.onBeforeRowSelect, this); 1.31181 + 1.31182 + if(!this.startGroup){ 1.31183 + this.startGroup = new Ext.XTemplate( 1.31184 + '<div id="{groupId}" class="x-grid-group {cls}">', 1.31185 + '<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div>', this.groupTextTpl ,'</div></div>', 1.31186 + '<div id="{groupId}-bd" class="x-grid-group-body">' 1.31187 + ); 1.31188 + } 1.31189 + this.startGroup.compile(); 1.31190 + this.endGroup = '</div></div>'; 1.31191 + }, 1.31192 + 1.31193 + 1.31194 + findGroup : function(el){ 1.31195 + return Ext.fly(el).up('.x-grid-group', this.mainBody.dom); 1.31196 + }, 1.31197 + 1.31198 + 1.31199 + getGroups : function(){ 1.31200 + return this.hasRows() ? this.mainBody.dom.childNodes : []; 1.31201 + }, 1.31202 + 1.31203 + 1.31204 + onAdd : function(){ 1.31205 + if(this.enableGrouping && !this.ignoreAdd){ 1.31206 + var ss = this.getScrollState(); 1.31207 + this.refresh(); 1.31208 + this.restoreScroll(ss); 1.31209 + }else if(!this.enableGrouping){ 1.31210 + Ext.grid.GroupingView.superclass.onAdd.apply(this, arguments); 1.31211 + } 1.31212 + }, 1.31213 + 1.31214 + 1.31215 + onRemove : function(ds, record, index, isUpdate){ 1.31216 + Ext.grid.GroupingView.superclass.onRemove.apply(this, arguments); 1.31217 + var g = document.getElementById(record._groupId); 1.31218 + if(g && g.childNodes[1].childNodes.length < 1){ 1.31219 + Ext.removeNode(g); 1.31220 + } 1.31221 + this.applyEmptyText(); 1.31222 + }, 1.31223 + 1.31224 + 1.31225 + refreshRow : function(record){ 1.31226 + if(this.ds.getCount()==1){ 1.31227 + this.refresh(); 1.31228 + }else{ 1.31229 + this.isUpdating = true; 1.31230 + Ext.grid.GroupingView.superclass.refreshRow.apply(this, arguments); 1.31231 + this.isUpdating = false; 1.31232 + } 1.31233 + }, 1.31234 + 1.31235 + 1.31236 + beforeMenuShow : function(){ 1.31237 + var field = this.getGroupField(); 1.31238 + var g = this.hmenu.items.get('groupBy'); 1.31239 + if(g){ 1.31240 + g.setDisabled(this.cm.config[this.hdCtxIndex].groupable === false); 1.31241 + } 1.31242 + var s = this.hmenu.items.get('showGroups'); 1.31243 + if(s){ 1.31244 + s.setDisabled(!field && this.cm.config[this.hdCtxIndex].groupable === false); 1.31245 + s.setChecked(!!field, true); 1.31246 + } 1.31247 + }, 1.31248 + 1.31249 + 1.31250 + renderUI : function(){ 1.31251 + Ext.grid.GroupingView.superclass.renderUI.call(this); 1.31252 + this.mainBody.on('mousedown', this.interceptMouse, this); 1.31253 + 1.31254 + if(this.enableGroupingMenu && this.hmenu){ 1.31255 + this.hmenu.add('-',{ 1.31256 + id:'groupBy', 1.31257 + text: this.groupByText, 1.31258 + handler: this.onGroupByClick, 1.31259 + scope: this, 1.31260 + iconCls:'x-group-by-icon' 1.31261 + }); 1.31262 + if(this.enableNoGroups){ 1.31263 + this.hmenu.add({ 1.31264 + id:'showGroups', 1.31265 + text: this.showGroupsText, 1.31266 + checked: true, 1.31267 + checkHandler: this.onShowGroupsClick, 1.31268 + scope: this 1.31269 + }); 1.31270 + } 1.31271 + this.hmenu.on('beforeshow', this.beforeMenuShow, this); 1.31272 + } 1.31273 + }, 1.31274 + 1.31275 + 1.31276 + onGroupByClick : function(){ 1.31277 + this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex)); 1.31278 + this.beforeMenuShow(); 1.31279 + }, 1.31280 + 1.31281 + 1.31282 + onShowGroupsClick : function(mi, checked){ 1.31283 + if(checked){ 1.31284 + this.onGroupByClick(); 1.31285 + }else{ 1.31286 + this.grid.store.clearGrouping(); 1.31287 + } 1.31288 + }, 1.31289 + 1.31290 + 1.31291 + toggleGroup : function(group, expanded){ 1.31292 + this.grid.stopEditing(true); 1.31293 + group = Ext.getDom(group); 1.31294 + var gel = Ext.fly(group); 1.31295 + expanded = expanded !== undefined ? 1.31296 + expanded : gel.hasClass('x-grid-group-collapsed'); 1.31297 + 1.31298 + this.state[gel.dom.id] = expanded; 1.31299 + gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed'); 1.31300 + }, 1.31301 + 1.31302 + 1.31303 + toggleAllGroups : function(expanded){ 1.31304 + var groups = this.getGroups(); 1.31305 + for(var i = 0, len = groups.length; i < len; i++){ 1.31306 + this.toggleGroup(groups[i], expanded); 1.31307 + } 1.31308 + }, 1.31309 + 1.31310 + 1.31311 + expandAllGroups : function(){ 1.31312 + this.toggleAllGroups(true); 1.31313 + }, 1.31314 + 1.31315 + 1.31316 + collapseAllGroups : function(){ 1.31317 + this.toggleAllGroups(false); 1.31318 + }, 1.31319 + 1.31320 + 1.31321 + interceptMouse : function(e){ 1.31322 + var hd = e.getTarget('.x-grid-group-hd', this.mainBody); 1.31323 + if(hd){ 1.31324 + e.stopEvent(); 1.31325 + this.toggleGroup(hd.parentNode); 1.31326 + } 1.31327 + }, 1.31328 + 1.31329 + 1.31330 + getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){ 1.31331 + var g = groupRenderer ? groupRenderer(v, {}, r, rowIndex, colIndex, ds) : String(v); 1.31332 + if(g === ''){ 1.31333 + g = this.cm.config[colIndex].emptyGroupText || this.emptyGroupText; 1.31334 + } 1.31335 + return g; 1.31336 + }, 1.31337 + 1.31338 + 1.31339 + getGroupField : function(){ 1.31340 + return this.grid.store.getGroupState(); 1.31341 + }, 1.31342 + 1.31343 + 1.31344 + renderRows : function(){ 1.31345 + var groupField = this.getGroupField(); 1.31346 + var eg = !!groupField; 1.31347 + 1.31348 + if(this.hideGroupedColumn) { 1.31349 + var colIndex = this.cm.findColumnIndex(groupField); 1.31350 + if(!eg && this.lastGroupField !== undefined) { 1.31351 + this.mainBody.update(''); 1.31352 + this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField), false); 1.31353 + delete this.lastGroupField; 1.31354 + }else if (eg && this.lastGroupField === undefined) { 1.31355 + this.lastGroupField = groupField; 1.31356 + this.cm.setHidden(colIndex, true); 1.31357 + }else if (eg && this.lastGroupField !== undefined && groupField !== this.lastGroupField) { 1.31358 + this.mainBody.update(''); 1.31359 + var oldIndex = this.cm.findColumnIndex(this.lastGroupField); 1.31360 + this.cm.setHidden(oldIndex, false); 1.31361 + this.lastGroupField = groupField; 1.31362 + this.cm.setHidden(colIndex, true); 1.31363 + } 1.31364 + } 1.31365 + return Ext.grid.GroupingView.superclass.renderRows.apply( 1.31366 + this, arguments); 1.31367 + }, 1.31368 + 1.31369 + 1.31370 + doRender : function(cs, rs, ds, startRow, colCount, stripe){ 1.31371 + if(rs.length < 1){ 1.31372 + return ''; 1.31373 + } 1.31374 + var groupField = this.getGroupField(); 1.31375 + var colIndex = this.cm.findColumnIndex(groupField); 1.31376 + 1.31377 + this.enableGrouping = !!groupField; 1.31378 + 1.31379 + if(!this.enableGrouping || this.isUpdating){ 1.31380 + return Ext.grid.GroupingView.superclass.doRender.apply( 1.31381 + this, arguments); 1.31382 + } 1.31383 + var gstyle = 'width:'+this.getTotalWidth()+';'; 1.31384 + 1.31385 + var gidPrefix = this.grid.getGridEl().id; 1.31386 + var cfg = this.cm.config[colIndex]; 1.31387 + var groupRenderer = cfg.groupRenderer || cfg.renderer; 1.31388 + var prefix = this.showGroupName ? 1.31389 + (cfg.groupName || cfg.header)+': ' : ''; 1.31390 + 1.31391 + var groups = [], curGroup, i, len, gid; 1.31392 + for(i = 0, len = rs.length; i < len; i++){ 1.31393 + var rowIndex = startRow + i; 1.31394 + var r = rs[i], 1.31395 + gvalue = r.data[groupField], 1.31396 + g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds); 1.31397 + if(!curGroup || curGroup.group != g){ 1.31398 + gid = gidPrefix + '-gp-' + groupField + '-' + Ext.util.Format.htmlEncode(g); 1.31399 + 1.31400 + 1.31401 + var isCollapsed = typeof this.state[gid] !== 'undefined' ? !this.state[gid] : this.startCollapsed; 1.31402 + var gcls = isCollapsed ? 'x-grid-group-collapsed' : ''; 1.31403 + curGroup = { 1.31404 + group: g, 1.31405 + gvalue: gvalue, 1.31406 + text: prefix + g, 1.31407 + groupId: gid, 1.31408 + startRow: rowIndex, 1.31409 + rs: [r], 1.31410 + cls: gcls, 1.31411 + style: gstyle 1.31412 + }; 1.31413 + groups.push(curGroup); 1.31414 + }else{ 1.31415 + curGroup.rs.push(r); 1.31416 + } 1.31417 + r._groupId = gid; 1.31418 + } 1.31419 + 1.31420 + var buf = []; 1.31421 + for(i = 0, len = groups.length; i < len; i++){ 1.31422 + var g = groups[i]; 1.31423 + this.doGroupStart(buf, g, cs, ds, colCount); 1.31424 + buf[buf.length] = Ext.grid.GroupingView.superclass.doRender.call( 1.31425 + this, cs, g.rs, ds, g.startRow, colCount, stripe); 1.31426 + 1.31427 + this.doGroupEnd(buf, g, cs, ds, colCount); 1.31428 + } 1.31429 + return buf.join(''); 1.31430 + }, 1.31431 + 1.31432 + 1.31433 + getGroupId : function(value){ 1.31434 + var gidPrefix = this.grid.getGridEl().id; 1.31435 + var groupField = this.getGroupField(); 1.31436 + var colIndex = this.cm.findColumnIndex(groupField); 1.31437 + var cfg = this.cm.config[colIndex]; 1.31438 + var groupRenderer = cfg.groupRenderer || cfg.renderer; 1.31439 + var gtext = this.getGroup(value, {data:{}}, groupRenderer, 0, colIndex, this.ds); 1.31440 + return gidPrefix + '-gp-' + groupField + '-' + Ext.util.Format.htmlEncode(value); 1.31441 + }, 1.31442 + 1.31443 + 1.31444 + doGroupStart : function(buf, g, cs, ds, colCount){ 1.31445 + buf[buf.length] = this.startGroup.apply(g); 1.31446 + }, 1.31447 + 1.31448 + 1.31449 + doGroupEnd : function(buf, g, cs, ds, colCount){ 1.31450 + buf[buf.length] = this.endGroup; 1.31451 + }, 1.31452 + 1.31453 + 1.31454 + getRows : function(){ 1.31455 + if(!this.enableGrouping){ 1.31456 + return Ext.grid.GroupingView.superclass.getRows.call(this); 1.31457 + } 1.31458 + var r = []; 1.31459 + var g, gs = this.getGroups(); 1.31460 + for(var i = 0, len = gs.length; i < len; i++){ 1.31461 + g = gs[i].childNodes[1].childNodes; 1.31462 + for(var j = 0, jlen = g.length; j < jlen; j++){ 1.31463 + r[r.length] = g[j]; 1.31464 + } 1.31465 + } 1.31466 + return r; 1.31467 + }, 1.31468 + 1.31469 + 1.31470 + updateGroupWidths : function(){ 1.31471 + if(!this.enableGrouping || !this.hasRows()){ 1.31472 + return; 1.31473 + } 1.31474 + var tw = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth-this.scrollOffset) +'px'; 1.31475 + var gs = this.getGroups(); 1.31476 + for(var i = 0, len = gs.length; i < len; i++){ 1.31477 + gs[i].firstChild.style.width = tw; 1.31478 + } 1.31479 + }, 1.31480 + 1.31481 + 1.31482 + onColumnWidthUpdated : function(col, w, tw){ 1.31483 + this.updateGroupWidths(); 1.31484 + }, 1.31485 + 1.31486 + 1.31487 + onAllColumnWidthsUpdated : function(ws, tw){ 1.31488 + this.updateGroupWidths(); 1.31489 + }, 1.31490 + 1.31491 + 1.31492 + onColumnHiddenUpdated : function(col, hidden, tw){ 1.31493 + this.updateGroupWidths(); 1.31494 + }, 1.31495 + 1.31496 + 1.31497 + onLayout : function(){ 1.31498 + this.updateGroupWidths(); 1.31499 + }, 1.31500 + 1.31501 + 1.31502 + onBeforeRowSelect : function(sm, rowIndex){ 1.31503 + if(!this.enableGrouping){ 1.31504 + return; 1.31505 + } 1.31506 + var row = this.getRow(rowIndex); 1.31507 + if(row && !row.offsetParent){ 1.31508 + var g = this.findGroup(row); 1.31509 + this.toggleGroup(g, true); 1.31510 + } 1.31511 + }, 1.31512 + 1.31513 + 1.31514 + groupByText: 'Group By This Field', 1.31515 + 1.31516 + showGroupsText: 'Show in Groups' 1.31517 +}); 1.31518 + 1.31519 +Ext.grid.GroupingView.GROUP_ID = 1000; 1.31520 + 1.31521 + 1.31522 +Ext.grid.HeaderDragZone = function(grid, hd, hd2){ 1.31523 + this.grid = grid; 1.31524 + this.view = grid.getView(); 1.31525 + this.ddGroup = "gridHeader" + this.grid.getGridEl().id; 1.31526 + Ext.grid.HeaderDragZone.superclass.constructor.call(this, hd); 1.31527 + if(hd2){ 1.31528 + this.setHandleElId(Ext.id(hd)); 1.31529 + this.setOuterHandleElId(Ext.id(hd2)); 1.31530 + } 1.31531 + this.scroll = false; 1.31532 +}; 1.31533 +Ext.extend(Ext.grid.HeaderDragZone, Ext.dd.DragZone, { 1.31534 + maxDragWidth: 120, 1.31535 + getDragData : function(e){ 1.31536 + var t = Ext.lib.Event.getTarget(e); 1.31537 + var h = this.view.findHeaderCell(t); 1.31538 + if(h){ 1.31539 + return {ddel: h.firstChild, header:h}; 1.31540 + } 1.31541 + return false; 1.31542 + }, 1.31543 + 1.31544 + onInitDrag : function(e){ 1.31545 + this.view.headersDisabled = true; 1.31546 + var clone = this.dragData.ddel.cloneNode(true); 1.31547 + clone.id = Ext.id(); 1.31548 + clone.style.width = Math.min(this.dragData.header.offsetWidth,this.maxDragWidth) + "px"; 1.31549 + this.proxy.update(clone); 1.31550 + return true; 1.31551 + }, 1.31552 + 1.31553 + afterValidDrop : function(){ 1.31554 + var v = this.view; 1.31555 + setTimeout(function(){ 1.31556 + v.headersDisabled = false; 1.31557 + }, 50); 1.31558 + }, 1.31559 + 1.31560 + afterInvalidDrop : function(){ 1.31561 + var v = this.view; 1.31562 + setTimeout(function(){ 1.31563 + v.headersDisabled = false; 1.31564 + }, 50); 1.31565 + } 1.31566 +}); 1.31567 + 1.31568 + 1.31569 + 1.31570 +Ext.grid.HeaderDropZone = function(grid, hd, hd2){ 1.31571 + this.grid = grid; 1.31572 + this.view = grid.getView(); 1.31573 + 1.31574 + this.proxyTop = Ext.DomHelper.append(document.body, { 1.31575 + cls:"col-move-top", html:" " 1.31576 + }, true); 1.31577 + this.proxyBottom = Ext.DomHelper.append(document.body, { 1.31578 + cls:"col-move-bottom", html:" " 1.31579 + }, true); 1.31580 + this.proxyTop.hide = this.proxyBottom.hide = function(){ 1.31581 + this.setLeftTop(-100,-100); 1.31582 + this.setStyle("visibility", "hidden"); 1.31583 + }; 1.31584 + this.ddGroup = "gridHeader" + this.grid.getGridEl().id; 1.31585 + 1.31586 + 1.31587 + Ext.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom); 1.31588 +}; 1.31589 +Ext.extend(Ext.grid.HeaderDropZone, Ext.dd.DropZone, { 1.31590 + proxyOffsets : [-4, -9], 1.31591 + fly: Ext.Element.fly, 1.31592 + 1.31593 + getTargetFromEvent : function(e){ 1.31594 + var t = Ext.lib.Event.getTarget(e); 1.31595 + var cindex = this.view.findCellIndex(t); 1.31596 + if(cindex !== false){ 1.31597 + return this.view.getHeaderCell(cindex); 1.31598 + } 1.31599 + }, 1.31600 + 1.31601 + nextVisible : function(h){ 1.31602 + var v = this.view, cm = this.grid.colModel; 1.31603 + h = h.nextSibling; 1.31604 + while(h){ 1.31605 + if(!cm.isHidden(v.getCellIndex(h))){ 1.31606 + return h; 1.31607 + } 1.31608 + h = h.nextSibling; 1.31609 + } 1.31610 + return null; 1.31611 + }, 1.31612 + 1.31613 + prevVisible : function(h){ 1.31614 + var v = this.view, cm = this.grid.colModel; 1.31615 + h = h.prevSibling; 1.31616 + while(h){ 1.31617 + if(!cm.isHidden(v.getCellIndex(h))){ 1.31618 + return h; 1.31619 + } 1.31620 + h = h.prevSibling; 1.31621 + } 1.31622 + return null; 1.31623 + }, 1.31624 + 1.31625 + positionIndicator : function(h, n, e){ 1.31626 + var x = Ext.lib.Event.getPageX(e); 1.31627 + var r = Ext.lib.Dom.getRegion(n.firstChild); 1.31628 + var px, pt, py = r.top + this.proxyOffsets[1]; 1.31629 + if((r.right - x) <= (r.right-r.left)/2){ 1.31630 + px = r.right+this.view.borderWidth; 1.31631 + pt = "after"; 1.31632 + }else{ 1.31633 + px = r.left; 1.31634 + pt = "before"; 1.31635 + } 1.31636 + var oldIndex = this.view.getCellIndex(h); 1.31637 + var newIndex = this.view.getCellIndex(n); 1.31638 + 1.31639 + if(this.grid.colModel.isFixed(newIndex)){ 1.31640 + return false; 1.31641 + } 1.31642 + 1.31643 + var locked = this.grid.colModel.isLocked(newIndex); 1.31644 + 1.31645 + if(pt == "after"){ 1.31646 + newIndex++; 1.31647 + } 1.31648 + if(oldIndex < newIndex){ 1.31649 + newIndex--; 1.31650 + } 1.31651 + if(oldIndex == newIndex && (locked == this.grid.colModel.isLocked(oldIndex))){ 1.31652 + return false; 1.31653 + } 1.31654 + px += this.proxyOffsets[0]; 1.31655 + this.proxyTop.setLeftTop(px, py); 1.31656 + this.proxyTop.show(); 1.31657 + if(!this.bottomOffset){ 1.31658 + this.bottomOffset = this.view.mainHd.getHeight(); 1.31659 + } 1.31660 + this.proxyBottom.setLeftTop(px, py+this.proxyTop.dom.offsetHeight+this.bottomOffset); 1.31661 + this.proxyBottom.show(); 1.31662 + return pt; 1.31663 + }, 1.31664 + 1.31665 + onNodeEnter : function(n, dd, e, data){ 1.31666 + if(data.header != n){ 1.31667 + this.positionIndicator(data.header, n, e); 1.31668 + } 1.31669 + }, 1.31670 + 1.31671 + onNodeOver : function(n, dd, e, data){ 1.31672 + var result = false; 1.31673 + if(data.header != n){ 1.31674 + result = this.positionIndicator(data.header, n, e); 1.31675 + } 1.31676 + if(!result){ 1.31677 + this.proxyTop.hide(); 1.31678 + this.proxyBottom.hide(); 1.31679 + } 1.31680 + return result ? this.dropAllowed : this.dropNotAllowed; 1.31681 + }, 1.31682 + 1.31683 + onNodeOut : function(n, dd, e, data){ 1.31684 + this.proxyTop.hide(); 1.31685 + this.proxyBottom.hide(); 1.31686 + }, 1.31687 + 1.31688 + onNodeDrop : function(n, dd, e, data){ 1.31689 + var h = data.header; 1.31690 + if(h != n){ 1.31691 + var cm = this.grid.colModel; 1.31692 + var x = Ext.lib.Event.getPageX(e); 1.31693 + var r = Ext.lib.Dom.getRegion(n.firstChild); 1.31694 + var pt = (r.right - x) <= ((r.right-r.left)/2) ? "after" : "before"; 1.31695 + var oldIndex = this.view.getCellIndex(h); 1.31696 + var newIndex = this.view.getCellIndex(n); 1.31697 + var locked = cm.isLocked(newIndex); 1.31698 + if(pt == "after"){ 1.31699 + newIndex++; 1.31700 + } 1.31701 + if(oldIndex < newIndex){ 1.31702 + newIndex--; 1.31703 + } 1.31704 + if(oldIndex == newIndex && (locked == cm.isLocked(oldIndex))){ 1.31705 + return false; 1.31706 + } 1.31707 + cm.setLocked(oldIndex, locked, true); 1.31708 + cm.moveColumn(oldIndex, newIndex); 1.31709 + this.grid.fireEvent("columnmove", oldIndex, newIndex); 1.31710 + return true; 1.31711 + } 1.31712 + return false; 1.31713 + } 1.31714 +}); 1.31715 + 1.31716 + 1.31717 +Ext.grid.GridView.ColumnDragZone = function(grid, hd){ 1.31718 + Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this, grid, hd, null); 1.31719 + this.proxy.el.addClass('x-grid3-col-dd'); 1.31720 +}; 1.31721 + 1.31722 +Ext.extend(Ext.grid.GridView.ColumnDragZone, Ext.grid.HeaderDragZone, { 1.31723 + handleMouseDown : function(e){ 1.31724 + 1.31725 + }, 1.31726 + 1.31727 + callHandleMouseDown : function(e){ 1.31728 + Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this, e); 1.31729 + } 1.31730 +}); 1.31731 +Ext.grid.SplitDragZone = function(grid, hd, hd2){ 1.31732 + this.grid = grid; 1.31733 + this.view = grid.getView(); 1.31734 + this.proxy = this.view.resizeProxy; 1.31735 + Ext.grid.SplitDragZone.superclass.constructor.call(this, hd, 1.31736 + "gridSplitters" + this.grid.getGridEl().id, { 1.31737 + dragElId : Ext.id(this.proxy.dom), resizeFrame:false 1.31738 + }); 1.31739 + this.setHandleElId(Ext.id(hd)); 1.31740 + this.setOuterHandleElId(Ext.id(hd2)); 1.31741 + this.scroll = false; 1.31742 +}; 1.31743 +Ext.extend(Ext.grid.SplitDragZone, Ext.dd.DDProxy, { 1.31744 + fly: Ext.Element.fly, 1.31745 + 1.31746 + b4StartDrag : function(x, y){ 1.31747 + this.view.headersDisabled = true; 1.31748 + this.proxy.setHeight(this.view.mainWrap.getHeight()); 1.31749 + var w = this.cm.getColumnWidth(this.cellIndex); 1.31750 + var minw = Math.max(w-this.grid.minColumnWidth, 0); 1.31751 + this.resetConstraints(); 1.31752 + this.setXConstraint(minw, 1000); 1.31753 + this.setYConstraint(0, 0); 1.31754 + this.minX = x - minw; 1.31755 + this.maxX = x + 1000; 1.31756 + this.startPos = x; 1.31757 + Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y); 1.31758 + }, 1.31759 + 1.31760 + 1.31761 + handleMouseDown : function(e){ 1.31762 + ev = Ext.EventObject.setEvent(e); 1.31763 + var t = this.fly(ev.getTarget()); 1.31764 + if(t.hasClass("x-grid-split")){ 1.31765 + this.cellIndex = this.view.getCellIndex(t.dom); 1.31766 + this.split = t.dom; 1.31767 + this.cm = this.grid.colModel; 1.31768 + if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){ 1.31769 + Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments); 1.31770 + } 1.31771 + } 1.31772 + }, 1.31773 + 1.31774 + endDrag : function(e){ 1.31775 + this.view.headersDisabled = false; 1.31776 + var endX = Math.max(this.minX, Ext.lib.Event.getPageX(e)); 1.31777 + var diff = endX - this.startPos; 1.31778 + this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff); 1.31779 + }, 1.31780 + 1.31781 + autoOffset : function(){ 1.31782 + this.setDelta(0,0); 1.31783 + } 1.31784 +}); 1.31785 +Ext.grid.GridDragZone = function(grid, config){ 1.31786 + this.view = grid.getView(); 1.31787 + Ext.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config); 1.31788 + if(this.view.lockedBody){ 1.31789 + this.setHandleElId(Ext.id(this.view.mainBody.dom)); 1.31790 + this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom)); 1.31791 + } 1.31792 + this.scroll = false; 1.31793 + this.grid = grid; 1.31794 + this.ddel = document.createElement('div'); 1.31795 + this.ddel.className = 'x-grid-dd-wrap'; 1.31796 +}; 1.31797 + 1.31798 +Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, { 1.31799 + ddGroup : "GridDD", 1.31800 + 1.31801 + getDragData : function(e){ 1.31802 + var t = Ext.lib.Event.getTarget(e); 1.31803 + var rowIndex = this.view.findRowIndex(t); 1.31804 + if(rowIndex !== false){ 1.31805 + var sm = this.grid.selModel; 1.31806 + if(!sm.isSelected(rowIndex) || e.hasModifier()){ 1.31807 + sm.handleMouseDown(this.grid, rowIndex, e); 1.31808 + } 1.31809 + return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()}; 1.31810 + } 1.31811 + return false; 1.31812 + }, 1.31813 + 1.31814 + onInitDrag : function(e){ 1.31815 + var data = this.dragData; 1.31816 + this.ddel.innerHTML = this.grid.getDragDropText(); 1.31817 + this.proxy.update(this.ddel); 1.31818 + }, 1.31819 + 1.31820 + afterRepair : function(){ 1.31821 + this.dragging = false; 1.31822 + }, 1.31823 + 1.31824 + getRepairXY : function(e, data){ 1.31825 + return false; 1.31826 + }, 1.31827 + 1.31828 + onEndDrag : function(data, e){ 1.31829 + }, 1.31830 + 1.31831 + onValidDrop : function(dd, e, id){ 1.31832 + this.hideProxy(); 1.31833 + }, 1.31834 + 1.31835 + beforeInvalidDrop : function(e, id){ 1.31836 + 1.31837 + } 1.31838 +}); 1.31839 + 1.31840 + 1.31841 +Ext.grid.ColumnModel = function(config){ 1.31842 + 1.31843 + this.defaultWidth = 100; 1.31844 + 1.31845 + 1.31846 + this.defaultSortable = false; 1.31847 + 1.31848 + 1.31849 + if(config.columns){ 1.31850 + Ext.apply(this, config); 1.31851 + this.setConfig(config.columns, true); 1.31852 + }else{ 1.31853 + this.setConfig(config, true); 1.31854 + } 1.31855 + this.addEvents( 1.31856 + 1.31857 + "widthchange", 1.31858 + 1.31859 + "headerchange", 1.31860 + 1.31861 + "hiddenchange", 1.31862 + 1.31863 + "columnmoved", 1.31864 + "columnlockchange", 1.31865 + 1.31866 + "configchange" 1.31867 + ); 1.31868 + Ext.grid.ColumnModel.superclass.constructor.call(this); 1.31869 +}; 1.31870 +Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, { 1.31871 + 1.31872 + 1.31873 + 1.31874 + 1.31875 + 1.31876 + 1.31877 + 1.31878 + 1.31879 + 1.31880 + 1.31881 + 1.31882 + 1.31883 + 1.31884 + 1.31885 + 1.31886 + 1.31887 + 1.31888 + getColumnId : function(index){ 1.31889 + return this.config[index].id; 1.31890 + }, 1.31891 + 1.31892 + 1.31893 + setConfig : function(config, initial){ 1.31894 + if(!initial){ delete this.totalWidth; 1.31895 + for(var i = 0, len = this.config.length; i < len; i++){ 1.31896 + var c = this.config[i]; 1.31897 + if(c.editor){ 1.31898 + c.editor.destroy(); 1.31899 + } 1.31900 + } 1.31901 + } 1.31902 + this.config = config; 1.31903 + this.lookup = {}; 1.31904 + for(var i = 0, len = config.length; i < len; i++){ 1.31905 + var c = config[i]; 1.31906 + if(typeof c.renderer == "string"){ 1.31907 + c.renderer = Ext.util.Format[c.renderer]; 1.31908 + } 1.31909 + if(typeof c.id == "undefined"){ 1.31910 + c.id = i; 1.31911 + } 1.31912 + if(c.editor && c.editor.isFormField){ 1.31913 + c.editor = new Ext.grid.GridEditor(c.editor); 1.31914 + } 1.31915 + this.lookup[c.id] = c; 1.31916 + } 1.31917 + if(!initial){ 1.31918 + this.fireEvent('configchange', this); 1.31919 + } 1.31920 + }, 1.31921 + 1.31922 + 1.31923 + getColumnById : function(id){ 1.31924 + return this.lookup[id]; 1.31925 + }, 1.31926 + 1.31927 + 1.31928 + getIndexById : function(id){ 1.31929 + for(var i = 0, len = this.config.length; i < len; i++){ 1.31930 + if(this.config[i].id == id){ 1.31931 + return i; 1.31932 + } 1.31933 + } 1.31934 + return -1; 1.31935 + }, 1.31936 + 1.31937 + moveColumn : function(oldIndex, newIndex){ 1.31938 + var c = this.config[oldIndex]; 1.31939 + this.config.splice(oldIndex, 1); 1.31940 + this.config.splice(newIndex, 0, c); 1.31941 + this.dataMap = null; 1.31942 + this.fireEvent("columnmoved", this, oldIndex, newIndex); 1.31943 + }, 1.31944 + 1.31945 + isLocked : function(colIndex){ 1.31946 + return this.config[colIndex].locked === true; 1.31947 + }, 1.31948 + 1.31949 + setLocked : function(colIndex, value, suppressEvent){ 1.31950 + if(this.isLocked(colIndex) == value){ 1.31951 + return; 1.31952 + } 1.31953 + this.config[colIndex].locked = value; 1.31954 + if(!suppressEvent){ 1.31955 + this.fireEvent("columnlockchange", this, colIndex, value); 1.31956 + } 1.31957 + }, 1.31958 + 1.31959 + getTotalLockedWidth : function(){ 1.31960 + var totalWidth = 0; 1.31961 + for(var i = 0; i < this.config.length; i++){ 1.31962 + if(this.isLocked(i) && !this.isHidden(i)){ 1.31963 + this.totalWidth += this.getColumnWidth(i); 1.31964 + } 1.31965 + } 1.31966 + return totalWidth; 1.31967 + }, 1.31968 + 1.31969 + getLockedCount : function(){ 1.31970 + for(var i = 0, len = this.config.length; i < len; i++){ 1.31971 + if(!this.isLocked(i)){ 1.31972 + return i; 1.31973 + } 1.31974 + } 1.31975 + }, 1.31976 + 1.31977 + 1.31978 + getColumnCount : function(visibleOnly){ 1.31979 + if(visibleOnly === true){ 1.31980 + var c = 0; 1.31981 + for(var i = 0, len = this.config.length; i < len; i++){ 1.31982 + if(!this.isHidden(i)){ 1.31983 + c++; 1.31984 + } 1.31985 + } 1.31986 + return c; 1.31987 + } 1.31988 + return this.config.length; 1.31989 + }, 1.31990 + 1.31991 + 1.31992 + getColumnsBy : function(fn, scope){ 1.31993 + var r = []; 1.31994 + for(var i = 0, len = this.config.length; i < len; i++){ 1.31995 + var c = this.config[i]; 1.31996 + if(fn.call(scope||this, c, i) === true){ 1.31997 + r[r.length] = c; 1.31998 + } 1.31999 + } 1.32000 + return r; 1.32001 + }, 1.32002 + 1.32003 + 1.32004 + isSortable : function(col){ 1.32005 + if(typeof this.config[col].sortable == "undefined"){ 1.32006 + return this.defaultSortable; 1.32007 + } 1.32008 + return this.config[col].sortable; 1.32009 + }, 1.32010 + 1.32011 + 1.32012 + isMenuDisabled : function(col){ 1.32013 + return !!this.config[col].menuDisabled; 1.32014 + }, 1.32015 + 1.32016 + 1.32017 + getRenderer : function(col){ 1.32018 + if(!this.config[col].renderer){ 1.32019 + return Ext.grid.ColumnModel.defaultRenderer; 1.32020 + } 1.32021 + return this.config[col].renderer; 1.32022 + }, 1.32023 + 1.32024 + 1.32025 + setRenderer : function(col, fn){ 1.32026 + this.config[col].renderer = fn; 1.32027 + }, 1.32028 + 1.32029 + 1.32030 + getColumnWidth : function(col){ 1.32031 + return this.config[col].width || this.defaultWidth; 1.32032 + }, 1.32033 + 1.32034 + 1.32035 + setColumnWidth : function(col, width, suppressEvent){ 1.32036 + this.config[col].width = width; 1.32037 + this.totalWidth = null; 1.32038 + if(!suppressEvent){ 1.32039 + this.fireEvent("widthchange", this, col, width); 1.32040 + } 1.32041 + }, 1.32042 + 1.32043 + 1.32044 + getTotalWidth : function(includeHidden){ 1.32045 + if(!this.totalWidth){ 1.32046 + this.totalWidth = 0; 1.32047 + for(var i = 0, len = this.config.length; i < len; i++){ 1.32048 + if(includeHidden || !this.isHidden(i)){ 1.32049 + this.totalWidth += this.getColumnWidth(i); 1.32050 + } 1.32051 + } 1.32052 + } 1.32053 + return this.totalWidth; 1.32054 + }, 1.32055 + 1.32056 + 1.32057 + getColumnHeader : function(col){ 1.32058 + return this.config[col].header; 1.32059 + }, 1.32060 + 1.32061 + 1.32062 + setColumnHeader : function(col, header){ 1.32063 + this.config[col].header = header; 1.32064 + this.fireEvent("headerchange", this, col, header); 1.32065 + }, 1.32066 + 1.32067 + 1.32068 + getColumnTooltip : function(col){ 1.32069 + return this.config[col].tooltip; 1.32070 + }, 1.32071 + 1.32072 + setColumnTooltip : function(col, tooltip){ 1.32073 + this.config[col].tooltip = tooltip; 1.32074 + }, 1.32075 + 1.32076 + 1.32077 + getDataIndex : function(col){ 1.32078 + return this.config[col].dataIndex; 1.32079 + }, 1.32080 + 1.32081 + 1.32082 + setDataIndex : function(col, dataIndex){ 1.32083 + this.config[col].dataIndex = dataIndex; 1.32084 + }, 1.32085 + 1.32086 + 1.32087 + findColumnIndex : function(dataIndex){ 1.32088 + var c = this.config; 1.32089 + for(var i = 0, len = c.length; i < len; i++){ 1.32090 + if(c[i].dataIndex == dataIndex){ 1.32091 + return i; 1.32092 + } 1.32093 + } 1.32094 + return -1; 1.32095 + }, 1.32096 + 1.32097 + 1.32098 + isCellEditable : function(colIndex, rowIndex){ 1.32099 + return (this.config[colIndex].editable || (typeof this.config[colIndex].editable == "undefined" && this.config[colIndex].editor)) ? true : false; 1.32100 + }, 1.32101 + 1.32102 + 1.32103 + getCellEditor : function(colIndex, rowIndex){ 1.32104 + return this.config[colIndex].editor; 1.32105 + }, 1.32106 + 1.32107 + 1.32108 + setEditable : function(col, editable){ 1.32109 + this.config[col].editable = editable; 1.32110 + }, 1.32111 + 1.32112 + 1.32113 + 1.32114 + isHidden : function(colIndex){ 1.32115 + return this.config[colIndex].hidden; 1.32116 + }, 1.32117 + 1.32118 + 1.32119 + 1.32120 + isFixed : function(colIndex){ 1.32121 + return this.config[colIndex].fixed; 1.32122 + }, 1.32123 + 1.32124 + 1.32125 + isResizable : function(colIndex){ 1.32126 + return colIndex >= 0 && this.config[colIndex].resizable !== false && this.config[colIndex].fixed !== true; 1.32127 + }, 1.32128 + 1.32129 + setHidden : function(colIndex, hidden){ 1.32130 + var c = this.config[colIndex]; 1.32131 + if(c.hidden !== hidden){ 1.32132 + c.hidden = hidden; 1.32133 + this.totalWidth = null; 1.32134 + this.fireEvent("hiddenchange", this, colIndex, hidden); 1.32135 + } 1.32136 + }, 1.32137 + 1.32138 + 1.32139 + setEditor : function(col, editor){ 1.32140 + this.config[col].editor = editor; 1.32141 + } 1.32142 +}); 1.32143 + 1.32144 +Ext.grid.ColumnModel.defaultRenderer = function(value){ 1.32145 + if(typeof value == "string" && value.length < 1){ 1.32146 + return " "; 1.32147 + } 1.32148 + return value; 1.32149 +}; 1.32150 + 1.32151 +Ext.grid.DefaultColumnModel = Ext.grid.ColumnModel; 1.32152 + 1.32153 + 1.32154 +Ext.grid.AbstractSelectionModel = function(){ 1.32155 + this.locked = false; 1.32156 + Ext.grid.AbstractSelectionModel.superclass.constructor.call(this); 1.32157 +}; 1.32158 + 1.32159 +Ext.extend(Ext.grid.AbstractSelectionModel, Ext.util.Observable, { 1.32160 + 1.32161 + init : function(grid){ 1.32162 + this.grid = grid; 1.32163 + this.initEvents(); 1.32164 + }, 1.32165 + 1.32166 + 1.32167 + lock : function(){ 1.32168 + this.locked = true; 1.32169 + }, 1.32170 + 1.32171 + 1.32172 + unlock : function(){ 1.32173 + this.locked = false; 1.32174 + }, 1.32175 + 1.32176 + 1.32177 + isLocked : function(){ 1.32178 + return this.locked; 1.32179 + } 1.32180 +}); 1.32181 + 1.32182 +Ext.grid.RowSelectionModel = function(config){ 1.32183 + Ext.apply(this, config); 1.32184 + this.selections = new Ext.util.MixedCollection(false, function(o){ 1.32185 + return o.id; 1.32186 + }); 1.32187 + 1.32188 + this.last = false; 1.32189 + this.lastActive = false; 1.32190 + 1.32191 + this.addEvents( 1.32192 + 1.32193 + "selectionchange", 1.32194 + 1.32195 + "beforerowselect", 1.32196 + 1.32197 + "rowselect", 1.32198 + 1.32199 + "rowdeselect" 1.32200 + ); 1.32201 + 1.32202 + Ext.grid.RowSelectionModel.superclass.constructor.call(this); 1.32203 +}; 1.32204 + 1.32205 +Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, { 1.32206 + 1.32207 + singleSelect : false, 1.32208 + 1.32209 + 1.32210 + initEvents : function(){ 1.32211 + 1.32212 + if(!this.grid.enableDragDrop && !this.grid.enableDrag){ 1.32213 + this.grid.on("rowmousedown", this.handleMouseDown, this); 1.32214 + }else{ this.grid.on("rowclick", function(grid, rowIndex, e) { 1.32215 + if(e.button === 0 && !e.shiftKey && !e.ctrlKey) { 1.32216 + this.selectRow(rowIndex, false); 1.32217 + grid.view.focusRow(rowIndex); 1.32218 + } 1.32219 + }, this); 1.32220 + } 1.32221 + 1.32222 + this.rowNav = new Ext.KeyNav(this.grid.getGridEl(), { 1.32223 + "up" : function(e){ 1.32224 + if(!e.shiftKey){ 1.32225 + this.selectPrevious(e.shiftKey); 1.32226 + }else if(this.last !== false && this.lastActive !== false){ 1.32227 + var last = this.last; 1.32228 + this.selectRange(this.last, this.lastActive-1); 1.32229 + this.grid.getView().focusRow(this.lastActive); 1.32230 + if(last !== false){ 1.32231 + this.last = last; 1.32232 + } 1.32233 + }else{ 1.32234 + this.selectFirstRow(); 1.32235 + } 1.32236 + }, 1.32237 + "down" : function(e){ 1.32238 + if(!e.shiftKey){ 1.32239 + this.selectNext(e.shiftKey); 1.32240 + }else if(this.last !== false && this.lastActive !== false){ 1.32241 + var last = this.last; 1.32242 + this.selectRange(this.last, this.lastActive+1); 1.32243 + this.grid.getView().focusRow(this.lastActive); 1.32244 + if(last !== false){ 1.32245 + this.last = last; 1.32246 + } 1.32247 + }else{ 1.32248 + this.selectFirstRow(); 1.32249 + } 1.32250 + }, 1.32251 + scope: this 1.32252 + }); 1.32253 + 1.32254 + var view = this.grid.view; 1.32255 + view.on("refresh", this.onRefresh, this); 1.32256 + view.on("rowupdated", this.onRowUpdated, this); 1.32257 + view.on("rowremoved", this.onRemove, this); 1.32258 + }, 1.32259 + 1.32260 + onRefresh : function(){ 1.32261 + var ds = this.grid.store, index; 1.32262 + var s = this.getSelections(); 1.32263 + this.clearSelections(true); 1.32264 + for(var i = 0, len = s.length; i < len; i++){ 1.32265 + var r = s[i]; 1.32266 + if((index = ds.indexOfId(r.id)) != -1){ 1.32267 + this.selectRow(index, true); 1.32268 + } 1.32269 + } 1.32270 + if(s.length != this.selections.getCount()){ 1.32271 + this.fireEvent("selectionchange", this); 1.32272 + } 1.32273 + }, 1.32274 + 1.32275 + onRemove : function(v, index, r){ 1.32276 + if(this.selections.remove(r) !== false){ 1.32277 + this.fireEvent('selectionchange', this); 1.32278 + } 1.32279 + }, 1.32280 + 1.32281 + onRowUpdated : function(v, index, r){ 1.32282 + if(this.isSelected(r)){ 1.32283 + v.onRowSelect(index); 1.32284 + } 1.32285 + }, 1.32286 + 1.32287 + 1.32288 + selectRecords : function(records, keepExisting){ 1.32289 + if(!keepExisting){ 1.32290 + this.clearSelections(); 1.32291 + } 1.32292 + var ds = this.grid.store; 1.32293 + for(var i = 0, len = records.length; i < len; i++){ 1.32294 + this.selectRow(ds.indexOf(records[i]), true); 1.32295 + } 1.32296 + }, 1.32297 + 1.32298 + 1.32299 + getCount : function(){ 1.32300 + return this.selections.length; 1.32301 + }, 1.32302 + 1.32303 + 1.32304 + selectFirstRow : function(){ 1.32305 + this.selectRow(0); 1.32306 + }, 1.32307 + 1.32308 + 1.32309 + selectLastRow : function(keepExisting){ 1.32310 + this.selectRow(this.grid.store.getCount() - 1, keepExisting); 1.32311 + }, 1.32312 + 1.32313 + 1.32314 + selectNext : function(keepExisting){ 1.32315 + if(this.hasNext()){ 1.32316 + this.selectRow(this.last+1, keepExisting); 1.32317 + this.grid.getView().focusRow(this.last); 1.32318 + return true; 1.32319 + } 1.32320 + return false; 1.32321 + }, 1.32322 + 1.32323 + 1.32324 + selectPrevious : function(keepExisting){ 1.32325 + if(this.hasPrevious()){ 1.32326 + this.selectRow(this.last-1, keepExisting); 1.32327 + this.grid.getView().focusRow(this.last); 1.32328 + return true; 1.32329 + } 1.32330 + return false; 1.32331 + }, 1.32332 + 1.32333 + 1.32334 + hasNext : function(){ 1.32335 + return this.last !== false && (this.last+1) < this.grid.store.getCount(); 1.32336 + }, 1.32337 + 1.32338 + 1.32339 + hasPrevious : function(){ 1.32340 + return !!this.last; 1.32341 + }, 1.32342 + 1.32343 + 1.32344 + 1.32345 + getSelections : function(){ 1.32346 + return [].concat(this.selections.items); 1.32347 + }, 1.32348 + 1.32349 + 1.32350 + getSelected : function(){ 1.32351 + return this.selections.itemAt(0); 1.32352 + }, 1.32353 + 1.32354 + 1.32355 + each : function(fn, scope){ 1.32356 + var s = this.getSelections(); 1.32357 + for(var i = 0, len = s.length; i < len; i++){ 1.32358 + if(fn.call(scope || this, s[i], i) === false){ 1.32359 + return false; 1.32360 + } 1.32361 + } 1.32362 + return true; 1.32363 + }, 1.32364 + 1.32365 + 1.32366 + clearSelections : function(fast){ 1.32367 + if(this.locked) return; 1.32368 + if(fast !== true){ 1.32369 + var ds = this.grid.store; 1.32370 + var s = this.selections; 1.32371 + s.each(function(r){ 1.32372 + this.deselectRow(ds.indexOfId(r.id)); 1.32373 + }, this); 1.32374 + s.clear(); 1.32375 + }else{ 1.32376 + this.selections.clear(); 1.32377 + } 1.32378 + this.last = false; 1.32379 + }, 1.32380 + 1.32381 + 1.32382 + 1.32383 + selectAll : function(){ 1.32384 + if(this.locked) return; 1.32385 + this.selections.clear(); 1.32386 + for(var i = 0, len = this.grid.store.getCount(); i < len; i++){ 1.32387 + this.selectRow(i, true); 1.32388 + } 1.32389 + }, 1.32390 + 1.32391 + 1.32392 + hasSelection : function(){ 1.32393 + return this.selections.length > 0; 1.32394 + }, 1.32395 + 1.32396 + 1.32397 + isSelected : function(index){ 1.32398 + var r = typeof index == "number" ? this.grid.store.getAt(index) : index; 1.32399 + return (r && this.selections.key(r.id) ? true : false); 1.32400 + }, 1.32401 + 1.32402 + 1.32403 + isIdSelected : function(id){ 1.32404 + return (this.selections.key(id) ? true : false); 1.32405 + }, 1.32406 + 1.32407 + handleMouseDown : function(g, rowIndex, e){ 1.32408 + if(e.button !== 0 || this.isLocked()){ 1.32409 + return; 1.32410 + }; 1.32411 + var view = this.grid.getView(); 1.32412 + if(e.shiftKey && this.last !== false){ 1.32413 + var last = this.last; 1.32414 + this.selectRange(last, rowIndex, e.ctrlKey); 1.32415 + this.last = last; view.focusRow(rowIndex); 1.32416 + }else{ 1.32417 + var isSelected = this.isSelected(rowIndex); 1.32418 + if(e.ctrlKey && isSelected){ 1.32419 + this.deselectRow(rowIndex); 1.32420 + }else if(!isSelected || this.getCount() > 1){ 1.32421 + this.selectRow(rowIndex, e.ctrlKey || e.shiftKey); 1.32422 + view.focusRow(rowIndex); 1.32423 + } 1.32424 + } 1.32425 + }, 1.32426 + 1.32427 + 1.32428 + selectRows : function(rows, keepExisting){ 1.32429 + if(!keepExisting){ 1.32430 + this.clearSelections(); 1.32431 + } 1.32432 + for(var i = 0, len = rows.length; i < len; i++){ 1.32433 + this.selectRow(rows[i], true); 1.32434 + } 1.32435 + }, 1.32436 + 1.32437 + 1.32438 + selectRange : function(startRow, endRow, keepExisting){ 1.32439 + if(this.locked) return; 1.32440 + if(!keepExisting){ 1.32441 + this.clearSelections(); 1.32442 + } 1.32443 + if(startRow <= endRow){ 1.32444 + for(var i = startRow; i <= endRow; i++){ 1.32445 + this.selectRow(i, true); 1.32446 + } 1.32447 + }else{ 1.32448 + for(var i = startRow; i >= endRow; i--){ 1.32449 + this.selectRow(i, true); 1.32450 + } 1.32451 + } 1.32452 + }, 1.32453 + 1.32454 + 1.32455 + deselectRange : function(startRow, endRow, preventViewNotify){ 1.32456 + if(this.locked) return; 1.32457 + for(var i = startRow; i <= endRow; i++){ 1.32458 + this.deselectRow(i, preventViewNotify); 1.32459 + } 1.32460 + }, 1.32461 + 1.32462 + 1.32463 + selectRow : function(index, keepExisting, preventViewNotify){ 1.32464 + if(this.locked || (index < 0 || index >= this.grid.store.getCount())) return; 1.32465 + var r = this.grid.store.getAt(index); 1.32466 + if(r && this.fireEvent("beforerowselect", this, index, keepExisting, r) !== false){ 1.32467 + if(!keepExisting || this.singleSelect){ 1.32468 + this.clearSelections(); 1.32469 + } 1.32470 + this.selections.add(r); 1.32471 + this.last = this.lastActive = index; 1.32472 + if(!preventViewNotify){ 1.32473 + this.grid.getView().onRowSelect(index); 1.32474 + } 1.32475 + this.fireEvent("rowselect", this, index, r); 1.32476 + this.fireEvent("selectionchange", this); 1.32477 + } 1.32478 + }, 1.32479 + 1.32480 + 1.32481 + deselectRow : function(index, preventViewNotify){ 1.32482 + if(this.locked) return; 1.32483 + if(this.last == index){ 1.32484 + this.last = false; 1.32485 + } 1.32486 + if(this.lastActive == index){ 1.32487 + this.lastActive = false; 1.32488 + } 1.32489 + var r = this.grid.store.getAt(index); 1.32490 + if(r){ 1.32491 + this.selections.remove(r); 1.32492 + if(!preventViewNotify){ 1.32493 + this.grid.getView().onRowDeselect(index); 1.32494 + } 1.32495 + this.fireEvent("rowdeselect", this, index, r); 1.32496 + this.fireEvent("selectionchange", this); 1.32497 + } 1.32498 + }, 1.32499 + 1.32500 + restoreLast : function(){ 1.32501 + if(this._last){ 1.32502 + this.last = this._last; 1.32503 + } 1.32504 + }, 1.32505 + 1.32506 + acceptsNav : function(row, col, cm){ 1.32507 + return !cm.isHidden(col) && cm.isCellEditable(col, row); 1.32508 + }, 1.32509 + 1.32510 + onEditorKey : function(field, e){ 1.32511 + var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor; 1.32512 + var shift = e.shiftKey; 1.32513 + if(k == e.TAB){ 1.32514 + e.stopEvent(); 1.32515 + ed.completeEdit(); 1.32516 + if(shift){ 1.32517 + newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this); 1.32518 + }else{ 1.32519 + newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this); 1.32520 + } 1.32521 + }else if(k == e.ENTER){ 1.32522 + e.stopEvent(); 1.32523 + ed.completeEdit(); 1.32524 + if(this.moveEditorOnEnter !== false){ 1.32525 + if(shift){ 1.32526 + newCell = g.walkCells(ed.row - 1, ed.col, -1, this.acceptsNav, this); 1.32527 + }else{ 1.32528 + newCell = g.walkCells(ed.row + 1, ed.col, 1, this.acceptsNav, this); 1.32529 + } 1.32530 + } 1.32531 + }else if(k == e.ESC){ 1.32532 + ed.cancelEdit(); 1.32533 + } 1.32534 + if(newCell){ 1.32535 + g.startEditing(newCell[0], newCell[1]); 1.32536 + } 1.32537 + } 1.32538 +}); 1.32539 + 1.32540 +Ext.grid.CellSelectionModel = function(config){ 1.32541 + Ext.apply(this, config); 1.32542 + 1.32543 + this.selection = null; 1.32544 + 1.32545 + this.addEvents( 1.32546 + 1.32547 + "beforecellselect", 1.32548 + 1.32549 + "cellselect", 1.32550 + 1.32551 + "selectionchange" 1.32552 + ); 1.32553 + 1.32554 + Ext.grid.CellSelectionModel.superclass.constructor.call(this); 1.32555 +}; 1.32556 + 1.32557 +Ext.extend(Ext.grid.CellSelectionModel, Ext.grid.AbstractSelectionModel, { 1.32558 + 1.32559 + 1.32560 + initEvents : function(){ 1.32561 + this.grid.on("cellmousedown", this.handleMouseDown, this); 1.32562 + this.grid.getGridEl().on(Ext.isIE || Ext.isSafari3 ? "keydown" : "keypress", this.handleKeyDown, this); 1.32563 + var view = this.grid.view; 1.32564 + view.on("refresh", this.onViewChange, this); 1.32565 + view.on("rowupdated", this.onRowUpdated, this); 1.32566 + view.on("beforerowremoved", this.clearSelections, this); 1.32567 + view.on("beforerowsinserted", this.clearSelections, this); 1.32568 + if(this.grid.isEditor){ 1.32569 + this.grid.on("beforeedit", this.beforeEdit, this); 1.32570 + } 1.32571 + }, 1.32572 + 1.32573 + beforeEdit : function(e){ 1.32574 + this.select(e.row, e.column, false, true, e.record); 1.32575 + }, 1.32576 + 1.32577 + onRowUpdated : function(v, index, r){ 1.32578 + if(this.selection && this.selection.record == r){ 1.32579 + v.onCellSelect(index, this.selection.cell[1]); 1.32580 + } 1.32581 + }, 1.32582 + 1.32583 + onViewChange : function(){ 1.32584 + this.clearSelections(true); 1.32585 + }, 1.32586 + 1.32587 + 1.32588 + getSelectedCell : function(){ 1.32589 + return this.selection ? this.selection.cell : null; 1.32590 + }, 1.32591 + 1.32592 + 1.32593 + clearSelections : function(preventNotify){ 1.32594 + var s = this.selection; 1.32595 + if(s){ 1.32596 + if(preventNotify !== true){ 1.32597 + this.grid.view.onCellDeselect(s.cell[0], s.cell[1]); 1.32598 + } 1.32599 + this.selection = null; 1.32600 + this.fireEvent("selectionchange", this, null); 1.32601 + } 1.32602 + }, 1.32603 + 1.32604 + 1.32605 + hasSelection : function(){ 1.32606 + return this.selection ? true : false; 1.32607 + }, 1.32608 + 1.32609 + 1.32610 + handleMouseDown : function(g, row, cell, e){ 1.32611 + if(e.button !== 0 || this.isLocked()){ 1.32612 + return; 1.32613 + }; 1.32614 + this.select(row, cell); 1.32615 + }, 1.32616 + 1.32617 + 1.32618 + select : function(rowIndex, colIndex, preventViewNotify, preventFocus, r){ 1.32619 + if(this.fireEvent("beforecellselect", this, rowIndex, colIndex) !== false){ 1.32620 + this.clearSelections(); 1.32621 + r = r || this.grid.store.getAt(rowIndex); 1.32622 + this.selection = { 1.32623 + record : r, 1.32624 + cell : [rowIndex, colIndex] 1.32625 + }; 1.32626 + if(!preventViewNotify){ 1.32627 + var v = this.grid.getView(); 1.32628 + v.onCellSelect(rowIndex, colIndex); 1.32629 + if(preventFocus !== true){ 1.32630 + v.focusCell(rowIndex, colIndex); 1.32631 + } 1.32632 + } 1.32633 + this.fireEvent("cellselect", this, rowIndex, colIndex); 1.32634 + this.fireEvent("selectionchange", this, this.selection); 1.32635 + } 1.32636 + }, 1.32637 + 1.32638 + isSelectable : function(rowIndex, colIndex, cm){ 1.32639 + return !cm.isHidden(colIndex); 1.32640 + }, 1.32641 + 1.32642 + 1.32643 + handleKeyDown : function(e){ 1.32644 + if(!e.isNavKeyPress()){ 1.32645 + return; 1.32646 + } 1.32647 + var g = this.grid, s = this.selection; 1.32648 + if(!s){ 1.32649 + e.stopEvent(); 1.32650 + var cell = g.walkCells(0, 0, 1, this.isSelectable, this); 1.32651 + if(cell){ 1.32652 + this.select(cell[0], cell[1]); 1.32653 + } 1.32654 + return; 1.32655 + } 1.32656 + var sm = this; 1.32657 + var walk = function(row, col, step){ 1.32658 + return g.walkCells(row, col, step, sm.isSelectable, sm); 1.32659 + }; 1.32660 + var k = e.getKey(), r = s.cell[0], c = s.cell[1]; 1.32661 + var newCell; 1.32662 + 1.32663 + switch(k){ 1.32664 + case e.TAB: 1.32665 + if(e.shiftKey){ 1.32666 + newCell = walk(r, c-1, -1); 1.32667 + }else{ 1.32668 + newCell = walk(r, c+1, 1); 1.32669 + } 1.32670 + break; 1.32671 + case e.DOWN: 1.32672 + newCell = walk(r+1, c, 1); 1.32673 + break; 1.32674 + case e.UP: 1.32675 + newCell = walk(r-1, c, -1); 1.32676 + break; 1.32677 + case e.RIGHT: 1.32678 + newCell = walk(r, c+1, 1); 1.32679 + break; 1.32680 + case e.LEFT: 1.32681 + newCell = walk(r, c-1, -1); 1.32682 + break; 1.32683 + case e.ENTER: 1.32684 + if(g.isEditor && !g.editing){ 1.32685 + g.startEditing(r, c); 1.32686 + e.stopEvent(); 1.32687 + return; 1.32688 + } 1.32689 + break; 1.32690 + }; 1.32691 + if(newCell){ 1.32692 + this.select(newCell[0], newCell[1]); 1.32693 + e.stopEvent(); 1.32694 + } 1.32695 + }, 1.32696 + 1.32697 + acceptsNav : function(row, col, cm){ 1.32698 + return !cm.isHidden(col) && cm.isCellEditable(col, row); 1.32699 + }, 1.32700 + 1.32701 + onEditorKey : function(field, e){ 1.32702 + var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor; 1.32703 + if(k == e.TAB){ 1.32704 + if(e.shiftKey){ 1.32705 + newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this); 1.32706 + }else{ 1.32707 + newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this); 1.32708 + } 1.32709 + e.stopEvent(); 1.32710 + }else if(k == e.ENTER){ 1.32711 + ed.completeEdit(); 1.32712 + e.stopEvent(); 1.32713 + }else if(k == e.ESC){ 1.32714 + e.stopEvent(); 1.32715 + ed.cancelEdit(); 1.32716 + } 1.32717 + if(newCell){ 1.32718 + g.startEditing(newCell[0], newCell[1]); 1.32719 + } 1.32720 + } 1.32721 +}); 1.32722 + 1.32723 +Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, { 1.32724 + 1.32725 + clicksToEdit: 2, 1.32726 + 1.32727 + isEditor : true, 1.32728 + detectEdit: false, 1.32729 + 1.32730 + 1.32731 + autoEncode : false, 1.32732 + 1.32733 + 1.32734 + trackMouseOver: false, 1.32735 + initComponent : function(){ 1.32736 + Ext.grid.EditorGridPanel.superclass.initComponent.call(this); 1.32737 + 1.32738 + if(!this.selModel){ 1.32739 + 1.32740 + this.selModel = new Ext.grid.CellSelectionModel(); 1.32741 + } 1.32742 + 1.32743 + this.activeEditor = null; 1.32744 + 1.32745 + this.addEvents( 1.32746 + 1.32747 + "beforeedit", 1.32748 + 1.32749 + "afteredit", 1.32750 + 1.32751 + "validateedit" 1.32752 + ); 1.32753 + }, 1.32754 + 1.32755 + initEvents : function(){ 1.32756 + Ext.grid.EditorGridPanel.superclass.initEvents.call(this); 1.32757 + 1.32758 + this.on("bodyscroll", this.stopEditing, this, [true]); 1.32759 + 1.32760 + if(this.clicksToEdit == 1){ 1.32761 + this.on("cellclick", this.onCellDblClick, this); 1.32762 + }else { 1.32763 + if(this.clicksToEdit == 'auto' && this.view.mainBody){ 1.32764 + this.view.mainBody.on("mousedown", this.onAutoEditClick, this); 1.32765 + } 1.32766 + this.on("celldblclick", this.onCellDblClick, this); 1.32767 + } 1.32768 + this.getGridEl().addClass("xedit-grid"); 1.32769 + }, 1.32770 + 1.32771 + onCellDblClick : function(g, row, col){ 1.32772 + this.startEditing(row, col); 1.32773 + }, 1.32774 + 1.32775 + onAutoEditClick : function(e, t){ 1.32776 + if(e.button !== 0){ 1.32777 + return; 1.32778 + } 1.32779 + var row = this.view.findRowIndex(t); 1.32780 + var col = this.view.findCellIndex(t); 1.32781 + if(row !== false && col !== false){ 1.32782 + this.stopEditing(); 1.32783 + if(this.selModel.getSelectedCell){ var sc = this.selModel.getSelectedCell(); 1.32784 + if(sc && sc.cell[0] === row && sc.cell[1] === col){ 1.32785 + this.startEditing(row, col); 1.32786 + } 1.32787 + }else{ 1.32788 + if(this.selModel.isSelected(row)){ 1.32789 + this.startEditing(row, col); 1.32790 + } 1.32791 + } 1.32792 + } 1.32793 + }, 1.32794 + 1.32795 + onEditComplete : function(ed, value, startValue){ 1.32796 + this.editing = false; 1.32797 + this.activeEditor = null; 1.32798 + ed.un("specialkey", this.selModel.onEditorKey, this.selModel); 1.32799 + var r = ed.record; 1.32800 + var field = this.colModel.getDataIndex(ed.col); 1.32801 + value = this.postEditValue(value, startValue, r, field); 1.32802 + if(String(value) !== String(startValue)){ 1.32803 + var e = { 1.32804 + grid: this, 1.32805 + record: r, 1.32806 + field: field, 1.32807 + originalValue: startValue, 1.32808 + value: value, 1.32809 + row: ed.row, 1.32810 + column: ed.col, 1.32811 + cancel:false 1.32812 + }; 1.32813 + if(this.fireEvent("validateedit", e) !== false && !e.cancel){ 1.32814 + r.set(field, e.value); 1.32815 + delete e.cancel; 1.32816 + this.fireEvent("afteredit", e); 1.32817 + } 1.32818 + } 1.32819 + this.view.focusCell(ed.row, ed.col); 1.32820 + }, 1.32821 + 1.32822 + 1.32823 + startEditing : function(row, col){ 1.32824 + this.stopEditing(); 1.32825 + if(this.colModel.isCellEditable(col, row)){ 1.32826 + this.view.ensureVisible(row, col, true); 1.32827 + var r = this.store.getAt(row); 1.32828 + var field = this.colModel.getDataIndex(col); 1.32829 + var e = { 1.32830 + grid: this, 1.32831 + record: r, 1.32832 + field: field, 1.32833 + value: r.data[field], 1.32834 + row: row, 1.32835 + column: col, 1.32836 + cancel:false 1.32837 + }; 1.32838 + if(this.fireEvent("beforeedit", e) !== false && !e.cancel){ 1.32839 + this.editing = true; 1.32840 + var ed = this.colModel.getCellEditor(col, row); 1.32841 + if(!ed.rendered){ 1.32842 + ed.render(this.view.getEditorParent(ed)); 1.32843 + } 1.32844 + (function(){ ed.row = row; 1.32845 + ed.col = col; 1.32846 + ed.record = r; 1.32847 + ed.on("complete", this.onEditComplete, this, {single: true}); 1.32848 + ed.on("specialkey", this.selModel.onEditorKey, this.selModel); 1.32849 + this.activeEditor = ed; 1.32850 + var v = this.preEditValue(r, field); 1.32851 + ed.startEdit(this.view.getCell(row, col), v); 1.32852 + }).defer(50, this); 1.32853 + } 1.32854 + } 1.32855 + }, 1.32856 + 1.32857 + preEditValue : function(r, field){ 1.32858 + return this.autoEncode && typeof value == 'string' ? Ext.util.Format.htmlDecode(r.data[field]) : r.data[field]; 1.32859 + }, 1.32860 + 1.32861 + postEditValue : function(value, originalValue, r, field){ 1.32862 + return this.autoEncode && typeof value == 'string' ? Ext.util.Format.htmlEncode(value) : value; 1.32863 + }, 1.32864 + 1.32865 + 1.32866 + stopEditing : function(cancel){ 1.32867 + if(this.activeEditor){ 1.32868 + this.activeEditor[cancel === true ? 'cancelEdit' : 'completeEdit'](); 1.32869 + } 1.32870 + this.activeEditor = null; 1.32871 + } 1.32872 +}); 1.32873 +Ext.reg('editorgrid', Ext.grid.EditorGridPanel); 1.32874 +Ext.grid.GridEditor = function(field, config){ 1.32875 + Ext.grid.GridEditor.superclass.constructor.call(this, field, config); 1.32876 + field.monitorTab = false; 1.32877 +}; 1.32878 + 1.32879 +Ext.extend(Ext.grid.GridEditor, Ext.Editor, { 1.32880 + alignment: "tl-tl", 1.32881 + autoSize: "width", 1.32882 + hideEl : false, 1.32883 + cls: "x-small-editor x-grid-editor", 1.32884 + shim:false, 1.32885 + shadow:false 1.32886 +}); 1.32887 + 1.32888 +Ext.grid.PropertyRecord = Ext.data.Record.create([ 1.32889 + {name:'name',type:'string'}, 'value' 1.32890 +]); 1.32891 + 1.32892 + 1.32893 +Ext.grid.PropertyStore = function(grid, source){ 1.32894 + this.grid = grid; 1.32895 + this.store = new Ext.data.Store({ 1.32896 + recordType : Ext.grid.PropertyRecord 1.32897 + }); 1.32898 + this.store.on('update', this.onUpdate, this); 1.32899 + if(source){ 1.32900 + this.setSource(source); 1.32901 + } 1.32902 + Ext.grid.PropertyStore.superclass.constructor.call(this); 1.32903 +}; 1.32904 +Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, { 1.32905 + setSource : function(o){ 1.32906 + this.source = o; 1.32907 + this.store.removeAll(); 1.32908 + var data = []; 1.32909 + for(var k in o){ 1.32910 + if(this.isEditableValue(o[k])){ 1.32911 + data.push(new Ext.grid.PropertyRecord({name: k, value: o[k]}, k)); 1.32912 + } 1.32913 + } 1.32914 + this.store.loadRecords({records: data}, {}, true); 1.32915 + }, 1.32916 + 1.32917 + onUpdate : function(ds, record, type){ 1.32918 + if(type == Ext.data.Record.EDIT){ 1.32919 + var v = record.data['value']; 1.32920 + var oldValue = record.modified['value']; 1.32921 + if(this.grid.fireEvent('beforepropertychange', this.source, record.id, v, oldValue) !== false){ 1.32922 + this.source[record.id] = v; 1.32923 + record.commit(); 1.32924 + this.grid.fireEvent('propertychange', this.source, record.id, v, oldValue); 1.32925 + }else{ 1.32926 + record.reject(); 1.32927 + } 1.32928 + } 1.32929 + }, 1.32930 + 1.32931 + getProperty : function(row){ 1.32932 + return this.store.getAt(row); 1.32933 + }, 1.32934 + 1.32935 + isEditableValue: function(val){ 1.32936 + if(Ext.isDate(val)){ 1.32937 + return true; 1.32938 + }else if(typeof val == 'object' || typeof val == 'function'){ 1.32939 + return false; 1.32940 + } 1.32941 + return true; 1.32942 + }, 1.32943 + 1.32944 + setValue : function(prop, value){ 1.32945 + this.source[prop] = value; 1.32946 + this.store.getById(prop).set('value', value); 1.32947 + }, 1.32948 + 1.32949 + getSource : function(){ 1.32950 + return this.source; 1.32951 + } 1.32952 +}); 1.32953 + 1.32954 + 1.32955 +Ext.grid.PropertyColumnModel = function(grid, store){ 1.32956 + this.grid = grid; 1.32957 + var g = Ext.grid; 1.32958 + g.PropertyColumnModel.superclass.constructor.call(this, [ 1.32959 + {header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true}, 1.32960 + {header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true} 1.32961 + ]); 1.32962 + this.store = store; 1.32963 + this.bselect = Ext.DomHelper.append(document.body, { 1.32964 + tag: 'select', cls: 'x-grid-editor x-hide-display', children: [ 1.32965 + {tag: 'option', value: 'true', html: 'true'}, 1.32966 + {tag: 'option', value: 'false', html: 'false'} 1.32967 + ] 1.32968 + }); 1.32969 + var f = Ext.form; 1.32970 + 1.32971 + var bfield = new f.Field({ 1.32972 + el:this.bselect, 1.32973 + bselect : this.bselect, 1.32974 + autoShow: true, 1.32975 + getValue : function(){ 1.32976 + return this.bselect.value == 'true'; 1.32977 + } 1.32978 + }); 1.32979 + this.editors = { 1.32980 + 'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})), 1.32981 + 'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})), 1.32982 + 'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})), 1.32983 + 'boolean' : new g.GridEditor(bfield) 1.32984 + }; 1.32985 + this.renderCellDelegate = this.renderCell.createDelegate(this); 1.32986 + this.renderPropDelegate = this.renderProp.createDelegate(this); 1.32987 +}; 1.32988 + 1.32989 +Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, { 1.32990 + nameText : 'Name', 1.32991 + valueText : 'Value', 1.32992 + dateFormat : 'm/j/Y', 1.32993 + 1.32994 + renderDate : function(dateVal){ 1.32995 + return dateVal.dateFormat(this.dateFormat); 1.32996 + }, 1.32997 + 1.32998 + renderBool : function(bVal){ 1.32999 + return bVal ? 'true' : 'false'; 1.33000 + }, 1.33001 + 1.33002 + isCellEditable : function(colIndex, rowIndex){ 1.33003 + return colIndex == 1; 1.33004 + }, 1.33005 + 1.33006 + getRenderer : function(col){ 1.33007 + return col == 1 ? 1.33008 + this.renderCellDelegate : this.renderPropDelegate; 1.33009 + }, 1.33010 + 1.33011 + renderProp : function(v){ 1.33012 + return this.getPropertyName(v); 1.33013 + }, 1.33014 + 1.33015 + renderCell : function(val){ 1.33016 + var rv = val; 1.33017 + if(Ext.isDate(val)){ 1.33018 + rv = this.renderDate(val); 1.33019 + }else if(typeof val == 'boolean'){ 1.33020 + rv = this.renderBool(val); 1.33021 + } 1.33022 + return Ext.util.Format.htmlEncode(rv); 1.33023 + }, 1.33024 + 1.33025 + getPropertyName : function(name){ 1.33026 + var pn = this.grid.propertyNames; 1.33027 + return pn && pn[name] ? pn[name] : name; 1.33028 + }, 1.33029 + 1.33030 + getCellEditor : function(colIndex, rowIndex){ 1.33031 + var p = this.store.getProperty(rowIndex); 1.33032 + var n = p.data['name'], val = p.data['value']; 1.33033 + if(this.grid.customEditors[n]){ 1.33034 + return this.grid.customEditors[n]; 1.33035 + } 1.33036 + if(Ext.isDate(val)){ 1.33037 + return this.editors['date']; 1.33038 + }else if(typeof val == 'number'){ 1.33039 + return this.editors['number']; 1.33040 + }else if(typeof val == 'boolean'){ 1.33041 + return this.editors['boolean']; 1.33042 + }else{ 1.33043 + return this.editors['string']; 1.33044 + } 1.33045 + } 1.33046 +}); 1.33047 + 1.33048 + 1.33049 +Ext.grid.PropertyGrid = Ext.extend(Ext.grid.EditorGridPanel, { 1.33050 + 1.33051 + 1.33052 + 1.33053 + enableColumnMove:false, 1.33054 + stripeRows:false, 1.33055 + trackMouseOver: false, 1.33056 + clicksToEdit:1, 1.33057 + enableHdMenu : false, 1.33058 + viewConfig : { 1.33059 + forceFit:true 1.33060 + }, 1.33061 + 1.33062 + initComponent : function(){ 1.33063 + this.customEditors = this.customEditors || {}; 1.33064 + this.lastEditRow = null; 1.33065 + var store = new Ext.grid.PropertyStore(this); 1.33066 + this.propStore = store; 1.33067 + var cm = new Ext.grid.PropertyColumnModel(this, store); 1.33068 + store.store.sort('name', 'ASC'); 1.33069 + this.addEvents( 1.33070 + 1.33071 + 'beforepropertychange', 1.33072 + 1.33073 + 'propertychange' 1.33074 + ); 1.33075 + this.cm = cm; 1.33076 + this.ds = store.store; 1.33077 + Ext.grid.PropertyGrid.superclass.initComponent.call(this); 1.33078 + 1.33079 + this.selModel.on('beforecellselect', function(sm, rowIndex, colIndex){ 1.33080 + if(colIndex === 0){ 1.33081 + this.startEditing.defer(200, this, [rowIndex, 1]); 1.33082 + return false; 1.33083 + } 1.33084 + }, this); 1.33085 + }, 1.33086 + 1.33087 + onRender : function(){ 1.33088 + Ext.grid.PropertyGrid.superclass.onRender.apply(this, arguments); 1.33089 + 1.33090 + this.getGridEl().addClass('x-props-grid'); 1.33091 + }, 1.33092 + 1.33093 + afterRender: function(){ 1.33094 + Ext.grid.PropertyGrid.superclass.afterRender.apply(this, arguments); 1.33095 + if(this.source){ 1.33096 + this.setSource(this.source); 1.33097 + } 1.33098 + }, 1.33099 + 1.33100 + 1.33101 + setSource : function(source){ 1.33102 + this.propStore.setSource(source); 1.33103 + }, 1.33104 + 1.33105 + 1.33106 + getSource : function(){ 1.33107 + return this.propStore.getSource(); 1.33108 + } 1.33109 +}); 1.33110 +Ext.reg("propertygrid", Ext.grid.PropertyGrid); 1.33111 + 1.33112 + 1.33113 +Ext.grid.RowNumberer = function(config){ 1.33114 + Ext.apply(this, config); 1.33115 + if(this.rowspan){ 1.33116 + this.renderer = this.renderer.createDelegate(this); 1.33117 + } 1.33118 +}; 1.33119 + 1.33120 +Ext.grid.RowNumberer.prototype = { 1.33121 + 1.33122 + header: "", 1.33123 + 1.33124 + width: 23, 1.33125 + 1.33126 + sortable: false, 1.33127 + 1.33128 + 1.33129 + fixed:true, 1.33130 + menuDisabled:true, 1.33131 + dataIndex: '', 1.33132 + id: 'numberer', 1.33133 + rowspan: undefined, 1.33134 + 1.33135 + 1.33136 + renderer : function(v, p, record, rowIndex){ 1.33137 + if(this.rowspan){ 1.33138 + p.cellAttr = 'rowspan="'+this.rowspan+'"'; 1.33139 + } 1.33140 + return rowIndex+1; 1.33141 + } 1.33142 +}; 1.33143 + 1.33144 +Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, { 1.33145 + 1.33146 + header: '<div class="x-grid3-hd-checker"> </div>', 1.33147 + 1.33148 + width: 20, 1.33149 + 1.33150 + sortable: false, 1.33151 + 1.33152 + 1.33153 + menuDisabled:true, 1.33154 + fixed:true, 1.33155 + dataIndex: '', 1.33156 + id: 'checker', 1.33157 + 1.33158 + 1.33159 + initEvents : function(){ 1.33160 + Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this); 1.33161 + this.grid.on('render', function(){ 1.33162 + var view = this.grid.getView(); 1.33163 + view.mainBody.on('mousedown', this.onMouseDown, this); 1.33164 + Ext.fly(view.innerHd).on('mousedown', this.onHdMouseDown, this); 1.33165 + 1.33166 + }, this); 1.33167 + }, 1.33168 + 1.33169 + 1.33170 + onMouseDown : function(e, t){ 1.33171 + if(e.button === 0 && t.className == 'x-grid3-row-checker'){ 1.33172 + e.stopEvent(); 1.33173 + var row = e.getTarget('.x-grid3-row'); 1.33174 + if(row){ 1.33175 + var index = row.rowIndex; 1.33176 + if(this.isSelected(index)){ 1.33177 + this.deselectRow(index); 1.33178 + }else{ 1.33179 + this.selectRow(index, true); 1.33180 + } 1.33181 + } 1.33182 + } 1.33183 + }, 1.33184 + 1.33185 + 1.33186 + onHdMouseDown : function(e, t){ 1.33187 + if(t.className == 'x-grid3-hd-checker'){ 1.33188 + e.stopEvent(); 1.33189 + var hd = Ext.fly(t.parentNode); 1.33190 + var isChecked = hd.hasClass('x-grid3-hd-checker-on'); 1.33191 + if(isChecked){ 1.33192 + hd.removeClass('x-grid3-hd-checker-on'); 1.33193 + this.clearSelections(); 1.33194 + }else{ 1.33195 + hd.addClass('x-grid3-hd-checker-on'); 1.33196 + this.selectAll(); 1.33197 + } 1.33198 + } 1.33199 + }, 1.33200 + 1.33201 + 1.33202 + renderer : function(v, p, record){ 1.33203 + return '<div class="x-grid3-row-checker"> </div>'; 1.33204 + } 1.33205 +}); 1.33206 + 1.33207 +Ext.LoadMask = function(el, config){ 1.33208 + this.el = Ext.get(el); 1.33209 + Ext.apply(this, config); 1.33210 + if(this.store){ 1.33211 + this.store.on('beforeload', this.onBeforeLoad, this); 1.33212 + this.store.on('load', this.onLoad, this); 1.33213 + this.store.on('loadexception', this.onLoad, this); 1.33214 + this.removeMask = Ext.value(this.removeMask, false); 1.33215 + }else{ 1.33216 + var um = this.el.getUpdater(); 1.33217 + um.showLoadIndicator = false; um.on('beforeupdate', this.onBeforeLoad, this); 1.33218 + um.on('update', this.onLoad, this); 1.33219 + um.on('failure', this.onLoad, this); 1.33220 + this.removeMask = Ext.value(this.removeMask, true); 1.33221 + } 1.33222 +}; 1.33223 + 1.33224 +Ext.LoadMask.prototype = { 1.33225 + 1.33226 + 1.33227 + 1.33228 + msg : 'Loading...', 1.33229 + 1.33230 + msgCls : 'x-mask-loading', 1.33231 + 1.33232 + 1.33233 + disabled: false, 1.33234 + 1.33235 + 1.33236 + disable : function(){ 1.33237 + this.disabled = true; 1.33238 + }, 1.33239 + 1.33240 + 1.33241 + enable : function(){ 1.33242 + this.disabled = false; 1.33243 + }, 1.33244 + 1.33245 + onLoad : function(){ 1.33246 + this.el.unmask(this.removeMask); 1.33247 + }, 1.33248 + 1.33249 + onBeforeLoad : function(){ 1.33250 + if(!this.disabled){ 1.33251 + this.el.mask(this.msg, this.msgCls); 1.33252 + } 1.33253 + }, 1.33254 + 1.33255 + 1.33256 + show: function(){ 1.33257 + this.onBeforeLoad(); 1.33258 + }, 1.33259 + 1.33260 + 1.33261 + hide: function(){ 1.33262 + this.onLoad(); 1.33263 + }, 1.33264 + 1.33265 + destroy : function(){ 1.33266 + if(this.store){ 1.33267 + this.store.un('beforeload', this.onBeforeLoad, this); 1.33268 + this.store.un('load', this.onLoad, this); 1.33269 + this.store.un('loadexception', this.onLoad, this); 1.33270 + }else{ 1.33271 + var um = this.el.getUpdater(); 1.33272 + um.un('beforeupdate', this.onBeforeLoad, this); 1.33273 + um.un('update', this.onLoad, this); 1.33274 + um.un('failure', this.onLoad, this); 1.33275 + } 1.33276 + } 1.33277 +}; 1.33278 + 1.33279 +Ext.ProgressBar = Ext.extend(Ext.BoxComponent, { 1.33280 + 1.33281 + baseCls : 'x-progress', 1.33282 + 1.33283 + 1.33284 + waitTimer : null, 1.33285 + 1.33286 + 1.33287 + initComponent : function(){ 1.33288 + Ext.ProgressBar.superclass.initComponent.call(this); 1.33289 + this.addEvents( 1.33290 + 1.33291 + "update" 1.33292 + ); 1.33293 + }, 1.33294 + 1.33295 + 1.33296 + onRender : function(ct, position){ 1.33297 + Ext.ProgressBar.superclass.onRender.call(this, ct, position); 1.33298 + 1.33299 + var tpl = new Ext.Template( 1.33300 + '<div class="{cls}-wrap">', 1.33301 + '<div class="{cls}-inner">', 1.33302 + '<div class="{cls}-bar">', 1.33303 + '<div class="{cls}-text">', 1.33304 + '<div> </div>', 1.33305 + '</div>', 1.33306 + '</div>', 1.33307 + '<div class="{cls}-text {cls}-text-back">', 1.33308 + '<div> </div>', 1.33309 + '</div>', 1.33310 + '</div>', 1.33311 + '</div>' 1.33312 + ); 1.33313 + 1.33314 + if(position){ 1.33315 + this.el = tpl.insertBefore(position, {cls: this.baseCls}, true); 1.33316 + }else{ 1.33317 + this.el = tpl.append(ct, {cls: this.baseCls}, true); 1.33318 + } 1.33319 + if(this.id){ 1.33320 + this.el.dom.id = this.id; 1.33321 + } 1.33322 + var inner = this.el.dom.firstChild; 1.33323 + this.progressBar = Ext.get(inner.firstChild); 1.33324 + 1.33325 + if(this.textEl){ 1.33326 + 1.33327 + this.textEl = Ext.get(this.textEl); 1.33328 + delete this.textTopEl; 1.33329 + }else{ 1.33330 + 1.33331 + this.textTopEl = Ext.get(this.progressBar.dom.firstChild); 1.33332 + var textBackEl = Ext.get(inner.childNodes[1]); 1.33333 + this.textTopEl.setStyle("z-index", 99).addClass('x-hidden'); 1.33334 + this.textEl = new Ext.CompositeElement([this.textTopEl.dom.firstChild, textBackEl.dom.firstChild]); 1.33335 + this.textEl.setWidth(inner.offsetWidth); 1.33336 + } 1.33337 + this.progressBar.setHeight(inner.offsetHeight); 1.33338 + }, 1.33339 + 1.33340 + 1.33341 + afterRender : function(){ 1.33342 + Ext.ProgressBar.superclass.afterRender.call(this); 1.33343 + if(this.value){ 1.33344 + this.updateProgress(this.value, this.text); 1.33345 + }else{ 1.33346 + this.updateText(this.text); 1.33347 + } 1.33348 + }, 1.33349 + 1.33350 + 1.33351 + updateProgress : function(value, text){ 1.33352 + this.value = value || 0; 1.33353 + if(text){ 1.33354 + this.updateText(text); 1.33355 + } 1.33356 + var w = Math.floor(value*this.el.dom.firstChild.offsetWidth); 1.33357 + this.progressBar.setWidth(w); 1.33358 + if(this.textTopEl){ 1.33359 + 1.33360 + this.textTopEl.removeClass('x-hidden').setWidth(w); 1.33361 + } 1.33362 + this.fireEvent('update', this, value, text); 1.33363 + return this; 1.33364 + }, 1.33365 + 1.33366 + 1.33367 + wait : function(o){ 1.33368 + if(!this.waitTimer){ 1.33369 + var scope = this; 1.33370 + o = o || {}; 1.33371 + this.waitTimer = Ext.TaskMgr.start({ 1.33372 + run: function(i){ 1.33373 + var inc = o.increment || 10; 1.33374 + this.updateProgress(((((i+inc)%inc)+1)*(100/inc))*.01); 1.33375 + }, 1.33376 + interval: o.interval || 1000, 1.33377 + duration: o.duration, 1.33378 + onStop: function(){ 1.33379 + if(o.fn){ 1.33380 + o.fn.apply(o.scope || this); 1.33381 + } 1.33382 + this.reset(); 1.33383 + }, 1.33384 + scope: scope 1.33385 + }); 1.33386 + } 1.33387 + return this; 1.33388 + }, 1.33389 + 1.33390 + 1.33391 + isWaiting : function(){ 1.33392 + return this.waitTimer != null; 1.33393 + }, 1.33394 + 1.33395 + 1.33396 + updateText : function(text){ 1.33397 + this.text = text || ' '; 1.33398 + this.textEl.update(this.text); 1.33399 + return this; 1.33400 + }, 1.33401 + 1.33402 + 1.33403 + setSize : function(w, h){ 1.33404 + Ext.ProgressBar.superclass.setSize.call(this, w, h); 1.33405 + if(this.textTopEl){ 1.33406 + var inner = this.el.dom.firstChild; 1.33407 + this.textEl.setSize(inner.offsetWidth, inner.offsetHeight); 1.33408 + } 1.33409 + return this; 1.33410 + }, 1.33411 + 1.33412 + 1.33413 + reset : function(hide){ 1.33414 + this.updateProgress(0); 1.33415 + if(this.textTopEl){ 1.33416 + this.textTopEl.addClass('x-hidden'); 1.33417 + } 1.33418 + if(this.waitTimer){ 1.33419 + this.waitTimer.onStop = null; 1.33420 + Ext.TaskMgr.stop(this.waitTimer); 1.33421 + this.waitTimer = null; 1.33422 + } 1.33423 + if(hide === true){ 1.33424 + this.hide(); 1.33425 + } 1.33426 + return this; 1.33427 + } 1.33428 +}); 1.33429 +Ext.reg('progress', Ext.ProgressBar); 1.33430 + 1.33431 +Ext.Slider = Ext.extend(Ext.BoxComponent, { 1.33432 + 1.33433 + 1.33434 + vertical: false, 1.33435 + 1.33436 + minValue: 0, 1.33437 + 1.33438 + maxValue: 100, 1.33439 + 1.33440 + keyIncrement: 1, 1.33441 + 1.33442 + increment: 0, 1.33443 + 1.33444 + clickRange: [5,15], 1.33445 + 1.33446 + clickToChange : true, 1.33447 + 1.33448 + animate: true, 1.33449 + 1.33450 + 1.33451 + initComponent : function(){ 1.33452 + if(this.value === undefined){ 1.33453 + this.value = this.minValue; 1.33454 + } 1.33455 + Ext.Slider.superclass.initComponent.call(this); 1.33456 + this.keyIncrement = Math.max(this.increment, this.keyIncrement); 1.33457 + this.addEvents( 1.33458 + 1.33459 + 'beforechange', 1.33460 + 1.33461 + 'change', 1.33462 + 1.33463 + 'dragstart', 1.33464 + 1.33465 + 'drag', 1.33466 + 1.33467 + 'dragend' 1.33468 + ); 1.33469 + 1.33470 + if(this.vertical){ 1.33471 + Ext.apply(this, Ext.Slider.Vertical); 1.33472 + } 1.33473 + }, 1.33474 + 1.33475 + 1.33476 + onRender : function(){ 1.33477 + this.autoEl = { 1.33478 + cls: 'x-slider ' + (this.vertical ? 'x-slider-vert' : 'x-slider-horz'), 1.33479 + cn:{cls:'x-slider-end',cn:{cls:'x-slider-inner',cn:[{cls:'x-slider-thumb'},{tag:'a', cls:'x-slider-focus', href:"#", tabIndex: '-1', hidefocus:'on'}]}} 1.33480 + }; 1.33481 + Ext.Slider.superclass.onRender.apply(this, arguments); 1.33482 + this.endEl = this.el.first(); 1.33483 + this.innerEl = this.endEl.first(); 1.33484 + this.thumb = this.innerEl.first(); 1.33485 + this.halfThumb = (this.vertical ? this.thumb.getHeight() : this.thumb.getWidth())/2; 1.33486 + this.focusEl = this.thumb.next(); 1.33487 + this.initEvents(); 1.33488 + }, 1.33489 + 1.33490 + 1.33491 + initEvents : function(){ 1.33492 + this.thumb.addClassOnOver('x-slider-thumb-over'); 1.33493 + this.mon(this.el, 'mousedown', this.onMouseDown, this); 1.33494 + this.mon(this.el, 'keydown', this.onKeyDown, this); 1.33495 + 1.33496 + this.tracker = new Ext.dd.DragTracker({ 1.33497 + onBeforeStart: this.onBeforeDragStart.createDelegate(this), 1.33498 + onStart: this.onDragStart.createDelegate(this), 1.33499 + onDrag: this.onDrag.createDelegate(this), 1.33500 + onEnd: this.onDragEnd.createDelegate(this), 1.33501 + tolerance: 3, 1.33502 + autoStart: 300 1.33503 + }); 1.33504 + this.tracker.initEl(this.thumb); 1.33505 + this.on('beforedestroy', this.tracker.destroy, this.tracker); 1.33506 + }, 1.33507 + 1.33508 + 1.33509 + onMouseDown : function(e){ 1.33510 + if(this.disabled) {return;} 1.33511 + if(this.clickToChange && e.target != this.thumb.dom){ 1.33512 + var local = this.innerEl.translatePoints(e.getXY()); 1.33513 + this.onClickChange(local); 1.33514 + } 1.33515 + this.focus(); 1.33516 + }, 1.33517 + 1.33518 + 1.33519 + onClickChange : function(local){ 1.33520 + if(local.top > this.clickRange[0] && local.top < this.clickRange[1]){ 1.33521 + this.setValue(Math.round(local.left/this.getRatio())); 1.33522 + } 1.33523 + }, 1.33524 + 1.33525 + 1.33526 + onKeyDown : function(e){ 1.33527 + if(this.disabled){e.preventDefault();return;} 1.33528 + var k = e.getKey(); 1.33529 + switch(k){ 1.33530 + case e.UP: 1.33531 + case e.RIGHT: 1.33532 + e.stopEvent(); 1.33533 + if(e.ctrlKey){ 1.33534 + this.setValue(this.maxValue); 1.33535 + }else{ 1.33536 + this.setValue(this.value+this.keyIncrement); 1.33537 + } 1.33538 + break; 1.33539 + case e.DOWN: 1.33540 + case e.LEFT: 1.33541 + e.stopEvent(); 1.33542 + if(e.ctrlKey){ 1.33543 + this.setValue(this.minValue); 1.33544 + }else{ 1.33545 + this.setValue(this.value-this.keyIncrement); 1.33546 + } 1.33547 + break; 1.33548 + default: 1.33549 + e.preventDefault(); 1.33550 + } 1.33551 + }, 1.33552 + 1.33553 + 1.33554 + doSnap : function(value){ 1.33555 + if(!this.increment || this.increment == 1 || !value) { 1.33556 + return value; 1.33557 + } 1.33558 + var newValue = value, inc = this.increment; 1.33559 + var m = value % inc; 1.33560 + if(m > 0){ 1.33561 + if(m > (inc/2)){ 1.33562 + newValue = value + (inc-m); 1.33563 + }else{ 1.33564 + newValue = value - m; 1.33565 + } 1.33566 + } 1.33567 + return newValue.constrain(this.minValue, this.maxValue); 1.33568 + }, 1.33569 + 1.33570 + 1.33571 + afterRender : function(){ 1.33572 + Ext.Slider.superclass.afterRender.apply(this, arguments); 1.33573 + if(this.value !== undefined){ 1.33574 + var v = this.normalizeValue(this.value); 1.33575 + if(v !== this.value){ 1.33576 + delete this.value; 1.33577 + this.setValue(v, false); 1.33578 + }else{ 1.33579 + this.moveThumb(this.translateValue(v), false); 1.33580 + } 1.33581 + } 1.33582 + }, 1.33583 + 1.33584 + 1.33585 + getRatio : function(){ 1.33586 + var w = this.innerEl.getWidth(); 1.33587 + var v = this.maxValue - this.minValue; 1.33588 + return w/v; 1.33589 + }, 1.33590 + 1.33591 + 1.33592 + normalizeValue : function(v){ 1.33593 + if(typeof v != 'number'){ 1.33594 + v = parseInt(v); 1.33595 + } 1.33596 + v = Math.round(v); 1.33597 + v = this.doSnap(v); 1.33598 + v = v.constrain(this.minValue, this.maxValue); 1.33599 + return v; 1.33600 + }, 1.33601 + 1.33602 + 1.33603 + setValue : function(v, animate){ 1.33604 + v = this.normalizeValue(v); 1.33605 + if(v !== this.value && this.fireEvent('beforechange', this, v, this.value) !== false){ 1.33606 + this.value = v; 1.33607 + this.moveThumb(this.translateValue(v), animate !== false); 1.33608 + this.fireEvent('change', this, v); 1.33609 + } 1.33610 + }, 1.33611 + 1.33612 + 1.33613 + translateValue : function(v){ 1.33614 + return (v * this.getRatio())-this.halfThumb; 1.33615 + }, 1.33616 + 1.33617 + 1.33618 + moveThumb: function(v, animate){ 1.33619 + if(!animate || this.animate === false){ 1.33620 + this.thumb.setLeft(v); 1.33621 + }else{ 1.33622 + this.thumb.shift({left: v, stopFx: true, duration:.35}); 1.33623 + } 1.33624 + }, 1.33625 + 1.33626 + 1.33627 + focus : function(){ 1.33628 + this.focusEl.focus(10); 1.33629 + }, 1.33630 + 1.33631 + 1.33632 + onBeforeDragStart : function(e){ 1.33633 + return !this.disabled; 1.33634 + }, 1.33635 + 1.33636 + 1.33637 + onDragStart: function(e){ 1.33638 + this.thumb.addClass('x-slider-thumb-drag'); 1.33639 + this.fireEvent('dragstart', this, e); 1.33640 + }, 1.33641 + 1.33642 + 1.33643 + onDrag: function(e){ 1.33644 + var pos = this.innerEl.translatePoints(this.tracker.getXY()); 1.33645 + this.setValue(Math.round(pos.left/this.getRatio()), false); 1.33646 + this.fireEvent('drag', this, e); 1.33647 + }, 1.33648 + 1.33649 + 1.33650 + onDragEnd: function(e){ 1.33651 + this.thumb.removeClass('x-slider-thumb-drag'); 1.33652 + this.fireEvent('dragend', this, e); 1.33653 + }, 1.33654 + 1.33655 + 1.33656 + onResize : function(w, h){ 1.33657 + this.innerEl.setWidth(w - (this.el.getPadding('l') + this.endEl.getPadding('r'))); 1.33658 + }, 1.33659 + 1.33660 + 1.33661 + getValue : function(){ 1.33662 + return this.value; 1.33663 + } 1.33664 +}); 1.33665 +Ext.reg('slider', Ext.Slider); 1.33666 + 1.33667 + 1.33668 +Ext.Slider.Vertical = { 1.33669 + onResize : function(w, h){ 1.33670 + this.innerEl.setHeight(h - (this.el.getPadding('t') + this.endEl.getPadding('b'))); 1.33671 + }, 1.33672 + 1.33673 + getRatio : function(){ 1.33674 + var h = this.innerEl.getHeight(); 1.33675 + var v = this.maxValue - this.minValue; 1.33676 + return h/v; 1.33677 + }, 1.33678 + 1.33679 + moveThumb: function(v, animate){ 1.33680 + if(!animate || this.animate === false){ 1.33681 + this.thumb.setBottom(v); 1.33682 + }else{ 1.33683 + this.thumb.shift({bottom: v, stopFx: true, duration:.35}); 1.33684 + } 1.33685 + }, 1.33686 + 1.33687 + onDrag: function(e){ 1.33688 + var pos = this.innerEl.translatePoints(this.tracker.getXY()); 1.33689 + var bottom = this.innerEl.getHeight()-pos.top; 1.33690 + this.setValue(Math.round(bottom/this.getRatio()), false); 1.33691 + this.fireEvent('drag', this, e); 1.33692 + }, 1.33693 + 1.33694 + onClickChange : function(local){ 1.33695 + if(local.left > this.clickRange[0] && local.left < this.clickRange[1]){ 1.33696 + var bottom = this.innerEl.getHeight()-local.top; 1.33697 + this.setValue(Math.round(bottom/this.getRatio())); 1.33698 + } 1.33699 + } 1.33700 +}; 1.33701 + 1.33702 +Ext.StatusBar = Ext.extend(Ext.Toolbar, { 1.33703 + 1.33704 + 1.33705 + 1.33706 + 1.33707 + 1.33708 + 1.33709 + 1.33710 + cls : 'x-statusbar', 1.33711 + 1.33712 + busyIconCls : 'x-status-busy', 1.33713 + 1.33714 + busyText : 'Loading...', 1.33715 + 1.33716 + autoClear : 5000, 1.33717 + 1.33718 + activeThreadId : 0, 1.33719 + 1.33720 + initComponent : function(){ 1.33721 + if(this.statusAlign=='right'){ 1.33722 + this.cls += ' x-status-right'; 1.33723 + } 1.33724 + Ext.StatusBar.superclass.initComponent.call(this); 1.33725 + }, 1.33726 + 1.33727 + afterRender : function(){ 1.33728 + Ext.StatusBar.superclass.afterRender.call(this); 1.33729 + 1.33730 + var right = this.statusAlign=='right', 1.33731 + td = Ext.get(this.nextBlock()); 1.33732 + 1.33733 + if(right){ 1.33734 + this.tr.appendChild(td.dom); 1.33735 + }else{ 1.33736 + td.insertBefore(this.tr.firstChild); 1.33737 + } 1.33738 + 1.33739 + this.statusEl = td.createChild({ 1.33740 + cls: 'x-status-text ' + (this.iconCls || this.defaultIconCls || ''), 1.33741 + html: this.text || this.defaultText || '' 1.33742 + }); 1.33743 + this.statusEl.unselectable(); 1.33744 + 1.33745 + this.spacerEl = td.insertSibling({ 1.33746 + tag: 'td', 1.33747 + style: 'width:100%', 1.33748 + cn: [{cls:'ytb-spacer'}] 1.33749 + }, right ? 'before' : 'after'); 1.33750 + }, 1.33751 + 1.33752 + 1.33753 + setStatus : function(o){ 1.33754 + o = o || {}; 1.33755 + 1.33756 + if(typeof o == 'string'){ 1.33757 + o = {text:o}; 1.33758 + } 1.33759 + if(o.text !== undefined){ 1.33760 + this.setText(o.text); 1.33761 + } 1.33762 + if(o.iconCls !== undefined){ 1.33763 + this.setIcon(o.iconCls); 1.33764 + } 1.33765 + 1.33766 + if(o.clear){ 1.33767 + var c = o.clear, 1.33768 + wait = this.autoClear, 1.33769 + defaults = {useDefaults: true, anim: true}; 1.33770 + 1.33771 + if(typeof c == 'object'){ 1.33772 + c = Ext.applyIf(c, defaults); 1.33773 + if(c.wait){ 1.33774 + wait = c.wait; 1.33775 + } 1.33776 + }else if(typeof c == 'number'){ 1.33777 + wait = c; 1.33778 + c = defaults; 1.33779 + }else if(typeof c == 'boolean'){ 1.33780 + c = defaults; 1.33781 + } 1.33782 + 1.33783 + c.threadId = this.activeThreadId; 1.33784 + this.clearStatus.defer(wait, this, [c]); 1.33785 + } 1.33786 + return this; 1.33787 + }, 1.33788 + 1.33789 + 1.33790 + clearStatus : function(o){ 1.33791 + o = o || {}; 1.33792 + 1.33793 + if(o.threadId && o.threadId !== this.activeThreadId){ 1.33794 + return this; 1.33795 + } 1.33796 + 1.33797 + var text = o.useDefaults ? this.defaultText : '', 1.33798 + iconCls = o.useDefaults ? this.defaultIconCls : ''; 1.33799 + 1.33800 + if(o.anim){ 1.33801 + this.statusEl.fadeOut({ 1.33802 + remove: false, 1.33803 + useDisplay: true, 1.33804 + scope: this, 1.33805 + callback: function(){ 1.33806 + this.setStatus({ 1.33807 + text: text, 1.33808 + iconCls: iconCls 1.33809 + }); 1.33810 + this.statusEl.show(); 1.33811 + } 1.33812 + }); 1.33813 + }else{ 1.33814 + this.statusEl.hide(); 1.33815 + this.setStatus({ 1.33816 + text: text, 1.33817 + iconCls: iconCls 1.33818 + }); 1.33819 + this.statusEl.show(); 1.33820 + } 1.33821 + return this; 1.33822 + }, 1.33823 + 1.33824 + 1.33825 + setText : function(text){ 1.33826 + this.activeThreadId++; 1.33827 + this.text = text || ''; 1.33828 + if(this.rendered){ 1.33829 + this.statusEl.update(this.text); 1.33830 + } 1.33831 + return this; 1.33832 + }, 1.33833 + 1.33834 + 1.33835 + getText : function(){ 1.33836 + return this.text; 1.33837 + }, 1.33838 + 1.33839 + 1.33840 + setIcon : function(cls){ 1.33841 + this.activeThreadId++; 1.33842 + cls = cls || ''; 1.33843 + 1.33844 + if(this.rendered){ 1.33845 + if(this.currIconCls){ 1.33846 + this.statusEl.removeClass(this.currIconCls); 1.33847 + this.currIconCls = null; 1.33848 + } 1.33849 + if(cls.length > 0){ 1.33850 + this.statusEl.addClass(cls); 1.33851 + this.currIconCls = cls; 1.33852 + } 1.33853 + }else{ 1.33854 + this.currIconCls = cls; 1.33855 + } 1.33856 + return this; 1.33857 + }, 1.33858 + 1.33859 + 1.33860 + showBusy : function(o){ 1.33861 + if(typeof o == 'string'){ 1.33862 + o = {text:o}; 1.33863 + } 1.33864 + o = Ext.applyIf(o || {}, { 1.33865 + text: this.busyText, 1.33866 + iconCls: this.busyIconCls 1.33867 + }); 1.33868 + return this.setStatus(o); 1.33869 + } 1.33870 +}); 1.33871 +Ext.reg('statusbar', Ext.StatusBar); 1.33872 + 1.33873 +Ext.debug = {}; 1.33874 + 1.33875 +(function(){ 1.33876 + 1.33877 +var cp; 1.33878 + 1.33879 +function createConsole(){ 1.33880 + 1.33881 + var scriptPanel = new Ext.debug.ScriptsPanel(); 1.33882 + var logView = new Ext.debug.LogPanel(); 1.33883 + var tree = new Ext.debug.DomTree(); 1.33884 + 1.33885 + var tabs = new Ext.TabPanel({ 1.33886 + activeTab: 0, 1.33887 + border: false, 1.33888 + tabPosition: 'bottom', 1.33889 + items: [{ 1.33890 + title: 'Debug Console', 1.33891 + layout:'border', 1.33892 + items: [logView, scriptPanel] 1.33893 + },{ 1.33894 + title: 'DOM Inspector', 1.33895 + layout:'border', 1.33896 + items: [tree] 1.33897 + }] 1.33898 + }); 1.33899 + 1.33900 + cp = new Ext.Panel({ 1.33901 + id: 'x-debug-browser', 1.33902 + title: 'Console', 1.33903 + collapsible: true, 1.33904 + animCollapse: false, 1.33905 + style: 'position:absolute;left:0;bottom:0;', 1.33906 + height:200, 1.33907 + logView: logView, 1.33908 + layout: 'fit', 1.33909 + 1.33910 + tools:[{ 1.33911 + id: 'close', 1.33912 + handler: function(){ 1.33913 + cp.destroy(); 1.33914 + cp = null; 1.33915 + Ext.EventManager.removeResizeListener(handleResize); 1.33916 + } 1.33917 + }], 1.33918 + 1.33919 + items: tabs 1.33920 + }); 1.33921 + 1.33922 + cp.render(document.body); 1.33923 + 1.33924 + cp.resizer = new Ext.Resizable(cp.el, { 1.33925 + minHeight:50, 1.33926 + handles: "n", 1.33927 + pinned: true, 1.33928 + transparent:true, 1.33929 + resizeElement : function(){ 1.33930 + var box = this.proxy.getBox(); 1.33931 + this.proxy.hide(); 1.33932 + cp.setHeight(box.height); 1.33933 + return box; 1.33934 + } 1.33935 + }); 1.33936 + 1.33937 + function handleResize(){ 1.33938 + cp.setWidth(Ext.getBody().getViewSize().width); 1.33939 + } 1.33940 + Ext.EventManager.onWindowResize(handleResize); 1.33941 + 1.33942 + handleResize(); 1.33943 +} 1.33944 + 1.33945 + 1.33946 +Ext.apply(Ext, { 1.33947 + log : function(){ 1.33948 + if(!cp){ 1.33949 + createConsole(); 1.33950 + } 1.33951 + cp.logView.log.apply(cp.logView, arguments); 1.33952 + }, 1.33953 + 1.33954 + logf : function(format, arg1, arg2, etc){ 1.33955 + Ext.log(String.format.apply(String, arguments)); 1.33956 + }, 1.33957 + 1.33958 + dump : function(o){ 1.33959 + if(typeof o == 'string' || typeof o == 'number' || typeof o == 'undefined' || Ext.isDate(o)){ 1.33960 + Ext.log(o); 1.33961 + }else if(!o){ 1.33962 + Ext.log("null"); 1.33963 + }else if(typeof o != "object"){ 1.33964 + Ext.log('Unknown return type'); 1.33965 + }else if(Ext.isArray(o)){ 1.33966 + Ext.log('['+o.join(',')+']'); 1.33967 + }else{ 1.33968 + var b = ["{\n"]; 1.33969 + for(var key in o){ 1.33970 + var to = typeof o[key]; 1.33971 + if(to != "function" && to != "object"){ 1.33972 + b.push(String.format(" {0}: {1},\n", key, o[key])); 1.33973 + } 1.33974 + } 1.33975 + var s = b.join(""); 1.33976 + if(s.length > 3){ 1.33977 + s = s.substr(0, s.length-2); 1.33978 + } 1.33979 + Ext.log(s + "\n}"); 1.33980 + } 1.33981 + }, 1.33982 + 1.33983 + _timers : {}, 1.33984 + 1.33985 + time : function(name){ 1.33986 + name = name || "def"; 1.33987 + Ext._timers[name] = new Date().getTime(); 1.33988 + }, 1.33989 + 1.33990 + timeEnd : function(name, printResults){ 1.33991 + var t = new Date().getTime(); 1.33992 + name = name || "def"; 1.33993 + var v = String.format("{0} ms", t-Ext._timers[name]); 1.33994 + Ext._timers[name] = new Date().getTime(); 1.33995 + if(printResults !== false){ 1.33996 + Ext.log('Timer ' + (name == "def" ? v : name + ": " + v)); 1.33997 + } 1.33998 + return v; 1.33999 + } 1.34000 +}); 1.34001 + 1.34002 +})(); 1.34003 + 1.34004 + 1.34005 +Ext.debug.ScriptsPanel = Ext.extend(Ext.Panel, { 1.34006 + id:'x-debug-scripts', 1.34007 + region: 'east', 1.34008 + minWidth: 200, 1.34009 + split: true, 1.34010 + width: 350, 1.34011 + border: false, 1.34012 + layout:'anchor', 1.34013 + style:'border-width:0 0 0 1px;', 1.34014 + 1.34015 + initComponent : function(){ 1.34016 + 1.34017 + this.scriptField = new Ext.form.TextArea({ 1.34018 + anchor: '100% -26', 1.34019 + style:'border-width:0;' 1.34020 + }); 1.34021 + 1.34022 + this.trapBox = new Ext.form.Checkbox({ 1.34023 + id: 'console-trap', 1.34024 + boxLabel: 'Trap Errors', 1.34025 + checked: true 1.34026 + }); 1.34027 + 1.34028 + this.toolbar = new Ext.Toolbar([{ 1.34029 + text: 'Run', 1.34030 + scope: this, 1.34031 + handler: this.evalScript 1.34032 + },{ 1.34033 + text: 'Clear', 1.34034 + scope: this, 1.34035 + handler: this.clear 1.34036 + }, 1.34037 + '->', 1.34038 + this.trapBox, 1.34039 + ' ', ' ' 1.34040 + ]); 1.34041 + 1.34042 + this.items = [this.toolbar, this.scriptField]; 1.34043 + 1.34044 + Ext.debug.ScriptsPanel.superclass.initComponent.call(this); 1.34045 + }, 1.34046 + 1.34047 + evalScript : function(){ 1.34048 + var s = this.scriptField.getValue(); 1.34049 + if(this.trapBox.getValue()){ 1.34050 + try{ 1.34051 + var rt = eval(s); 1.34052 + Ext.dump(rt === undefined? '(no return)' : rt); 1.34053 + }catch(e){ 1.34054 + Ext.log(e.message || e.descript); 1.34055 + } 1.34056 + }else{ 1.34057 + var rt = eval(s); 1.34058 + Ext.dump(rt === undefined? '(no return)' : rt); 1.34059 + } 1.34060 + }, 1.34061 + 1.34062 + clear : function(){ 1.34063 + this.scriptField.setValue(''); 1.34064 + this.scriptField.focus(); 1.34065 + } 1.34066 + 1.34067 +}); 1.34068 + 1.34069 +Ext.debug.LogPanel = Ext.extend(Ext.Panel, { 1.34070 + autoScroll: true, 1.34071 + region: 'center', 1.34072 + border: false, 1.34073 + style:'border-width:0 1px 0 0', 1.34074 + 1.34075 + log : function(){ 1.34076 + var markup = [ '<div style="padding:5px !important;border-bottom:1px solid #ccc;">', 1.34077 + Ext.util.Format.htmlEncode(Array.prototype.join.call(arguments, ', ')).replace(/\n/g, '<br />').replace(/\s/g, ' '), 1.34078 + '</div>'].join(''); 1.34079 + 1.34080 + this.body.insertHtml('beforeend', markup); 1.34081 + this.body.scrollTo('top', 100000); 1.34082 + }, 1.34083 + 1.34084 + clear : function(){ 1.34085 + this.body.update(''); 1.34086 + this.body.dom.scrollTop = 0; 1.34087 + } 1.34088 +}); 1.34089 + 1.34090 +Ext.debug.DomTree = Ext.extend(Ext.tree.TreePanel, { 1.34091 + enableDD:false , 1.34092 + lines:false, 1.34093 + rootVisible:false, 1.34094 + animate:false, 1.34095 + hlColor:'ffff9c', 1.34096 + autoScroll: true, 1.34097 + region:'center', 1.34098 + border:false, 1.34099 + 1.34100 + initComponent : function(){ 1.34101 + 1.34102 + 1.34103 + Ext.debug.DomTree.superclass.initComponent.call(this); 1.34104 + 1.34105 + var styles = false, hnode; 1.34106 + var nonSpace = /^\s*$/; 1.34107 + var html = Ext.util.Format.htmlEncode; 1.34108 + var ellipsis = Ext.util.Format.ellipsis; 1.34109 + var styleRe = /\s?([a-z\-]*)\:([^;]*)(?:[;\s\n\r]*)/gi; 1.34110 + 1.34111 + function findNode(n){ 1.34112 + if(!n || n.nodeType != 1 || n == document.body || n == document){ 1.34113 + return false; 1.34114 + } 1.34115 + var pn = [n], p = n; 1.34116 + while((p = p.parentNode) && p.nodeType == 1 && p.tagName.toUpperCase() != 'HTML'){ 1.34117 + pn.unshift(p); 1.34118 + } 1.34119 + var cn = hnode; 1.34120 + for(var i = 0, len = pn.length; i < len; i++){ 1.34121 + cn.expand(); 1.34122 + cn = cn.findChild('htmlNode', pn[i]); 1.34123 + if(!cn){ return false; 1.34124 + } 1.34125 + } 1.34126 + cn.select(); 1.34127 + var a = cn.ui.anchor; 1.34128 + treeEl.dom.scrollTop = Math.max(0 ,a.offsetTop-10); 1.34129 + cn.highlight(); 1.34130 + return true; 1.34131 + } 1.34132 + 1.34133 + function nodeTitle(n){ 1.34134 + var s = n.tagName; 1.34135 + if(n.id){ 1.34136 + s += '#'+n.id; 1.34137 + }else if(n.className){ 1.34138 + s += '.'+n.className; 1.34139 + } 1.34140 + return s; 1.34141 + } 1.34142 + 1.34143 + function onNodeSelect(t, n, last){ 1.34144 + return; 1.34145 + if(last && last.unframe){ 1.34146 + last.unframe(); 1.34147 + } 1.34148 + var props = {}; 1.34149 + if(n && n.htmlNode){ 1.34150 + if(frameEl.pressed){ 1.34151 + n.frame(); 1.34152 + } 1.34153 + if(inspecting){ 1.34154 + return; 1.34155 + } 1.34156 + addStyle.enable(); 1.34157 + reload.setDisabled(n.leaf); 1.34158 + var dom = n.htmlNode; 1.34159 + stylePanel.setTitle(nodeTitle(dom)); 1.34160 + if(styles && !showAll.pressed){ 1.34161 + var s = dom.style ? dom.style.cssText : ''; 1.34162 + if(s){ 1.34163 + var m; 1.34164 + while ((m = styleRe.exec(s)) != null){ 1.34165 + props[m[1].toLowerCase()] = m[2]; 1.34166 + } 1.34167 + } 1.34168 + }else if(styles){ 1.34169 + var cl = Ext.debug.cssList; 1.34170 + var s = dom.style, fly = Ext.fly(dom); 1.34171 + if(s){ 1.34172 + for(var i = 0, len = cl.length; i<len; i++){ 1.34173 + var st = cl[i]; 1.34174 + var v = s[st] || fly.getStyle(st); 1.34175 + if(v != undefined && v !== null && v !== ''){ 1.34176 + props[st] = v; 1.34177 + } 1.34178 + } 1.34179 + } 1.34180 + }else{ 1.34181 + for(var a in dom){ 1.34182 + var v = dom[a]; 1.34183 + if((isNaN(a+10)) && v != undefined && v !== null && v !== '' && !(Ext.isGecko && a[0] == a[0].toUpperCase())){ 1.34184 + props[a] = v; 1.34185 + } 1.34186 + } 1.34187 + } 1.34188 + }else{ 1.34189 + if(inspecting){ 1.34190 + return; 1.34191 + } 1.34192 + addStyle.disable(); 1.34193 + reload.disabled(); 1.34194 + } 1.34195 + stylesGrid.setSource(props); 1.34196 + stylesGrid.treeNode = n; 1.34197 + stylesGrid.view.fitColumns(); 1.34198 + } 1.34199 + 1.34200 + this.loader = new Ext.tree.TreeLoader(); 1.34201 + this.loader.load = function(n, cb){ 1.34202 + var isBody = n.htmlNode == document.body; 1.34203 + var cn = n.htmlNode.childNodes; 1.34204 + for(var i = 0, c; c = cn[i]; i++){ 1.34205 + if(isBody && c.id == 'x-debug-browser'){ 1.34206 + continue; 1.34207 + } 1.34208 + if(c.nodeType == 1){ 1.34209 + n.appendChild(new Ext.debug.HtmlNode(c)); 1.34210 + }else if(c.nodeType == 3 && !nonSpace.test(c.nodeValue)){ 1.34211 + n.appendChild(new Ext.tree.TreeNode({ 1.34212 + text:'<em>' + ellipsis(html(String(c.nodeValue)), 35) + '</em>', 1.34213 + cls: 'x-tree-noicon' 1.34214 + })); 1.34215 + } 1.34216 + } 1.34217 + cb(); 1.34218 + }; 1.34219 + 1.34220 + 1.34221 + this.root = this.setRootNode(new Ext.tree.TreeNode('Ext')); 1.34222 + 1.34223 + hnode = this.root.appendChild(new Ext.debug.HtmlNode( 1.34224 + document.getElementsByTagName('html')[0] 1.34225 + )); 1.34226 + 1.34227 + } 1.34228 +}); 1.34229 + 1.34230 + 1.34231 +Ext.debug.HtmlNode = function(){ 1.34232 + var html = Ext.util.Format.htmlEncode; 1.34233 + var ellipsis = Ext.util.Format.ellipsis; 1.34234 + var nonSpace = /^\s*$/; 1.34235 + 1.34236 + var attrs = [ 1.34237 + {n: 'id', v: 'id'}, 1.34238 + {n: 'className', v: 'class'}, 1.34239 + {n: 'name', v: 'name'}, 1.34240 + {n: 'type', v: 'type'}, 1.34241 + {n: 'src', v: 'src'}, 1.34242 + {n: 'href', v: 'href'} 1.34243 + ]; 1.34244 + 1.34245 + function hasChild(n){ 1.34246 + for(var i = 0, c; c = n.childNodes[i]; i++){ 1.34247 + if(c.nodeType == 1){ 1.34248 + return true; 1.34249 + } 1.34250 + } 1.34251 + return false; 1.34252 + } 1.34253 + 1.34254 + function renderNode(n, leaf){ 1.34255 + var tag = n.tagName.toLowerCase(); 1.34256 + var s = '<' + tag; 1.34257 + for(var i = 0, len = attrs.length; i < len; i++){ 1.34258 + var a = attrs[i]; 1.34259 + var v = n[a.n]; 1.34260 + if(v && !nonSpace.test(v)){ 1.34261 + s += ' ' + a.v + '="<i>' + html(v) +'</i>"'; 1.34262 + } 1.34263 + } 1.34264 + var style = n.style ? n.style.cssText : ''; 1.34265 + if(style){ 1.34266 + s += ' style="<i>' + html(style.toLowerCase()) +'</i>"'; 1.34267 + } 1.34268 + if(leaf && n.childNodes.length > 0){ 1.34269 + s+='><em>' + ellipsis(html(String(n.innerHTML)), 35) + '</em></'+tag+'>'; 1.34270 + }else if(leaf){ 1.34271 + s += ' />'; 1.34272 + }else{ 1.34273 + s += '>'; 1.34274 + } 1.34275 + return s; 1.34276 + } 1.34277 + 1.34278 + var HtmlNode = function(n){ 1.34279 + var leaf = !hasChild(n); 1.34280 + this.htmlNode = n; 1.34281 + this.tagName = n.tagName.toLowerCase(); 1.34282 + var attr = { 1.34283 + text : renderNode(n, leaf), 1.34284 + leaf : leaf, 1.34285 + cls: 'x-tree-noicon' 1.34286 + }; 1.34287 + HtmlNode.superclass.constructor.call(this, attr); 1.34288 + this.attributes.htmlNode = n; if(!leaf){ 1.34289 + this.on('expand', this.onExpand, this); 1.34290 + this.on('collapse', this.onCollapse, this); 1.34291 + } 1.34292 + }; 1.34293 + 1.34294 + 1.34295 + Ext.extend(HtmlNode, Ext.tree.AsyncTreeNode, { 1.34296 + cls: 'x-tree-noicon', 1.34297 + preventHScroll: true, 1.34298 + refresh : function(highlight){ 1.34299 + var leaf = !hasChild(this.htmlNode); 1.34300 + this.setText(renderNode(this.htmlNode, leaf)); 1.34301 + if(highlight){ 1.34302 + Ext.fly(this.ui.textNode).highlight(); 1.34303 + } 1.34304 + }, 1.34305 + 1.34306 + onExpand : function(){ 1.34307 + if(!this.closeNode && this.parentNode){ 1.34308 + this.closeNode = this.parentNode.insertBefore(new Ext.tree.TreeNode({ 1.34309 + text:'</' + this.tagName + '>', 1.34310 + cls: 'x-tree-noicon' 1.34311 + }), this.nextSibling); 1.34312 + }else if(this.closeNode){ 1.34313 + this.closeNode.ui.show(); 1.34314 + } 1.34315 + }, 1.34316 + 1.34317 + onCollapse : function(){ 1.34318 + if(this.closeNode){ 1.34319 + this.closeNode.ui.hide(); 1.34320 + } 1.34321 + }, 1.34322 + 1.34323 + render : function(bulkRender){ 1.34324 + HtmlNode.superclass.render.call(this, bulkRender); 1.34325 + }, 1.34326 + 1.34327 + highlightNode : function(){ 1.34328 + }, 1.34329 + 1.34330 + highlight : function(){ 1.34331 + }, 1.34332 + 1.34333 + frame : function(){ 1.34334 + this.htmlNode.style.border = '1px solid #0000ff'; 1.34335 + }, 1.34336 + 1.34337 + unframe : function(){ 1.34338 + this.htmlNode.style.border = ''; 1.34339 + } 1.34340 + }); 1.34341 + 1.34342 + return HtmlNode; 1.34343 +}(); 1.34344 + 1.34345 + 1.34346 +