db6e3d4f60dbaed554eed6e05f0f1bd9c8c4ab3c.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. Ext = {
  7. version : "2.0"
  8. };
  9. window["undefined"] = window["undefined"];
  10. Ext.apply = function(C, D, B) {
  11. if (B) {
  12. Ext.apply(C, B)
  13. }
  14. if (C && D && typeof D == "object") {
  15. for (var A in D) {
  16. C[A] = D[A]
  17. }
  18. }
  19. return C
  20. };
  21. (function() {
  22. var idSeed = 0;
  23. var ua = navigator.userAgent.toLowerCase();
  24. var isStrict = document.compatMode == "CSS1Compat", isOpera = ua
  25. .indexOf("opera") > -1, isSafari = (/webkit|khtml/).test(ua), isIE = !isOpera
  26. && ua.indexOf("msie") > -1, isIE7 = !isOpera
  27. && ua.indexOf("msie 7") > -1, isGecko = !isSafari
  28. && ua.indexOf("gecko") > -1, isBorderBox = isIE && !isStrict, isWindows = (ua
  29. .indexOf("windows") != -1 || ua.indexOf("win32") != -1), isMac = (ua
  30. .indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1), isLinux = (ua
  31. .indexOf("linux") != -1), isSecure = window.location.href
  32. .toLowerCase().indexOf("https") === 0;
  33. if (isIE && !isIE7) {
  34. try {
  35. document.execCommand("BackgroundImageCache", false, true)
  36. } catch (e) {
  37. }
  38. }
  39. Ext.apply(Ext, {
  40. isStrict : isStrict,
  41. isSecure : isSecure,
  42. isReady : false,
  43. enableGarbageCollector : true,
  44. enableListenerCollection : false,
  45. SSL_SECURE_URL : "javascript:false",
  46. BLANK_IMAGE_URL : "http:/" + "/extjs.com/s.gif",
  47. emptyFn : function() {
  48. },
  49. applyIf : function(o, c) {
  50. if (o && c) {
  51. for (var p in c) {
  52. if (typeof o[p] == "undefined") {
  53. o[p] = c[p]
  54. }
  55. }
  56. }
  57. return o
  58. },
  59. addBehaviors : function(o) {
  60. if (!Ext.isReady) {
  61. Ext.onReady(function() {
  62. Ext.addBehaviors(o)
  63. });
  64. return
  65. }
  66. var cache = {};
  67. for (var b in o) {
  68. var parts = b.split("@");
  69. if (parts[1]) {
  70. var s = parts[0];
  71. if (!cache[s]) {
  72. cache[s] = Ext.select(s)
  73. }
  74. cache[s].on(parts[1], o[b])
  75. }
  76. }
  77. cache = null
  78. },
  79. id : function(el, prefix) {
  80. prefix = prefix || "ext-gen";
  81. el = Ext.getDom(el);
  82. var id = prefix + (++idSeed);
  83. return el ? (el.id ? el.id : (el.id = id)) : id
  84. },
  85. extend : function() {
  86. var io = function(o) {
  87. for (var m in o) {
  88. this[m] = o[m]
  89. }
  90. };
  91. return function(sb, sp, overrides) {
  92. if (typeof sp == "object") {
  93. overrides = sp;
  94. sp = sb;
  95. sb = function() {
  96. sp.apply(this, arguments)
  97. }
  98. }
  99. var F = function() {
  100. }, sbp, spp = sp.prototype;
  101. F.prototype = spp;
  102. sbp = sb.prototype = new F();
  103. sbp.constructor = sb;
  104. sb.superclass = spp;
  105. if (spp.constructor == Object.prototype.constructor) {
  106. spp.constructor = sp
  107. }
  108. sb.override = function(o) {
  109. Ext.override(sb, o)
  110. };
  111. sbp.override = io;
  112. Ext.override(sb, overrides);
  113. return sb
  114. }
  115. }(),
  116. override : function(origclass, overrides) {
  117. if (overrides) {
  118. var p = origclass.prototype;
  119. for (var method in overrides) {
  120. p[method] = overrides[method]
  121. }
  122. }
  123. },
  124. namespace : function() {
  125. var a = arguments, o = null, i, j, d, rt;
  126. for (i = 0; i < a.length; ++i) {
  127. d = a[i].split(".");
  128. rt = d[0];
  129. eval("if (typeof " + rt + " == \"undefined\"){" + rt
  130. + " = {};} o = " + rt + ";");
  131. for (j = 1; j < d.length; ++j) {
  132. o[d[j]] = o[d[j]] || {};
  133. o = o[d[j]]
  134. }
  135. }
  136. },
  137. urlEncode : function(o) {
  138. if (!o) {
  139. return ""
  140. }
  141. var buf = [];
  142. for (var key in o) {
  143. var ov = o[key], k = encodeURIComponent(key);
  144. var type = typeof ov;
  145. if (type == "undefined") {
  146. buf.push(k, "=&")
  147. } else {
  148. if (type != "function" && type != "object") {
  149. buf.push(k, "=", encodeURIComponent(ov), "&")
  150. } else {
  151. if (ov instanceof Array) {
  152. if (ov.length) {
  153. for (var i = 0, len = ov.length; i < len; i++) {
  154. buf
  155. .push(
  156. k,
  157. "=",
  158. encodeURIComponent(ov[i] === undefined
  159. ? ""
  160. : ov[i]), "&")
  161. }
  162. } else {
  163. buf.push(k, "=&")
  164. }
  165. }
  166. }
  167. }
  168. }
  169. buf.pop();
  170. return buf.join("")
  171. },
  172. urlDecode : function(string, overwrite) {
  173. if (!string || !string.length) {
  174. return {}
  175. }
  176. var obj = {};
  177. var pairs = string.split("&");
  178. var pair, name, value;
  179. for (var i = 0, len = pairs.length; i < len; i++) {
  180. pair = pairs[i].split("=");
  181. name = decodeURIComponent(pair[0]);
  182. value = decodeURIComponent(pair[1]);
  183. if (overwrite !== true) {
  184. if (typeof obj[name] == "undefined") {
  185. obj[name] = value
  186. } else {
  187. if (typeof obj[name] == "string") {
  188. obj[name] = [obj[name]];
  189. obj[name].push(value)
  190. } else {
  191. obj[name].push(value)
  192. }
  193. }
  194. } else {
  195. obj[name] = value
  196. }
  197. }
  198. return obj
  199. },
  200. each : function(array, fn, scope) {
  201. if (typeof array.length == "undefined" || typeof array == "string") {
  202. array = [array]
  203. }
  204. for (var i = 0, len = array.length; i < len; i++) {
  205. if (fn.call(scope || array[i], array[i], i, array) === false) {
  206. return i
  207. }
  208. }
  209. },
  210. combine : function() {
  211. var as = arguments, l = as.length, r = [];
  212. for (var i = 0; i < l; i++) {
  213. var a = as[i];
  214. if (a instanceof Array) {
  215. r = r.concat(a)
  216. } else {
  217. if (a.length !== undefined && !a.substr) {
  218. r = r.concat(Array.prototype.slice.call(a, 0))
  219. } else {
  220. r.push(a)
  221. }
  222. }
  223. }
  224. return r
  225. },
  226. escapeRe : function(s) {
  227. return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1")
  228. },
  229. callback : function(cb, scope, args, delay) {
  230. if (typeof cb == "function") {
  231. if (delay) {
  232. cb.defer(delay, scope, args || [])
  233. } else {
  234. cb.apply(scope, args || [])
  235. }
  236. }
  237. },
  238. getDom : function(el) {
  239. if (!el || !document) {
  240. return null
  241. }
  242. return el.dom ? el.dom : (typeof el == "string" ? document
  243. .getElementById(el) : el)
  244. },
  245. getDoc : function() {
  246. return Ext.get(document)
  247. },
  248. getBody : function() {
  249. return Ext.get(document.body || document.documentElement)
  250. },
  251. getCmp : function(id) {
  252. return Ext.ComponentMgr.get(id)
  253. },
  254. num : function(v, defaultValue) {
  255. if (typeof v != "number") {
  256. return defaultValue
  257. }
  258. return v
  259. },
  260. destroy : function() {
  261. for (var i = 0, a = arguments, len = a.length; i < len; i++) {
  262. var as = a[i];
  263. if (as) {
  264. if (as.dom) {
  265. as.removeAllListeners();
  266. as.remove();
  267. continue
  268. }
  269. if (typeof as.destroy == "function") {
  270. as.destroy()
  271. }
  272. }
  273. }
  274. },
  275. removeNode : isIE ? function() {
  276. var d;
  277. return function(n) {
  278. if (n) {
  279. d = d || document.createElement("div");
  280. d.appendChild(n);
  281. d.innerHTML = ""
  282. }
  283. }
  284. }() : function(n) {
  285. if (n && n.parentNode) {
  286. n.parentNode.removeChild(n)
  287. }
  288. },
  289. type : function(o) {
  290. if (o === undefined || o === null) {
  291. return false
  292. }
  293. if (o.htmlElement) {
  294. return "element"
  295. }
  296. var t = typeof o;
  297. if (t == "object" && o.nodeName) {
  298. switch (o.nodeType) {
  299. case 1 :
  300. return "element";
  301. case 3 :
  302. return (/\S/).test(o.nodeValue)
  303. ? "textnode"
  304. : "whitespace"
  305. }
  306. }
  307. if (t == "object" || t == "function") {
  308. switch (o.constructor) {
  309. case Array :
  310. return "array";
  311. case RegExp :
  312. return "regexp"
  313. }
  314. if (typeof o.length == "number" && typeof o.item == "function") {
  315. return "nodelist"
  316. }
  317. }
  318. return t
  319. },
  320. isEmpty : function(v, allowBlank) {
  321. return v === null || v === undefined
  322. || (!allowBlank ? v === "" : false)
  323. },
  324. value : function(v, defaultValue, allowBlank) {
  325. return Ext.isEmpty(v, allowBlank) ? defaultValue : v
  326. },
  327. isOpera : isOpera,
  328. isSafari : isSafari,
  329. isIE : isIE,
  330. isIE6 : isIE && !isIE7,
  331. isIE7 : isIE7,
  332. isGecko : isGecko,
  333. isBorderBox : isBorderBox,
  334. isLinux : isLinux,
  335. isWindows : isWindows,
  336. isMac : isMac,
  337. isAir : !!window.htmlControl,
  338. useShims : ((isIE && !isIE7) || (isGecko && isMac))
  339. });
  340. Ext.ns = Ext.namespace
  341. })();
  342. Ext.ns("Ext", "Ext.util", "Ext.grid", "Ext.dd", "Ext.tree", "Ext.data",
  343. "Ext.form", "Ext.menu", "Ext.state", "Ext.lib", "Ext.layout",
  344. "Ext.app", "Ext.ux");
  345. Ext.apply(Function.prototype, {
  346. createCallback : function() {
  347. var A = arguments;
  348. var B = this;
  349. return function() {
  350. return B.apply(window, A)
  351. }
  352. },
  353. createDelegate : function(C, B, A) {
  354. var D = this;
  355. return function() {
  356. var F = B || arguments;
  357. if (A === true) {
  358. F = Array.prototype.slice.call(arguments, 0);
  359. F = F.concat(B)
  360. } else {
  361. if (typeof A == "number") {
  362. F = Array.prototype.slice.call(arguments, 0);
  363. var E = [A, 0].concat(B);
  364. Array.prototype.splice.apply(F, E)
  365. }
  366. }
  367. return D.apply(C || window, F)
  368. }
  369. },
  370. defer : function(C, E, B, A) {
  371. var D = this.createDelegate(E, B, A);
  372. if (C) {
  373. return setTimeout(D, C)
  374. }
  375. D();
  376. return 0
  377. },
  378. createSequence : function(B, A) {
  379. if (typeof B != "function") {
  380. return this
  381. }
  382. var C = this;
  383. return function() {
  384. var D = C.apply(this || window, arguments);
  385. B.apply(A || this || window, arguments);
  386. return D
  387. }
  388. },
  389. createInterceptor : function(B, A) {
  390. if (typeof B != "function") {
  391. return this
  392. }
  393. var C = this;
  394. return function() {
  395. B.target = this;
  396. B.method = C;
  397. if (B.apply(A || this || window, arguments) === false) {
  398. return
  399. }
  400. return C.apply(this || window, arguments)
  401. }
  402. }
  403. });
  404. Ext.applyIf(String, {
  405. escape : function(A) {
  406. return A.replace(/('|\\)/g, "\\$1")
  407. },
  408. leftPad : function(D, B, C) {
  409. var A = new String(D);
  410. if (C === null || C === undefined || C === "") {
  411. C = " "
  412. }
  413. while (A.length < B) {
  414. A = C + A
  415. }
  416. return A
  417. },
  418. format : function(B) {
  419. var A = Array.prototype.slice.call(arguments, 1);
  420. return B.replace(/\{(\d+)\}/g, function(C, D) {
  421. return A[D]
  422. })
  423. }
  424. });
  425. String.prototype.toggle = function(B, A) {
  426. return this == B ? A : B
  427. };
  428. String.prototype.trim = function() {
  429. var A = /^\s+|\s+$/g;
  430. return function() {
  431. return this.replace(A, "")
  432. }
  433. }();
  434. Ext.applyIf(Number.prototype, {
  435. constrain : function(B, A) {
  436. return Math.min(Math.max(this, B), A)
  437. }
  438. });
  439. Ext.applyIf(Array.prototype, {
  440. indexOf : function(C) {
  441. for (var B = 0, A = this.length; B < A; B++) {
  442. if (this[B] == C) {
  443. return B
  444. }
  445. }
  446. return -1
  447. },
  448. remove : function(B) {
  449. var A = this.indexOf(B);
  450. if (A != -1) {
  451. this.splice(A, 1)
  452. }
  453. return this
  454. }
  455. });
  456. Date.prototype.getElapsed = function(A) {
  457. return Math.abs((A || allGetServerTime()).getTime() - this.getTime())
  458. };
  459. (function() {
  460. var B;
  461. Ext.lib.Dom = {
  462. getViewWidth : function(D) {
  463. return D ? this.getDocumentWidth() : this.getViewportWidth()
  464. },
  465. getViewHeight : function(D) {
  466. return D ? this.getDocumentHeight() : this.getViewportHeight()
  467. },
  468. getDocumentHeight : function() {
  469. var D = (document.compatMode != "CSS1Compat")
  470. ? document.body.scrollHeight
  471. : document.documentElement.scrollHeight;
  472. return Math.max(D, this.getViewportHeight())
  473. },
  474. getDocumentWidth : function() {
  475. var D = (document.compatMode != "CSS1Compat")
  476. ? document.body.scrollWidth
  477. : document.documentElement.scrollWidth;
  478. return Math.max(D, this.getViewportWidth())
  479. },
  480. getViewportHeight : function() {
  481. var D = self.innerHeight;
  482. var E = document.compatMode;
  483. if ((E || Ext.isIE) && !Ext.isOpera) {
  484. D = (E == "CSS1Compat")
  485. ? document.documentElement.clientHeight
  486. : document.body.clientHeight
  487. }
  488. return D
  489. },
  490. getViewportWidth : function() {
  491. var D = self.innerWidth;
  492. var E = document.compatMode;
  493. if (E || Ext.isIE) {
  494. D = (E == "CSS1Compat")
  495. ? document.documentElement.clientWidth
  496. : document.body.clientWidth
  497. }
  498. return D
  499. },
  500. isAncestor : function(E, F) {
  501. E = Ext.getDom(E);
  502. F = Ext.getDom(F);
  503. if (!E || !F) {
  504. return false
  505. }
  506. if (E.contains && !Ext.isSafari) {
  507. return E.contains(F)
  508. } else {
  509. if (E.compareDocumentPosition) {
  510. return !!(E.compareDocumentPosition(F) & 16)
  511. } else {
  512. var D = F.parentNode;
  513. while (D) {
  514. if (D == E) {
  515. return true
  516. } else {
  517. if (!D.tagName || D.tagName.toUpperCase() == "HTML") {
  518. return false
  519. }
  520. }
  521. D = D.parentNode
  522. }
  523. return false
  524. }
  525. }
  526. },
  527. getRegion : function(D) {
  528. return Ext.lib.Region.getRegion(D)
  529. },
  530. getY : function(D) {
  531. return this.getXY(D)[1]
  532. },
  533. getX : function(D) {
  534. return this.getXY(D)[0]
  535. },
  536. getXY : function(F) {
  537. var E, J, L, M, I = (document.body || document.documentElement);
  538. F = Ext.getDom(F);
  539. if (F == I) {
  540. return [0, 0]
  541. }
  542. if (F.getBoundingClientRect) {
  543. L = F.getBoundingClientRect();
  544. M = C(document).getScroll();
  545. return [L.left + M.left, L.top + M.top]
  546. }
  547. var N = 0, K = 0;
  548. E = F;
  549. var D = C(F).getStyle("position") == "absolute";
  550. while (E) {
  551. N += E.offsetLeft;
  552. K += E.offsetTop;
  553. if (!D && C(E).getStyle("position") == "absolute") {
  554. D = true
  555. }
  556. if (Ext.isGecko) {
  557. J = C(E);
  558. var O = parseInt(J.getStyle("borderTopWidth"), 10) || 0;
  559. var G = parseInt(J.getStyle("borderLeftWidth"), 10) || 0;
  560. N += G;
  561. K += O;
  562. if (E != F && J.getStyle("overflow") != "visible") {
  563. N += G;
  564. K += O
  565. }
  566. }
  567. E = E.offsetParent
  568. }
  569. if (Ext.isSafari && D) {
  570. N -= I.offsetLeft;
  571. K -= I.offsetTop
  572. }
  573. if (Ext.isGecko && !D) {
  574. var H = C(I);
  575. N += parseInt(H.getStyle("borderLeftWidth"), 10) || 0;
  576. K += parseInt(H.getStyle("borderTopWidth"), 10) || 0
  577. }
  578. E = F.parentNode;
  579. while (E && E != I) {
  580. if (!Ext.isOpera
  581. || (E.tagName != "TR" && C(E).getStyle("display") != "inline")) {
  582. N -= E.scrollLeft;
  583. K -= E.scrollTop
  584. }
  585. E = E.parentNode
  586. }
  587. return [N, K]
  588. },
  589. setXY : function(D, E) {
  590. D = Ext.fly(D, "_setXY");
  591. D.position();
  592. var F = D.translatePoints(E);
  593. if (E[0] !== false) {
  594. D.dom.style.left = F.left + "px"
  595. }
  596. if (E[1] !== false) {
  597. D.dom.style.top = F.top + "px"
  598. }
  599. },
  600. setX : function(E, D) {
  601. this.setXY(E, [D, false])
  602. },
  603. setY : function(D, E) {
  604. this.setXY(D, [false, E])
  605. }
  606. };
  607. Ext.lib.Event = {
  608. getPageX : function(D) {
  609. return Event.pointerX(D.browserEvent || D)
  610. },
  611. getPageY : function(D) {
  612. return Event.pointerY(D.browserEvent || D)
  613. },
  614. getXY : function(D) {
  615. D = D.browserEvent || D;
  616. return [Event.pointerX(D), Event.pointerY(D)]
  617. },
  618. getTarget : function(D) {
  619. return Event.element(D.browserEvent || D)
  620. },
  621. resolveTextNode : function(D) {
  622. if (D && 3 == D.nodeType) {
  623. return D.parentNode
  624. } else {
  625. return D
  626. }
  627. },
  628. getRelatedTarget : function(E) {
  629. E = E.browserEvent || E;
  630. var D = E.relatedTarget;
  631. if (!D) {
  632. if (E.type == "mouseout") {
  633. D = E.toElement
  634. } else {
  635. if (E.type == "mouseover") {
  636. D = E.fromElement
  637. }
  638. }
  639. }
  640. return this.resolveTextNode(D)
  641. },
  642. on : function(F, D, E) {
  643. Event.observe(F, D, E, false)
  644. },
  645. un : function(F, D, E) {
  646. Event.stopObserving(F, D, E, false)
  647. },
  648. purgeElement : function(D) {
  649. },
  650. preventDefault : function(D) {
  651. D = D.browserEvent || D;
  652. if (D.preventDefault) {
  653. D.preventDefault()
  654. } else {
  655. D.returnValue = false
  656. }
  657. },
  658. stopPropagation : function(D) {
  659. D = D.browserEvent || D;
  660. if (D.stopPropagation) {
  661. D.stopPropagation()
  662. } else {
  663. D.cancelBubble = true
  664. }
  665. },
  666. stopEvent : function(D) {
  667. Event.stop(D.browserEvent || D)
  668. },
  669. onAvailable : function(I, E, D) {
  670. var H = allGetServerTime(), G;
  671. var F = function() {
  672. if (H.getElapsed() > 10000) {
  673. clearInterval(G)
  674. }
  675. var J = document.getElementById(I);
  676. if (J) {
  677. clearInterval(G);
  678. E.call(D || window, J)
  679. }
  680. };
  681. G = setInterval(F, 50)
  682. }
  683. };
  684. Ext.lib.Ajax = function() {
  685. var E = function(F) {
  686. return F.success ? function(G) {
  687. F.success.call(F.scope || window, {
  688. responseText : G.responseText,
  689. responseXML : G.responseXML,
  690. argument : F.argument
  691. })
  692. } : Ext.emptyFn
  693. };
  694. var D = function(F) {
  695. return F.failure ? function(G) {
  696. F.failure.call(F.scope || window, {
  697. responseText : G.responseText,
  698. responseXML : G.responseXML,
  699. argument : F.argument
  700. })
  701. } : Ext.emptyFn
  702. };
  703. return {
  704. request : function(K, H, F, I, G) {
  705. var J = {
  706. method : K,
  707. parameters : I || "",
  708. timeout : F.timeout,
  709. onSuccess : E(F),
  710. onFailure : D(F)
  711. };
  712. if (G) {
  713. if (G.headers) {
  714. J.requestHeaders = G.headers
  715. }
  716. if (G.xmlData) {
  717. K = "POST";
  718. J.contentType = "text/xml";
  719. J.postBody = G.xmlData;
  720. delete J.parameters
  721. }
  722. if (G.jsonData) {
  723. K = "POST";
  724. J.contentType = "text/javascript";
  725. J.postBody = typeof G.jsonData == "object" ? Ext
  726. .encode(G.jsonData) : G.jsonData;
  727. delete J.parameters
  728. }
  729. }
  730. new Ajax.Request(H, J)
  731. },
  732. formRequest : function(J, I, G, K, F, H) {
  733. new Ajax.Request(I, {
  734. method : Ext.getDom(J).method || "POST",
  735. parameters : Form.serialize(J) + (K ? "&" + K : ""),
  736. timeout : G.timeout,
  737. onSuccess : E(G),
  738. onFailure : D(G)
  739. })
  740. },
  741. isCallInProgress : function(F) {
  742. return false
  743. },
  744. abort : function(F) {
  745. return false
  746. },
  747. serializeForm : function(F) {
  748. return Form.serialize(F.dom || F)
  749. }
  750. }
  751. }();
  752. Ext.lib.Anim = function() {
  753. var D = {
  754. easeOut : function(F) {
  755. return 1 - Math.pow(1 - F, 2)
  756. },
  757. easeIn : function(F) {
  758. return 1 - Math.pow(1 - F, 2)
  759. }
  760. };
  761. var E = function(F, G) {
  762. return {
  763. stop : function(H) {
  764. this.effect.cancel()
  765. },
  766. isAnimated : function() {
  767. return this.effect.state == "running"
  768. },
  769. proxyCallback : function() {
  770. Ext.callback(F, G)
  771. }
  772. }
  773. };
  774. return {
  775. scroll : function(I, G, K, L, F, H) {
  776. var J = E(F, H);
  777. I = Ext.getDom(I);
  778. if (typeof G.scroll.to[0] == "number") {
  779. I.scrollLeft = G.scroll.to[0]
  780. }
  781. if (typeof G.scroll.to[1] == "number") {
  782. I.scrollTop = G.scroll.to[1]
  783. }
  784. J.proxyCallback();
  785. return J
  786. },
  787. motion : function(I, G, J, K, F, H) {
  788. return this.run(I, G, J, K, F, H)
  789. },
  790. color : function(I, G, J, K, F, H) {
  791. return this.run(I, G, J, K, F, H)
  792. },
  793. run : function(G, O, K, N, H, Q, P) {
  794. var F = {};
  795. for (var J in O) {
  796. switch (J) {
  797. case "points" :
  798. var M, S, L = Ext.fly(G, "_animrun");
  799. L.position();
  800. if (M = O.points.by) {
  801. var R = L.getXY();
  802. S = L
  803. .translatePoints([R[0] + M[0],
  804. R[1] + M[1]])
  805. } else {
  806. S = L.translatePoints(O.points.to)
  807. }
  808. F.left = S.left + "px";
  809. F.top = S.top + "px";
  810. break;
  811. case "width" :
  812. F.width = O.width.to + "px";
  813. break;
  814. case "height" :
  815. F.height = O.height.to + "px";
  816. break;
  817. case "opacity" :
  818. F.opacity = String(O.opacity.to);
  819. break;
  820. default :
  821. F[J] = String(O[J].to);
  822. break
  823. }
  824. }
  825. var I = E(H, Q);
  826. I.effect = new Effect.Morph(Ext.id(G), {
  827. duration : K,
  828. afterFinish : I.proxyCallback,
  829. transition : D[N] || Effect.Transitions.linear,
  830. style : F
  831. });
  832. return I
  833. }
  834. }
  835. }();
  836. function C(D) {
  837. if (!B) {
  838. B = new Ext.Element.Flyweight()
  839. }
  840. B.dom = D;
  841. return B
  842. }
  843. Ext.lib.Region = function(F, G, D, E) {
  844. this.top = F;
  845. this[1] = F;
  846. this.right = G;
  847. this.bottom = D;
  848. this.left = E;
  849. this[0] = E
  850. };
  851. Ext.lib.Region.prototype = {
  852. contains : function(D) {
  853. return (D.left >= this.left && D.right <= this.right
  854. && D.top >= this.top && D.bottom <= this.bottom)
  855. },
  856. getArea : function() {
  857. return ((this.bottom - this.top) * (this.right - this.left))
  858. },
  859. intersect : function(H) {
  860. var F = Math.max(this.top, H.top);
  861. var G = Math.min(this.right, H.right);
  862. var D = Math.min(this.bottom, H.bottom);
  863. var E = Math.max(this.left, H.left);
  864. if (D >= F && G >= E) {
  865. return new Ext.lib.Region(F, G, D, E)
  866. } else {
  867. return null
  868. }
  869. },
  870. union : function(H) {
  871. var F = Math.min(this.top, H.top);
  872. var G = Math.max(this.right, H.right);
  873. var D = Math.max(this.bottom, H.bottom);
  874. var E = Math.min(this.left, H.left);
  875. return new Ext.lib.Region(F, G, D, E)
  876. },
  877. constrainTo : function(D) {
  878. this.top = this.top.constrain(D.top, D.bottom);
  879. this.bottom = this.bottom.constrain(D.top, D.bottom);
  880. this.left = this.left.constrain(D.left, D.right);
  881. this.right = this.right.constrain(D.left, D.right);
  882. return this
  883. },
  884. adjust : function(F, E, D, G) {
  885. this.top += F;
  886. this.left += E;
  887. this.right += G;
  888. this.bottom += D;
  889. return this
  890. }
  891. };
  892. Ext.lib.Region.getRegion = function(G) {
  893. var I = Ext.lib.Dom.getXY(G);
  894. var F = I[1];
  895. var H = I[0] + G.offsetWidth;
  896. var D = I[1] + G.offsetHeight;
  897. var E = I[0];
  898. return new Ext.lib.Region(F, H, D, E)
  899. };
  900. Ext.lib.Point = function(D, E) {
  901. if (D instanceof Array) {
  902. E = D[1];
  903. D = D[0]
  904. }
  905. this.x = this.right = this.left = this[0] = D;
  906. this.y = this.top = this.bottom = this[1] = E
  907. };
  908. Ext.lib.Point.prototype = new Ext.lib.Region();
  909. if (Ext.isIE) {
  910. function A() {
  911. var D = Function.prototype;
  912. delete D.createSequence;
  913. delete D.defer;
  914. delete D.createDelegate;
  915. delete D.createCallback;
  916. delete D.createInterceptor;
  917. window.detachEvent("onunload", A)
  918. }
  919. window.attachEvent("onunload", A)
  920. }
  921. })();