Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2760 lines
77 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. window.undefined = window.undefined;
  2. Ext = {
  3. version : '3.2.1',
  4. versionDetail : {
  5. major: 3,
  6. minor: 2,
  7. patch: 1
  8. }
  9. };
  10. Ext.apply = function(o, c, defaults){
  11. if(defaults){
  12. Ext.apply(o, defaults);
  13. }
  14. if(o && c && typeof c == 'object'){
  15. for(var p in c){
  16. o[p] = c[p];
  17. }
  18. }
  19. return o;
  20. };
  21. (function(){
  22. var idSeed = 0,
  23. toString = Object.prototype.toString,
  24. ua = navigator.userAgent.toLowerCase(),
  25. check = function(r){
  26. return r.test(ua);
  27. },
  28. DOC = document,
  29. isStrict = DOC.compatMode == "CSS1Compat",
  30. isOpera = check(/opera/),
  31. isChrome = check(/\bchrome\b/),
  32. isWebKit = check(/webkit/),
  33. isSafari = !isChrome && check(/safari/),
  34. isSafari2 = isSafari && check(/applewebkit\/4/),
  35. isSafari3 = isSafari && check(/version\/3/),
  36. isSafari4 = isSafari && check(/version\/4/),
  37. isIE = !isOpera && check(/msie/),
  38. isIE7 = isIE && check(/msie 7/),
  39. isIE8 = isIE && check(/msie 8/),
  40. isIE6 = isIE && !isIE7 && !isIE8,
  41. isGecko = !isWebKit && check(/gecko/),
  42. isGecko2 = isGecko && check(/rv:1\.8/),
  43. isGecko3 = isGecko && check(/rv:1\.9/),
  44. isBorderBox = isIE && !isStrict,
  45. isWindows = check(/windows|win32/),
  46. isMac = check(/macintosh|mac os x/),
  47. isAir = check(/adobeair/),
  48. isLinux = check(/linux/),
  49. isSecure = /^https/i.test(window.location.protocol);
  50. if(isIE6){
  51. try{
  52. DOC.execCommand("BackgroundImageCache", false, true);
  53. }catch(e){}
  54. }
  55. Ext.apply(Ext, {
  56. SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank',
  57. isStrict : isStrict,
  58. isSecure : isSecure,
  59. isReady : false,
  60. enableGarbageCollector : true,
  61. enableListenerCollection : false,
  62. enableNestedListenerRemoval : false,
  63. USE_NATIVE_JSON : false,
  64. applyIf : function(o, c){
  65. if(o){
  66. for(var p in c){
  67. if(!Ext.isDefined(o[p])){
  68. o[p] = c[p];
  69. }
  70. }
  71. }
  72. return o;
  73. },
  74. id : function(el, prefix){
  75. el = Ext.getDom(el, true) || {};
  76. if (!el.id) {
  77. el.id = (prefix || "ext-gen") + (++idSeed);
  78. }
  79. return el.id;
  80. },
  81. extend : function(){
  82. var io = function(o){
  83. for(var m in o){
  84. this[m] = o[m];
  85. }
  86. };
  87. var oc = Object.prototype.constructor;
  88. return function(sb, sp, overrides){
  89. if(typeof sp == 'object'){
  90. overrides = sp;
  91. sp = sb;
  92. sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};
  93. }
  94. var F = function(){},
  95. sbp,
  96. spp = sp.prototype;
  97. F.prototype = spp;
  98. sbp = sb.prototype = new F();
  99. sbp.constructor=sb;
  100. sb.superclass=spp;
  101. if(spp.constructor == oc){
  102. spp.constructor=sp;
  103. }
  104. sb.override = function(o){
  105. Ext.override(sb, o);
  106. };
  107. sbp.superclass = sbp.supr = (function(){
  108. return spp;
  109. });
  110. sbp.override = io;
  111. Ext.override(sb, overrides);
  112. sb.extend = function(o){return Ext.extend(sb, o);};
  113. return sb;
  114. };
  115. }(),
  116. override : function(origclass, overrides){
  117. if(overrides){
  118. var p = origclass.prototype;
  119. Ext.apply(p, overrides);
  120. if(Ext.isIE && overrides.hasOwnProperty('toString')){
  121. p.toString = overrides.toString;
  122. }
  123. }
  124. },
  125. namespace : function(){
  126. var o, d;
  127. Ext.each(arguments, function(v) {
  128. d = v.split(".");
  129. o = window[d[0]] = window[d[0]] || {};
  130. Ext.each(d.slice(1), function(v2){
  131. o = o[v2] = o[v2] || {};
  132. });
  133. });
  134. return o;
  135. },
  136. urlEncode : function(o, pre){
  137. var empty,
  138. buf = [],
  139. e = encodeURIComponent;
  140. Ext.iterate(o, function(key, item){
  141. empty = Ext.isEmpty(item);
  142. Ext.each(empty ? key : item, function(val){
  143. buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : '');
  144. });
  145. });
  146. if(!pre){
  147. buf.shift();
  148. pre = '';
  149. }
  150. return pre + buf.join('');
  151. },
  152. urlDecode : function(string, overwrite){
  153. if(Ext.isEmpty(string)){
  154. return {};
  155. }
  156. var obj = {},
  157. pairs = string.split('&'),
  158. d = decodeURIComponent,
  159. name,
  160. value;
  161. Ext.each(pairs, function(pair) {
  162. pair = pair.split('=');
  163. name = d(pair[0]);
  164. value = d(pair[1]);
  165. obj[name] = overwrite || !obj[name] ? value :
  166. [].concat(obj[name]).concat(value);
  167. });
  168. return obj;
  169. },
  170. urlAppend : function(url, s){
  171. if(!Ext.isEmpty(s)){
  172. return url + (url.indexOf('?') === -1 ? '?' : '&') + s;
  173. }
  174. return url;
  175. },
  176. toArray : function(){
  177. return isIE ?
  178. function(a, i, j, res){
  179. res = [];
  180. for(var x = 0, len = a.length; x < len; x++) {
  181. res.push(a[x]);
  182. }
  183. return res.slice(i || 0, j || res.length);
  184. } :
  185. function(a, i, j){
  186. return Array.prototype.slice.call(a, i || 0, j || a.length);
  187. }
  188. }(),
  189. isIterable : function(v){
  190. if(Ext.isArray(v) || v.callee){
  191. return true;
  192. }
  193. if(/NodeList|HTMLCollection/.test(toString.call(v))){
  194. return true;
  195. }
  196. return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length));
  197. },
  198. each : function(array, fn, scope){
  199. if(Ext.isEmpty(array, true)){
  200. return;
  201. }
  202. if(!Ext.isIterable(array) || Ext.isPrimitive(array)){
  203. array = [array];
  204. }
  205. for(var i = 0, len = array.length; i < len; i++){
  206. if(fn.call(scope || array[i], array[i], i, array) === false){
  207. return i;
  208. };
  209. }
  210. },
  211. iterate : function(obj, fn, scope){
  212. if(Ext.isEmpty(obj)){
  213. return;
  214. }
  215. if(Ext.isIterable(obj)){
  216. Ext.each(obj, fn, scope);
  217. return;
  218. }else if(typeof obj == 'object'){
  219. for(var prop in obj){
  220. if(obj.hasOwnProperty(prop)){
  221. if(fn.call(scope || obj, prop, obj[prop], obj) === false){
  222. return;
  223. };
  224. }
  225. }
  226. }
  227. },
  228. getDom : function(el, strict){
  229. if(!el || !DOC){
  230. return null;
  231. }
  232. if (el.dom){
  233. return el.dom;
  234. } else {
  235. if (typeof el == 'string') {
  236. var e = DOC.getElementById(el);
  237. if (e && isIE && strict) {
  238. if (el == e.getAttribute('id')) {
  239. return e;
  240. } else {
  241. return null;
  242. }
  243. }
  244. return e;
  245. } else {
  246. return el;
  247. }
  248. }
  249. },
  250. getBody : function(){
  251. return Ext.get(DOC.body || DOC.documentElement);
  252. },
  253. removeNode : isIE && !isIE8 ? function(){
  254. var d;
  255. return function(n){
  256. if(n && n.tagName != 'BODY'){
  257. (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
  258. d = d || DOC.createElement('div');
  259. d.appendChild(n);
  260. d.innerHTML = '';
  261. delete Ext.elCache[n.id];
  262. }
  263. }
  264. }() : function(n){
  265. if(n && n.parentNode && n.tagName != 'BODY'){
  266. (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
  267. n.parentNode.removeChild(n);
  268. delete Ext.elCache[n.id];
  269. }
  270. },
  271. isEmpty : function(v, allowBlank){
  272. return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
  273. },
  274. isArray : function(v){
  275. return toString.apply(v) === '[object Array]';
  276. },
  277. isDate : function(v){
  278. return toString.apply(v) === '[object Date]';
  279. },
  280. isObject : function(v){
  281. return !!v && Object.prototype.toString.call(v) === '[object Object]';
  282. },
  283. isPrimitive : function(v){
  284. return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
  285. },
  286. isFunction : function(v){
  287. return toString.apply(v) === '[object Function]';
  288. },
  289. isNumber : function(v){
  290. return typeof v === 'number' && isFinite(v);
  291. },
  292. isString : function(v){
  293. return typeof v === 'string';
  294. },
  295. isBoolean : function(v){
  296. return typeof v === 'boolean';
  297. },
  298. isElement : function(v) {
  299. return v ? !!v.tagName : false;
  300. },
  301. isDefined : function(v){
  302. return typeof v !== 'undefined';
  303. },
  304. isOpera : isOpera,
  305. isWebKit : isWebKit,
  306. isChrome : isChrome,
  307. isSafari : isSafari,
  308. isSafari3 : isSafari3,
  309. isSafari4 : isSafari4,
  310. isSafari2 : isSafari2,
  311. isIE : isIE,
  312. isIE6 : isIE6,
  313. isIE7 : isIE7,
  314. isIE8 : isIE8,
  315. isGecko : isGecko,
  316. isGecko2 : isGecko2,
  317. isGecko3 : isGecko3,
  318. isBorderBox : isBorderBox,
  319. isLinux : isLinux,
  320. isWindows : isWindows,
  321. isMac : isMac,
  322. isAir : isAir
  323. });
  324. Ext.ns = Ext.namespace;
  325. })();
  326. Ext.ns("Ext.util", "Ext.lib", "Ext.data");
  327. Ext.elCache = {};
  328. Ext.apply(Function.prototype, {
  329. createInterceptor : function(fcn, scope){
  330. var method = this;
  331. return !Ext.isFunction(fcn) ?
  332. this :
  333. function() {
  334. var me = this,
  335. args = arguments;
  336. fcn.target = me;
  337. fcn.method = method;
  338. return (fcn.apply(scope || me || window, args) !== false) ?
  339. method.apply(me || window, args) :
  340. null;
  341. };
  342. },
  343. createCallback : function(){
  344. var args = arguments,
  345. method = this;
  346. return function() {
  347. return method.apply(window, args);
  348. };
  349. },
  350. createDelegate : function(obj, args, appendArgs){
  351. var method = this;
  352. return function() {
  353. var callArgs = args || arguments;
  354. if (appendArgs === true){
  355. callArgs = Array.prototype.slice.call(arguments, 0);
  356. callArgs = callArgs.concat(args);
  357. }else if (Ext.isNumber(appendArgs)){
  358. callArgs = Array.prototype.slice.call(arguments, 0);
  359. var applyArgs = [appendArgs, 0].concat(args);
  360. Array.prototype.splice.apply(callArgs, applyArgs);
  361. }
  362. return method.apply(obj || window, callArgs);
  363. };
  364. },
  365. defer : function(millis, obj, args, appendArgs){
  366. var fn = this.createDelegate(obj, args, appendArgs);
  367. if(millis > 0){
  368. return setTimeout(fn, millis);
  369. }
  370. fn();
  371. return 0;
  372. }
  373. });
  374. Ext.applyIf(String, {
  375. format : function(format){
  376. var args = Ext.toArray(arguments, 1);
  377. return format.replace(/\{(\d+)\}/g, function(m, i){
  378. return args[i];
  379. });
  380. }
  381. });
  382. Ext.applyIf(Array.prototype, {
  383. indexOf : function(o, from){
  384. var len = this.length;
  385. from = from || 0;
  386. from += (from < 0) ? len : 0;
  387. for (; from < len; ++from){
  388. if(this[from] === o){
  389. return from;
  390. }
  391. }
  392. return -1;
  393. },
  394. remove : function(o){
  395. var index = this.indexOf(o);
  396. if(index != -1){
  397. this.splice(index, 1);
  398. }
  399. return this;
  400. }
  401. });
  402. Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
  403. "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct");
  404. Ext.apply(Ext, function(){
  405. var E = Ext,
  406. idSeed = 0,
  407. scrollWidth = null;
  408. return {
  409. emptyFn : function(){},
  410. BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ?
  411. 'http:/' + '/www.extjs.com/s.gif' :
  412. 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
  413. extendX : function(supr, fn){
  414. return Ext.extend(supr, fn(supr.prototype));
  415. },
  416. getDoc : function(){
  417. return Ext.get(document);
  418. },
  419. num : function(v, defaultValue){
  420. v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v);
  421. return isNaN(v) ? defaultValue : v;
  422. },
  423. value : function(v, defaultValue, allowBlank){
  424. return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
  425. },
  426. escapeRe : function(s) {
  427. return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
  428. },
  429. sequence : function(o, name, fn, scope){
  430. o[name] = o[name].createSequence(fn, scope);
  431. },
  432. addBehaviors : function(o){
  433. if(!Ext.isReady){
  434. Ext.onReady(function(){
  435. Ext.addBehaviors(o);
  436. });
  437. } else {
  438. var cache = {},
  439. parts,
  440. b,
  441. s;
  442. for (b in o) {
  443. if ((parts = b.split('@'))[1]) {
  444. s = parts[0];
  445. if(!cache[s]){
  446. cache[s] = Ext.select(s);
  447. }
  448. cache[s].on(parts[1], o[b]);
  449. }
  450. }
  451. cache = null;
  452. }
  453. },
  454. getScrollBarWidth: function(force){
  455. if(!Ext.isReady){
  456. return 0;
  457. }
  458. if(force === true || scrollWidth === null){
  459. var div = Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
  460. child = div.child('div', true);
  461. var w1 = child.offsetWidth;
  462. div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
  463. var w2 = child.offsetWidth;
  464. div.remove();
  465. scrollWidth = w1 - w2 + 2;
  466. }
  467. return scrollWidth;
  468. },
  469. combine : function(){
  470. var as = arguments, l = as.length, r = [];
  471. for(var i = 0; i < l; i++){
  472. var a = as[i];
  473. if(Ext.isArray(a)){
  474. r = r.concat(a);
  475. }else if(a.length !== undefined && !a.substr){
  476. r = r.concat(Array.prototype.slice.call(a, 0));
  477. }else{
  478. r.push(a);
  479. }
  480. }
  481. return r;
  482. },
  483. copyTo : function(dest, source, names){
  484. if(typeof names == 'string'){
  485. names = names.split(/[,;\s]/);
  486. }
  487. Ext.each(names, function(name){
  488. if(source.hasOwnProperty(name)){
  489. dest[name] = source[name];
  490. }
  491. }, this);
  492. return dest;
  493. },
  494. destroy : function(){
  495. Ext.each(arguments, function(arg){
  496. if(arg){
  497. if(Ext.isArray(arg)){
  498. this.destroy.apply(this, arg);
  499. }else if(typeof arg.destroy == 'function'){
  500. arg.destroy();
  501. }else if(arg.dom){
  502. arg.remove();
  503. }
  504. }
  505. }, this);
  506. },
  507. destroyMembers : function(o, arg1, arg2, etc){
  508. for(var i = 1, a = arguments, len = a.length; i < len; i++) {
  509. Ext.destroy(o[a[i]]);
  510. delete o[a[i]];
  511. }
  512. },
  513. clean : function(arr){
  514. var ret = [];
  515. Ext.each(arr, function(v){
  516. if(!!v){
  517. ret.push(v);
  518. }
  519. });
  520. return ret;
  521. },
  522. unique : function(arr){
  523. var ret = [],
  524. collect = {};
  525. Ext.each(arr, function(v) {
  526. if(!collect[v]){
  527. ret.push(v);
  528. }
  529. collect[v] = true;
  530. });
  531. return ret;
  532. },
  533. flatten : function(arr){
  534. var worker = [];
  535. function rFlatten(a) {
  536. Ext.each(a, function(v) {
  537. if(Ext.isArray(v)){
  538. rFlatten(v);
  539. }else{
  540. worker.push(v);
  541. }
  542. });
  543. return worker;
  544. }
  545. return rFlatten(arr);
  546. },
  547. min : function(arr, comp){
  548. var ret = arr[0];
  549. comp = comp || function(a,b){ return a < b ? -1 : 1; };
  550. Ext.each(arr, function(v) {
  551. ret = comp(ret, v) == -1 ? ret : v;
  552. });
  553. return ret;
  554. },
  555. max : function(arr, comp){
  556. var ret = arr[0];
  557. comp = comp || function(a,b){ return a > b ? 1 : -1; };
  558. Ext.each(arr, function(v) {
  559. ret = comp(ret, v) == 1 ? ret : v;
  560. });
  561. return ret;
  562. },
  563. mean : function(arr){
  564. return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined;
  565. },
  566. sum : function(arr){
  567. var ret = 0;
  568. Ext.each(arr, function(v) {
  569. ret += v;
  570. });
  571. return ret;
  572. },
  573. partition : function(arr, truth){
  574. var ret = [[],[]];
  575. Ext.each(arr, function(v, i, a) {
  576. ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v);
  577. });
  578. return ret;
  579. },
  580. invoke : function(arr, methodName){
  581. var ret = [],
  582. args = Array.prototype.slice.call(arguments, 2);
  583. Ext.each(arr, function(v,i) {
  584. if (v && typeof v[methodName] == 'function') {
  585. ret.push(v[methodName].apply(v, args));
  586. } else {
  587. ret.push(undefined);
  588. }
  589. });
  590. return ret;
  591. },
  592. pluck : function(arr, prop){
  593. var ret = [];
  594. Ext.each(arr, function(v) {
  595. ret.push( v[prop] );
  596. });
  597. return ret;
  598. },
  599. zip : function(){
  600. var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
  601. arrs = parts[0],
  602. fn = parts[1][0],
  603. len = Ext.max(Ext.pluck(arrs, "length")),
  604. ret = [];
  605. for (var i = 0; i < len; i++) {
  606. ret[i] = [];
  607. if(fn){
  608. ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
  609. }else{
  610. for (var j = 0, aLen = arrs.length; j < aLen; j++){
  611. ret[i].push( arrs[j][i] );
  612. }
  613. }
  614. }
  615. return ret;
  616. },
  617. getCmp : function(id){
  618. return Ext.ComponentMgr.get(id);
  619. },
  620. useShims: E.isIE6 || (E.isMac && E.isGecko2),
  621. type : function(o){
  622. if(o === undefined || o === null){
  623. return false;
  624. }
  625. if(o.htmlElement){
  626. return 'element';
  627. }
  628. var t = typeof o;
  629. if(t == 'object' && o.nodeName) {
  630. switch(o.nodeType) {
  631. case 1: return 'element';
  632. case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
  633. }
  634. }
  635. if(t == 'object' || t == 'function') {
  636. switch(o.constructor) {
  637. case Array: return 'array';
  638. case RegExp: return 'regexp';
  639. case Date: return 'date';
  640. }
  641. if(typeof o.length == 'number' && typeof o.item == 'function') {
  642. return 'nodelist';
  643. }
  644. }
  645. return t;
  646. },
  647. intercept : function(o, name, fn, scope){
  648. o[name] = o[name].createInterceptor(fn, scope);
  649. },
  650. callback : function(cb, scope, args, delay){
  651. if(typeof cb == 'function'){
  652. if(delay){
  653. cb.defer(delay, scope, args || []);
  654. }else{
  655. cb.apply(scope, args || []);
  656. }
  657. }
  658. }
  659. };
  660. }());
  661. Ext.apply(Function.prototype, {
  662. createSequence : function(fcn, scope){
  663. var method = this;
  664. return (typeof fcn != 'function') ?
  665. this :
  666. function(){
  667. var retval = method.apply(this || window, arguments);
  668. fcn.apply(scope || this || window, arguments);
  669. return retval;
  670. };
  671. }
  672. });
  673. Ext.applyIf(String, {
  674. escape : function(string) {
  675. return string.replace(/('|\\)/g, "\\$1");
  676. },
  677. leftPad : function (val, size, ch) {
  678. var result = String(val);
  679. if(!ch) {
  680. ch = " ";
  681. }
  682. while (result.length < size) {
  683. result = ch + result;
  684. }
  685. return result;
  686. }
  687. });
  688. String.prototype.toggle = function(value, other){
  689. return this == value ? other : value;
  690. };
  691. String.prototype.trim = function(){
  692. var re = /^\s+|\s+$/g;
  693. return function(){ return this.replace(re, ""); };
  694. }();
  695. Date.prototype.getElapsed = function(date) {
  696. return Math.abs((date || new Date()).getTime()-this.getTime());
  697. };
  698. Ext.applyIf(Number.prototype, {
  699. constrain : function(min, max){
  700. return Math.min(Math.max(this, min), max);
  701. }
  702. });
  703. Ext.util.TaskRunner = function(interval){
  704. interval = interval || 10;
  705. var tasks = [],
  706. removeQueue = [],
  707. id = 0,
  708. running = false,
  709. stopThread = function(){
  710. running = false;
  711. clearInterval(id);
  712. id = 0;
  713. },
  714. startThread = function(){
  715. if(!running){
  716. running = true;
  717. id = setInterval(runTasks, interval);
  718. }
  719. },
  720. removeTask = function(t){
  721. removeQueue.push(t);
  722. if(t.onStop){
  723. t.onStop.apply(t.scope || t);
  724. }
  725. },
  726. runTasks = function(){
  727. var rqLen = removeQueue.length,
  728. now = new Date().getTime();
  729. if(rqLen > 0){
  730. for(var i = 0; i < rqLen; i++){
  731. tasks.remove(removeQueue[i]);
  732. }
  733. removeQueue = [];
  734. if(tasks.length < 1){
  735. stopThread();
  736. return;
  737. }
  738. }
  739. for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){
  740. t = tasks[i];
  741. itime = now - t.taskRunTime;
  742. if(t.interval <= itime){
  743. rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]);
  744. t.taskRunTime = now;
  745. if(rt === false || t.taskRunCount === t.repeat){
  746. removeTask(t);
  747. return;
  748. }
  749. }
  750. if(t.duration && t.duration <= (now - t.taskStartTime)){
  751. removeTask(t);
  752. }
  753. }
  754. };
  755. this.start = function(task){
  756. tasks.push(task);
  757. task.taskStartTime = new Date().getTime();
  758. task.taskRunTime = 0;
  759. task.taskRunCount = 0;
  760. startThread();
  761. return task;
  762. };
  763. this.stop = function(task){
  764. removeTask(task);
  765. return task;
  766. };
  767. this.stopAll = function(){
  768. stopThread();
  769. for(var i = 0, len = tasks.length; i < len; i++){
  770. if(tasks[i].onStop){
  771. tasks[i].onStop();
  772. }
  773. }
  774. tasks = [];
  775. removeQueue = [];
  776. };
  777. };
  778. Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
  779. var libFlyweight;
  780. function fly(el) {
  781. if (!libFlyweight) {
  782. libFlyweight = new Ext.Element.Flyweight();
  783. }
  784. libFlyweight.dom = el;
  785. return libFlyweight;
  786. }
  787. (function(){
  788. var doc = document,
  789. isCSS1 = doc.compatMode == "CSS1Compat",
  790. MAX = Math.max,
  791. ROUND = Math.round,
  792. PARSEINT = parseInt;
  793. Ext.lib.Dom = {
  794. isAncestor : function(p, c) {
  795. var ret = false;
  796. p = Ext.getDom(p);
  797. c = Ext.getDom(c);
  798. if (p && c) {
  799. if (p.contains) {
  800. return p.contains(c);
  801. } else if (p.compareDocumentPosition) {
  802. return !!(p.compareDocumentPosition(c) & 16);
  803. } else {
  804. while (c = c.parentNode) {
  805. ret = c == p || ret;
  806. }
  807. }
  808. }
  809. return ret;
  810. },
  811. getViewWidth : function(full) {
  812. return full ? this.getDocumentWidth() : this.getViewportWidth();
  813. },
  814. getViewHeight : function(full) {
  815. return full ? this.getDocumentHeight() : this.getViewportHeight();
  816. },
  817. getDocumentHeight: function() {
  818. return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
  819. },
  820. getDocumentWidth: function() {
  821. return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
  822. },
  823. getViewportHeight: function(){
  824. return Ext.isIE ?
  825. (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
  826. self.innerHeight;
  827. },
  828. getViewportWidth : function() {
  829. return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
  830. Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
  831. },
  832. getY : function(el) {
  833. return this.getXY(el)[1];
  834. },
  835. getX : function(el) {
  836. return this.getXY(el)[0];
  837. },
  838. getXY : function(el) {
  839. var p,
  840. pe,
  841. b,
  842. bt,
  843. bl,
  844. dbd,
  845. x = 0,
  846. y = 0,
  847. scroll,
  848. hasAbsolute,
  849. bd = (doc.body || doc.documentElement),
  850. ret = [0,0];
  851. el = Ext.getDom(el);
  852. if(el != bd){
  853. if (el.getBoundingClientRect) {
  854. b = el.getBoundingClientRect();
  855. scroll = fly(document).getScroll();
  856. ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
  857. } else {
  858. p = el;
  859. hasAbsolute = fly(el).isStyle("position", "absolute");
  860. while (p) {
  861. pe = fly(p);
  862. x += p.offsetLeft;
  863. y += p.offsetTop;
  864. hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
  865. if (Ext.isGecko) {
  866. y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
  867. x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;
  868. if (p != el && !pe.isStyle('overflow','visible')) {
  869. x += bl;
  870. y += bt;
  871. }
  872. }
  873. p = p.offsetParent;
  874. }
  875. if (Ext.isSafari && hasAbsolute) {
  876. x -= bd.offsetLeft;
  877. y -= bd.offsetTop;
  878. }
  879. if (Ext.isGecko && !hasAbsolute) {
  880. dbd = fly(bd);
  881. x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
  882. y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
  883. }
  884. p = el.parentNode;
  885. while (p && p != bd) {
  886. if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
  887. x -= p.scrollLeft;
  888. y -= p.scrollTop;
  889. }
  890. p = p.parentNode;
  891. }
  892. ret = [x,y];
  893. }
  894. }
  895. return ret
  896. },
  897. setXY : function(el, xy) {
  898. (el = Ext.fly(el, '_setXY')).position();
  899. var pts = el.translatePoints(xy),
  900. style = el.dom.style,
  901. pos;
  902. for (pos in pts) {
  903. if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px"
  904. }
  905. },
  906. setX : function(el, x) {
  907. this.setXY(el, [x, false]);
  908. },
  909. setY : function(el, y) {
  910. this.setXY(el, [false, y]);
  911. }
  912. };
  913. })();Ext.lib.Dom.getRegion = function(el) {
  914. return Ext.lib.Region.getRegion(el);
  915. };Ext.lib.Event = function() {
  916. var loadComplete = false,
  917. unloadListeners = {},
  918. retryCount = 0,
  919. onAvailStack = [],
  920. _interval,
  921. locked = false,
  922. win = window,
  923. doc = document,
  924. POLL_RETRYS = 200,
  925. POLL_INTERVAL = 20,
  926. EL = 0,
  927. TYPE = 0,
  928. FN = 1,
  929. WFN = 2,
  930. OBJ = 2,
  931. ADJ_SCOPE = 3,
  932. SCROLLLEFT = 'scrollLeft',
  933. SCROLLTOP = 'scrollTop',
  934. UNLOAD = 'unload',
  935. MOUSEOVER = 'mouseover',
  936. MOUSEOUT = 'mouseout',
  937. doAdd = function() {
  938. var ret;
  939. if (win.addEventListener) {
  940. ret = function(el, eventName, fn, capture) {
  941. if (eventName == 'mouseenter') {
  942. fn = fn.createInterceptor(checkRelatedTarget);
  943. el.addEventListener(MOUSEOVER, fn, (capture));
  944. } else if (eventName == 'mouseleave') {
  945. fn = fn.createInterceptor(checkRelatedTarget);
  946. el.addEventListener(MOUSEOUT, fn, (capture));
  947. } else {
  948. el.addEventListener(eventName, fn, (capture));
  949. }
  950. return fn;
  951. };
  952. } else if (win.attachEvent) {
  953. ret = function(el, eventName, fn, capture) {
  954. el.attachEvent("on" + eventName, fn);
  955. return fn;
  956. };
  957. } else {
  958. ret = function(){};
  959. }
  960. return ret;
  961. }(),
  962. doRemove = function(){
  963. var ret;
  964. if (win.removeEventListener) {
  965. ret = function (el, eventName, fn, capture) {
  966. if (eventName == 'mouseenter') {
  967. eventName = MOUSEOVER;
  968. } else if (eventName == 'mouseleave') {
  969. eventName = MOUSEOUT;
  970. }
  971. el.removeEventListener(eventName, fn, (capture));
  972. };
  973. } else if (win.detachEvent) {
  974. ret = function (el, eventName, fn) {
  975. el.detachEvent("on" + eventName, fn);
  976. };
  977. } else {
  978. ret = function(){};
  979. }
  980. return ret;
  981. }();
  982. function checkRelatedTarget(e) {
  983. return !elContains(e.currentTarget, pub.getRelatedTarget(e));
  984. }
  985. function elContains(parent, child) {
  986. if(parent && parent.firstChild){
  987. while(child) {
  988. if(child === parent) {
  989. return true;
  990. }
  991. child = child.parentNode;
  992. if(child && (child.nodeType != 1)) {
  993. child = null;
  994. }
  995. }
  996. }
  997. return false;
  998. }
  999. function _tryPreloadAttach() {
  1000. var ret = false,
  1001. notAvail = [],
  1002. element, i, v, override,
  1003. tryAgain = !loadComplete || (retryCount > 0);
  1004. if(!locked){
  1005. locked = true;
  1006. for(i = 0; i < onAvailStack.length; ++i){
  1007. v = onAvailStack[i];
  1008. if(v && (element = doc.getElementById(v.id))){
  1009. if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) {
  1010. override = v.override;
  1011. element = override ? (override === true ? v.obj : override) : element;
  1012. v.fn.call(element, v.obj);
  1013. onAvailStack.remove(v);
  1014. --i;
  1015. }else{
  1016. notAvail.push(v);
  1017. }
  1018. }
  1019. }
  1020. retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
  1021. if (tryAgain) {
  1022. startInterval();
  1023. } else {
  1024. clearInterval(_interval);
  1025. _interval = null;
  1026. }
  1027. ret = !(locked = false);
  1028. }
  1029. return ret;
  1030. }
  1031. function startInterval() {
  1032. if(!_interval){
  1033. var callback = function() {
  1034. _tryPreloadAttach();
  1035. };
  1036. _interval = setInterval(callback, POLL_INTERVAL);
  1037. }
  1038. }
  1039. function getScroll() {
  1040. var dd = doc.documentElement,
  1041. db = doc.body;
  1042. if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){
  1043. return [dd[SCROLLLEFT], dd[SCROLLTOP]];
  1044. }else if(db){
  1045. return [db[SCROLLLEFT], db[SCROLLTOP]];
  1046. }else{
  1047. return [0, 0];
  1048. }
  1049. }
  1050. function getPageCoord (ev, xy) {
  1051. ev = ev.browserEvent || ev;
  1052. var coord = ev['page' + xy];
  1053. if (!coord && coord !== 0) {
  1054. coord = ev['client' + xy] || 0;
  1055. if (Ext.isIE) {
  1056. coord += getScroll()[xy == "X" ? 0 : 1];
  1057. }
  1058. }
  1059. return coord;
  1060. }
  1061. var pub = {
  1062. extAdapter: true,
  1063. onAvailable : function(p_id, p_fn, p_obj, p_override) {
  1064. onAvailStack.push({
  1065. id: p_id,
  1066. fn: p_fn,
  1067. obj: p_obj,
  1068. override: p_override,
  1069. checkReady: false });
  1070. retryCount = POLL_RETRYS;
  1071. startInterval();
  1072. },
  1073. addListener: function(el, eventName, fn) {
  1074. el = Ext.getDom(el);
  1075. if (el && fn) {
  1076. if (eventName == UNLOAD) {
  1077. if (unloadListeners[el.id] === undefined) {
  1078. unloadListeners[el.id] = [];
  1079. }
  1080. unloadListeners[el.id].push([eventName, fn]);
  1081. return fn;
  1082. }
  1083. return doAdd(el, eventName, fn, false);
  1084. }
  1085. return false;
  1086. },
  1087. removeListener: function(el, eventName, fn) {
  1088. el = Ext.getDom(el);
  1089. var i, len, li, lis;
  1090. if (el && fn) {
  1091. if(eventName == UNLOAD){
  1092. if((lis = unloadListeners[el.id]) !== undefined){
  1093. for(i = 0, len = lis.length; i < len; i++){
  1094. if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){
  1095. unloadListeners[el.id].splice(i, 1);
  1096. }
  1097. }
  1098. }
  1099. return;
  1100. }
  1101. doRemove(el, eventName, fn, false);
  1102. }
  1103. },
  1104. getTarget : function(ev) {
  1105. ev = ev.browserEvent || ev;
  1106. return this.resolveTextNode(ev.target || ev.srcElement);
  1107. },
  1108. resolveTextNode : Ext.isGecko ? function(node){
  1109. if(!node){
  1110. return;
  1111. }
  1112. var s = HTMLElement.prototype.toString.call(node);
  1113. if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){
  1114. return;
  1115. }
  1116. return node.nodeType == 3 ? node.parentNode : node;
  1117. } : function(node){
  1118. return node && node.nodeType == 3 ? node.parentNode : node;
  1119. },
  1120. getRelatedTarget : function(ev) {
  1121. ev = ev.browserEvent || ev;
  1122. return this.resolveTextNode(ev.relatedTarget ||
  1123. (ev.type == MOUSEOUT ? ev.toElement :
  1124. ev.type == MOUSEOVER ? ev.fromElement : null));
  1125. },
  1126. getPageX : function(ev) {
  1127. return getPageCoord(ev, "X");
  1128. },
  1129. getPageY : function(ev) {
  1130. return getPageCoord(ev, "Y");
  1131. },
  1132. getXY : function(ev) {
  1133. return [this.getPageX(ev), this.getPageY(ev)];
  1134. },
  1135. stopEvent : function(ev) {
  1136. this.stopPropagation(ev);
  1137. this.preventDefault(ev);
  1138. },
  1139. stopPropagation : function(ev) {
  1140. ev = ev.browserEvent || ev;
  1141. if (ev.stopPropagation) {
  1142. ev.stopPropagation();
  1143. } else {
  1144. ev.cancelBubble = true;
  1145. }
  1146. },
  1147. preventDefault : function(ev) {
  1148. ev = ev.browserEvent || ev;
  1149. if (ev.preventDefault) {
  1150. ev.preventDefault();
  1151. } else {
  1152. ev.returnValue = false;
  1153. }
  1154. },
  1155. getEvent : function(e) {
  1156. e = e || win.event;
  1157. if (!e) {
  1158. var c = this.getEvent.caller;
  1159. while (c) {
  1160. e = c.arguments[0];
  1161. if (e && Event == e.constructor) {
  1162. break;
  1163. }
  1164. c = c.caller;
  1165. }
  1166. }
  1167. return e;
  1168. },
  1169. getCharCode : function(ev) {
  1170. ev = ev.browserEvent || ev;
  1171. return ev.charCode || ev.keyCode || 0;
  1172. },
  1173. getListeners : function(el, eventName) {
  1174. Ext.EventManager.getListeners(el, eventName);
  1175. },
  1176. purgeElement : function(el, recurse, eventName) {
  1177. Ext.EventManager.purgeElement(el, recurse, eventName);
  1178. },
  1179. _load : function(e) {
  1180. loadComplete = true;
  1181. var EU = Ext.lib.Event;
  1182. if (Ext.isIE && e !== true) {
  1183. doRemove(win, "load", arguments.callee);
  1184. }
  1185. },
  1186. _unload : function(e) {
  1187. var EU = Ext.lib.Event,
  1188. i, j, l, v, ul, id, len, index, scope;
  1189. for (id in unloadListeners) {
  1190. ul = unloadListeners[id];
  1191. for (i = 0, len = ul.length; i < len; i++) {
  1192. v = ul[i];
  1193. if (v) {
  1194. try{
  1195. scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) : win;
  1196. v[FN].call(scope, EU.getEvent(e), v[OBJ]);
  1197. }catch(ex){}
  1198. }
  1199. }
  1200. };
  1201. Ext.EventManager._unload();
  1202. doRemove(win, UNLOAD, EU._unload);
  1203. }
  1204. };
  1205. pub.on = pub.addListener;
  1206. pub.un = pub.removeListener;
  1207. if (doc && doc.body) {
  1208. pub._load(true);
  1209. } else {
  1210. doAdd(win, "load", pub._load);
  1211. }
  1212. doAdd(win, UNLOAD, pub._unload);
  1213. _tryPreloadAttach();
  1214. return pub;
  1215. }();
  1216. Ext.lib.Ajax = function() {
  1217. var activeX = ['MSXML2.XMLHTTP.3.0',
  1218. 'MSXML2.XMLHTTP',
  1219. 'Microsoft.XMLHTTP'],
  1220. CONTENTTYPE = 'Content-Type';
  1221. function setHeader(o) {
  1222. var conn = o.conn,
  1223. prop;
  1224. function setTheHeaders(conn, headers){
  1225. for (prop in headers) {
  1226. if (headers.hasOwnProperty(prop)) {
  1227. conn.setRequestHeader(prop, headers[prop]);
  1228. }
  1229. }
  1230. }
  1231. if (pub.defaultHeaders) {
  1232. setTheHeaders(conn, pub.defaultHeaders);
  1233. }
  1234. if (pub.headers) {
  1235. setTheHeaders(conn, pub.headers);
  1236. delete pub.headers;
  1237. }
  1238. }
  1239. function createExceptionObject(tId, callbackArg, isAbort, isTimeout) {
  1240. return {
  1241. tId : tId,
  1242. status : isAbort ? -1 : 0,
  1243. statusText : isAbort ? 'transaction aborted' : 'communication failure',
  1244. isAbort: isAbort,
  1245. isTimeout: isTimeout,
  1246. argument : callbackArg
  1247. };
  1248. }
  1249. function initHeader(label, value) {
  1250. (pub.headers = pub.headers || {})[label] = value;
  1251. }
  1252. function createResponseObject(o, callbackArg) {
  1253. var headerObj = {},
  1254. headerStr,
  1255. conn = o.conn,
  1256. t,
  1257. s,
  1258. isBrokenStatus = conn.status == 1223;
  1259. try {
  1260. headerStr = o.conn.getAllResponseHeaders();
  1261. Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){
  1262. t = v.indexOf(':');
  1263. if(t >= 0){
  1264. s = v.substr(0, t).toLowerCase();
  1265. if(v.charAt(t + 1) == ' '){
  1266. ++t;
  1267. }
  1268. headerObj[s] = v.substr(t + 1);
  1269. }
  1270. });
  1271. } catch(e) {}
  1272. return {
  1273. tId : o.tId,
  1274. status : isBrokenStatus ? 204 : conn.status,
  1275. statusText : isBrokenStatus ? 'No Content' : conn.statusText,
  1276. getResponseHeader : function(header){return headerObj[header.toLowerCase()];},
  1277. getAllResponseHeaders : function(){return headerStr},
  1278. responseText : conn.responseText,
  1279. responseXML : conn.responseXML,
  1280. argument : callbackArg
  1281. };
  1282. }
  1283. function releaseObject(o) {
  1284. if (o.tId) {
  1285. pub.conn[o.tId] = null;
  1286. }
  1287. o.conn = null;
  1288. o = null;
  1289. }
  1290. function handleTransactionResponse(o, callback, isAbort, isTimeout) {
  1291. if (!callback) {
  1292. releaseObject(o);
  1293. return;
  1294. }
  1295. var httpStatus, responseObject;
  1296. try {
  1297. if (o.conn.status !== undefined && o.conn.status != 0) {
  1298. httpStatus = o.conn.status;
  1299. }
  1300. else {
  1301. httpStatus = 13030;
  1302. }
  1303. }
  1304. catch(e) {
  1305. httpStatus = 13030;
  1306. }
  1307. if ((httpStatus >= 200 && httpStatus < 300) || (Ext.isIE && httpStatus == 1223)) {
  1308. responseObject = createResponseObject(o, callback.argument);
  1309. if (callback.success) {
  1310. if (!callback.scope) {
  1311. callback.success(responseObject);
  1312. }
  1313. else {
  1314. callback.success.apply(callback.scope, [responseObject]);
  1315. }
  1316. }
  1317. }
  1318. else {
  1319. switch (httpStatus) {
  1320. case 12002:
  1321. case 12029:
  1322. case 12030:
  1323. case 12031:
  1324. case 12152:
  1325. case 13030:
  1326. responseObject = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout);
  1327. if (callback.failure) {
  1328. if (!callback.scope) {
  1329. callback.failure(responseObject);
  1330. }
  1331. else {
  1332. callback.failure.apply(callback.scope, [responseObject]);
  1333. }
  1334. }
  1335. break;
  1336. default:
  1337. responseObject = createResponseObject(o, callback.argument);
  1338. if (callback.failure) {
  1339. if (!callback.scope) {
  1340. callback.failure(responseObject);
  1341. }
  1342. else {
  1343. callback.failure.apply(callback.scope, [responseObject]);
  1344. }
  1345. }
  1346. }
  1347. }
  1348. releaseObject(o);
  1349. responseObject = null;
  1350. }
  1351. function handleReadyState(o, callback){
  1352. callback = callback || {};
  1353. var conn = o.conn,
  1354. tId = o.tId,
  1355. poll = pub.poll,
  1356. cbTimeout = callback.timeout || null;
  1357. if (cbTimeout) {
  1358. pub.conn[tId] = conn;
  1359. pub.timeout[tId] = setTimeout(function() {
  1360. pub.abort(o, callback, true);
  1361. }, cbTimeout);
  1362. }
  1363. poll[tId] = setInterval(
  1364. function() {
  1365. if (conn && conn.readyState == 4) {
  1366. clearInterval(poll[tId]);
  1367. poll[tId] = null;
  1368. if (cbTimeout) {
  1369. clearTimeout(pub.timeout[tId]);
  1370. pub.timeout[tId] = null;
  1371. }
  1372. handleTransactionResponse(o, callback);
  1373. }
  1374. },
  1375. pub.pollInterval);
  1376. }
  1377. function asyncRequest(method, uri, callback, postData) {
  1378. var o = getConnectionObject() || null;
  1379. if (o) {
  1380. o.conn.open(method, uri, true);
  1381. if (pub.useDefaultXhrHeader) {
  1382. initHeader('X-Requested-With', pub.defaultXhrHeader);
  1383. }
  1384. if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){
  1385. initHeader(CONTENTTYPE, pub.defaultPostHeader);
  1386. }
  1387. if (pub.defaultHeaders || pub.headers) {
  1388. setHeader(o);
  1389. }
  1390. handleReadyState(o, callback);
  1391. o.conn.send(postData || null);
  1392. }
  1393. return o;
  1394. }
  1395. function getConnectionObject() {
  1396. var o;
  1397. try {
  1398. if (o = createXhrObject(pub.transactionId)) {
  1399. pub.transactionId++;
  1400. }
  1401. } catch(e) {
  1402. } finally {
  1403. return o;
  1404. }
  1405. }
  1406. function createXhrObject(transactionId) {
  1407. var http;
  1408. try {
  1409. http = new XMLHttpRequest();
  1410. } catch(e) {
  1411. for (var i = 0; i < activeX.length; ++i) {
  1412. try {
  1413. http = new ActiveXObject(activeX[i]);
  1414. break;
  1415. } catch(e) {}
  1416. }
  1417. } finally {
  1418. return {conn : http, tId : transactionId};
  1419. }
  1420. }
  1421. var pub = {
  1422. request : function(method, uri, cb, data, options) {
  1423. if(options){
  1424. var me = this,
  1425. xmlData = options.xmlData,
  1426. jsonData = options.jsonData,
  1427. hs;
  1428. Ext.applyIf(me, options);
  1429. if(xmlData || jsonData){
  1430. hs = me.headers;
  1431. if(!hs || !hs[CONTENTTYPE]){
  1432. initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json');
  1433. }
  1434. data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData);
  1435. }
  1436. }
  1437. return asyncRequest(method || options.method || "POST", uri, cb, data);
  1438. },
  1439. serializeForm : function(form) {
  1440. var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements,
  1441. hasSubmit = false,
  1442. encoder = encodeURIComponent,
  1443. element,
  1444. options,
  1445. name,
  1446. val,
  1447. data = '',
  1448. type;
  1449. Ext.each(fElements, function(element) {
  1450. name = element.name;
  1451. type = element.type;
  1452. if (!element.disabled && name){
  1453. if(/select-(one|multiple)/i.test(type)) {
  1454. Ext.each(element.options, function(opt) {
  1455. if (opt.selected) {
  1456. data += String.format("{0}={1}&", encoder(name), encoder((opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttribute('value') !== null) ? opt.value : opt.text));
  1457. }
  1458. });
  1459. } else if(!/file|undefined|reset|button/i.test(type)) {
  1460. if(!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)){
  1461. data += encoder(name) + '=' + encoder(element.value) + '&';
  1462. hasSubmit = /submit/i.test(type);
  1463. }
  1464. }
  1465. }
  1466. });
  1467. return data.substr(0, data.length - 1);
  1468. },
  1469. useDefaultHeader : true,
  1470. defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8',
  1471. useDefaultXhrHeader : true,
  1472. defaultXhrHeader : 'XMLHttpRequest',
  1473. poll : {},
  1474. timeout : {},
  1475. conn: {},
  1476. pollInterval : 50,
  1477. transactionId : 0,
  1478. abort : function(o, callback, isTimeout) {
  1479. var me = this,
  1480. tId = o.tId,
  1481. isAbort = false;
  1482. if (me.isCallInProgress(o)) {
  1483. o.conn.abort();
  1484. clearInterval(me.poll[tId]);
  1485. me.poll[tId] = null;
  1486. clearTimeout(pub.timeout[tId]);
  1487. me.timeout[tId] = null;
  1488. handleTransactionResponse(o, callback, (isAbort = true), isTimeout);
  1489. }
  1490. return isAbort;
  1491. },
  1492. isCallInProgress : function(o) {
  1493. return o.conn && !{0:true,4:true}[o.conn.readyState];
  1494. }
  1495. };
  1496. return pub;
  1497. }(); Ext.lib.Region = function(t, r, b, l) {
  1498. var me = this;
  1499. me.top = t;
  1500. me[1] = t;
  1501. me.right = r;
  1502. me.bottom = b;
  1503. me.left = l;
  1504. me[0] = l;
  1505. };
  1506. Ext.lib.Region.prototype = {
  1507. contains : function(region) {
  1508. var me = this;
  1509. return ( region.left >= me.left &&
  1510. region.right <= me.right &&
  1511. region.top >= me.top &&
  1512. region.bottom <= me.bottom );
  1513. },
  1514. getArea : function() {
  1515. var me = this;
  1516. return ( (me.bottom - me.top) * (me.right - me.left) );
  1517. },
  1518. intersect : function(region) {
  1519. var me = this,
  1520. t = Math.max(me.top, region.top),
  1521. r = Math.min(me.right, region.right),
  1522. b = Math.min(me.bottom, region.bottom),
  1523. l = Math.max(me.left, region.left);
  1524. if (b >= t && r >= l) {
  1525. return new Ext.lib.Region(t, r, b, l);
  1526. }
  1527. },
  1528. union : function(region) {
  1529. var me = this,
  1530. t = Math.min(me.top, region.top),
  1531. r = Math.max(me.right, region.right),
  1532. b = Math.max(me.bottom, region.bottom),
  1533. l = Math.min(me.left, region.left);
  1534. return new Ext.lib.Region(t, r, b, l);
  1535. },
  1536. constrainTo : function(r) {
  1537. var me = this;
  1538. me.top = me.top.constrain(r.top, r.bottom);
  1539. me.bottom = me.bottom.constrain(r.top, r.bottom);
  1540. me.left = me.left.constrain(r.left, r.right);
  1541. me.right = me.right.constrain(r.left, r.right);
  1542. return me;
  1543. },
  1544. adjust : function(t, l, b, r) {
  1545. var me = this;
  1546. me.top += t;
  1547. me.left += l;
  1548. me.right += r;
  1549. me.bottom += b;
  1550. return me;
  1551. }
  1552. };
  1553. Ext.lib.Region.getRegion = function(el) {
  1554. var p = Ext.lib.Dom.getXY(el),
  1555. t = p[1],
  1556. r = p[0] + el.offsetWidth,
  1557. b = p[1] + el.offsetHeight,
  1558. l = p[0];
  1559. return new Ext.lib.Region(t, r, b, l);
  1560. }; Ext.lib.Point = function(x, y) {
  1561. if (Ext.isArray(x)) {
  1562. y = x[1];
  1563. x = x[0];
  1564. }
  1565. var me = this;
  1566. me.x = me.right = me.left = me[0] = x;
  1567. me.y = me.top = me.bottom = me[1] = y;
  1568. };
  1569. Ext.lib.Point.prototype = new Ext.lib.Region();
  1570. (function(){
  1571. var EXTLIB = Ext.lib,
  1572. noNegatives = /width|height|opacity|padding/i,
  1573. offsetAttribute = /^((width|height)|(top|left))$/,
  1574. defaultUnit = /width|height|top$|bottom$|left$|right$/i,
  1575. offsetUnit = /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,
  1576. isset = function(v){
  1577. return typeof v !== 'undefined';
  1578. },
  1579. now = function(){
  1580. return new Date();
  1581. };
  1582. EXTLIB.Anim = {
  1583. motion : function(el, args, duration, easing, cb, scope) {
  1584. return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);
  1585. },
  1586. run : function(el, args, duration, easing, cb, scope, type) {
  1587. type = type || Ext.lib.AnimBase;
  1588. if (typeof easing == "string") {
  1589. easing = Ext.lib.Easing[easing];
  1590. }
  1591. var anim = new type(el, args, duration, easing);
  1592. anim.animateX(function() {
  1593. if(Ext.isFunction(cb)){
  1594. cb.call(scope);
  1595. }
  1596. });
  1597. return anim;
  1598. }
  1599. };
  1600. EXTLIB.AnimBase = function(el, attributes, duration, method) {
  1601. if (el) {
  1602. this.init(el, attributes, duration, method);
  1603. }
  1604. };
  1605. EXTLIB.AnimBase.prototype = {
  1606. doMethod: function(attr, start, end) {
  1607. var me = this;
  1608. return me.method(me.curFrame, start, end - start, me.totalFrames);
  1609. },
  1610. setAttr: function(attr, val, unit) {
  1611. if (noNegatives.test(attr) && val < 0) {
  1612. val = 0;
  1613. }
  1614. Ext.fly(this.el, '_anim').setStyle(attr, val + unit);
  1615. },
  1616. getAttr: function(attr) {
  1617. var el = Ext.fly(this.el),
  1618. val = el.getStyle(attr),
  1619. a = offsetAttribute.exec(attr) || [];
  1620. if (val !== 'auto' && !offsetUnit.test(val)) {
  1621. return parseFloat(val);
  1622. }
  1623. return (!!(a[2]) || (el.getStyle('position') == 'absolute' && !!(a[3]))) ? el.dom['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)] : 0;
  1624. },
  1625. getDefaultUnit: function(attr) {
  1626. return defaultUnit.test(attr) ? 'px' : '';
  1627. },
  1628. animateX : function(callback, scope) {
  1629. var me = this,
  1630. f = function() {
  1631. me.onComplete.removeListener(f);
  1632. if (Ext.isFunction(callback)) {
  1633. callback.call(scope || me, me);
  1634. }
  1635. };
  1636. me.onComplete.addListener(f, me);
  1637. me.animate();
  1638. },
  1639. setRunAttr: function(attr) {
  1640. var me = this,
  1641. a = this.attributes[attr],
  1642. to = a.to,
  1643. by = a.by,
  1644. from = a.from,
  1645. unit = a.unit,
  1646. ra = (this.runAttrs[attr] = {}),
  1647. end;
  1648. if (!isset(to) && !isset(by)){
  1649. return false;
  1650. }
  1651. var start = isset(from) ? from : me.getAttr(attr);
  1652. if (isset(to)) {
  1653. end = to;
  1654. }else if(isset(by)) {
  1655. if (Ext.isArray(start)){
  1656. end = [];
  1657. for(var i=0,len=start.length; i<len; i++) {
  1658. end[i] = start[i] + by[i];
  1659. }
  1660. }else{
  1661. end = start + by;
  1662. }
  1663. }
  1664. Ext.apply(ra, {
  1665. start: start,
  1666. end: end,
  1667. unit: isset(unit) ? unit : me.getDefaultUnit(attr)
  1668. });
  1669. },
  1670. init: function(el, attributes, duration, method) {
  1671. var me = this,
  1672. actualFrames = 0,
  1673. mgr = EXTLIB.AnimMgr;
  1674. Ext.apply(me, {
  1675. isAnimated: false,
  1676. startTime: null,
  1677. el: Ext.getDom(el),
  1678. attributes: attributes || {},
  1679. duration: duration || 1,
  1680. method: method || EXTLIB.Easing.easeNone,
  1681. useSec: true,
  1682. curFrame: 0,
  1683. totalFrames: mgr.fps,
  1684. runAttrs: {},
  1685. animate: function(){
  1686. var me = this,
  1687. d = me.duration;
  1688. if(me.isAnimated){
  1689. return false;
  1690. }
  1691. me.curFrame = 0;
  1692. me.totalFrames = me.useSec ? Math.ceil(mgr.fps * d) : d;
  1693. mgr.registerElement(me);
  1694. },
  1695. stop: function(finish){
  1696. var me = this;
  1697. if(finish){
  1698. me.curFrame = me.totalFrames;
  1699. me._onTween.fire();
  1700. }
  1701. mgr.stop(me);
  1702. }
  1703. });
  1704. var onStart = function(){
  1705. var me = this,
  1706. attr;
  1707. me.onStart.fire();
  1708. me.runAttrs = {};
  1709. for(attr in this.attributes){
  1710. this.setRunAttr(attr);
  1711. }
  1712. me.isAnimated = true;
  1713. me.startTime = now();
  1714. actualFrames = 0;
  1715. };
  1716. var onTween = function(){
  1717. var me = this;
  1718. me.onTween.fire({
  1719. duration: now() - me.startTime,
  1720. curFrame: me.curFrame
  1721. });
  1722. var ra = me.runAttrs;
  1723. for (var attr in ra) {
  1724. this.setAttr(attr, me.doMethod(attr, ra[attr].start, ra[attr].end), ra[attr].unit);
  1725. }
  1726. ++actualFrames;
  1727. };
  1728. var onComplete = function() {
  1729. var me = this,
  1730. actual = (now() - me.startTime) / 1000,
  1731. data = {
  1732. duration: actual,
  1733. frames: actualFrames,
  1734. fps: actualFrames / actual
  1735. };
  1736. me.isAnimated = false;
  1737. actualFrames = 0;
  1738. me.onComplete.fire(data);
  1739. };
  1740. me.onStart = new Ext.util.Event(me);
  1741. me.onTween = new Ext.util.Event(me);
  1742. me.onComplete = new Ext.util.Event(me);
  1743. (me._onStart = new Ext.util.Event(me)).addListener(onStart);
  1744. (me._onTween = new Ext.util.Event(me)).addListener(onTween);
  1745. (me._onComplete = new Ext.util.Event(me)).addListener(onComplete);
  1746. }
  1747. };
  1748. Ext.lib.AnimMgr = new function() {
  1749. var me = this,
  1750. thread = null,
  1751. queue = [],
  1752. tweenCount = 0;
  1753. Ext.apply(me, {
  1754. fps: 1000,
  1755. delay: 1,
  1756. registerElement: function(tween){
  1757. queue.push(tween);
  1758. ++tweenCount;
  1759. tween._onStart.fire();
  1760. me.start();
  1761. },
  1762. unRegister: function(tween, index){
  1763. tween._onComplete.fire();
  1764. index = index || getIndex(tween);
  1765. if (index != -1) {
  1766. queue.splice(index, 1);
  1767. }
  1768. if (--tweenCount <= 0) {
  1769. me.stop();
  1770. }
  1771. },
  1772. start: function(){
  1773. if(thread === null){
  1774. thread = setInterval(me.run, me.delay);
  1775. }
  1776. },
  1777. stop: function(tween){
  1778. if(!tween){
  1779. clearInterval(thread);
  1780. for(var i = 0, len = queue.length; i < len; ++i){
  1781. if(queue[0].isAnimated){
  1782. me.unRegister(queue[0], 0);
  1783. }
  1784. }
  1785. queue = [];
  1786. thread = null;
  1787. tweenCount = 0;
  1788. }else{
  1789. me.unRegister(tween);
  1790. }
  1791. },
  1792. run: function(){
  1793. var tf, i, len, tween;
  1794. for(i = 0, len = queue.length; i<len; i++) {
  1795. tween = queue[i];
  1796. if(tween && tween.isAnimated){
  1797. tf = tween.totalFrames;
  1798. if(tween.curFrame < tf || tf === null){
  1799. ++tween.curFrame;
  1800. if(tween.useSec){
  1801. correctFrame(tween);
  1802. }
  1803. tween._onTween.fire();
  1804. }else{
  1805. me.stop(tween);
  1806. }
  1807. }
  1808. }
  1809. }
  1810. });
  1811. var getIndex = function(anim) {
  1812. var i, len;
  1813. for(i = 0, len = queue.length; i<len; i++) {
  1814. if(queue[i] === anim) {
  1815. return i;
  1816. }
  1817. }
  1818. return -1;
  1819. };
  1820. var correctFrame = function(tween) {
  1821. var frames = tween.totalFrames,
  1822. frame = tween.curFrame,
  1823. duration = tween.duration,
  1824. expected = (frame * duration * 1000 / frames),
  1825. elapsed = (now() - tween.startTime),
  1826. tweak = 0;
  1827. if(elapsed < duration * 1000){
  1828. tweak = Math.round((elapsed / expected - 1) * frame);
  1829. }else{
  1830. tweak = frames - (frame + 1);
  1831. }
  1832. if(tweak > 0 && isFinite(tweak)){
  1833. if(tween.curFrame + tweak >= frames){
  1834. tweak = frames - (frame + 1);
  1835. }
  1836. tween.curFrame += tweak;
  1837. }
  1838. };
  1839. };
  1840. EXTLIB.Bezier = new function() {
  1841. this.getPosition = function(points, t) {
  1842. var n = points.length,
  1843. tmp = [],
  1844. c = 1 - t,
  1845. i,
  1846. j;
  1847. for (i = 0; i < n; ++i) {
  1848. tmp[i] = [points[i][0], points[i][1]];
  1849. }
  1850. for (j = 1; j < n; ++j) {
  1851. for (i = 0; i < n - j; ++i) {
  1852. tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
  1853. tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
  1854. }
  1855. }
  1856. return [ tmp[0][0], tmp[0][1] ];
  1857. };
  1858. };
  1859. EXTLIB.Easing = {
  1860. easeNone: function (t, b, c, d) {
  1861. return c * t / d + b;
  1862. },
  1863. easeIn: function (t, b, c, d) {
  1864. return c * (t /= d) * t + b;
  1865. },
  1866. easeOut: function (t, b, c, d) {
  1867. return -c * (t /= d) * (t - 2) + b;
  1868. }
  1869. };
  1870. (function() {
  1871. EXTLIB.Motion = function(el, attributes, duration, method) {
  1872. if (el) {
  1873. EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method);
  1874. }
  1875. };
  1876. Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase);
  1877. var superclass = EXTLIB.Motion.superclass,
  1878. proto = EXTLIB.Motion.prototype,
  1879. pointsRe = /^points$/i;
  1880. Ext.apply(EXTLIB.Motion.prototype, {
  1881. setAttr: function(attr, val, unit){
  1882. var me = this,
  1883. setAttr = superclass.setAttr;
  1884. if (pointsRe.test(attr)) {
  1885. unit = unit || 'px';
  1886. setAttr.call(me, 'left', val[0], unit);
  1887. setAttr.call(me, 'top', val[1], unit);
  1888. } else {
  1889. setAttr.call(me, attr, val, unit);
  1890. }
  1891. },
  1892. getAttr: function(attr){
  1893. var me = this,
  1894. getAttr = superclass.getAttr;
  1895. return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr);
  1896. },
  1897. doMethod: function(attr, start, end){
  1898. var me = this;
  1899. return pointsRe.test(attr)
  1900. ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100)
  1901. : superclass.doMethod.call(me, attr, start, end);
  1902. },
  1903. setRunAttr: function(attr){
  1904. if(pointsRe.test(attr)){
  1905. var me = this,
  1906. el = this.el,
  1907. points = this.attributes.points,
  1908. control = points.control || [],
  1909. from = points.from,
  1910. to = points.to,
  1911. by = points.by,
  1912. DOM = EXTLIB.Dom,
  1913. start,
  1914. i,
  1915. end,
  1916. len,
  1917. ra;
  1918. if(control.length > 0 && !Ext.isArray(control[0])){
  1919. control = [control];
  1920. }else{
  1921. }
  1922. Ext.fly(el, '_anim').position();
  1923. DOM.setXY(el, isset(from) ? from : DOM.getXY(el));
  1924. start = me.getAttr('points');
  1925. if(isset(to)){
  1926. end = translateValues.call(me, to, start);
  1927. for (i = 0,len = control.length; i < len; ++i) {
  1928. control[i] = translateValues.call(me, control[i], start);
  1929. }
  1930. } else if (isset(by)) {
  1931. end = [start[0] + by[0], start[1] + by[1]];
  1932. for (i = 0,len = control.length; i < len; ++i) {
  1933. control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
  1934. }
  1935. }
  1936. ra = this.runAttrs[attr] = [start];
  1937. if (control.length > 0) {
  1938. ra = ra.concat(control);
  1939. }
  1940. ra[ra.length] = end;
  1941. }else{
  1942. superclass.setRunAttr.call(this, attr);
  1943. }
  1944. }
  1945. });
  1946. var translateValues = function(val, start) {
  1947. var pageXY = EXTLIB.Dom.getXY(this.el);
  1948. return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]];
  1949. };
  1950. })();
  1951. })();
  1952. (function(){
  1953. var abs = Math.abs,
  1954. pi = Math.PI,
  1955. asin = Math.asin,
  1956. pow = Math.pow,
  1957. sin = Math.sin,
  1958. EXTLIB = Ext.lib;
  1959. Ext.apply(EXTLIB.Easing, {
  1960. easeBoth: function (t, b, c, d) {
  1961. return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b;
  1962. },
  1963. easeInStrong: function (t, b, c, d) {
  1964. return c * (t /= d) * t * t * t + b;
  1965. },
  1966. easeOutStrong: function (t, b, c, d) {
  1967. return -c * ((t = t / d - 1) * t * t * t - 1) + b;
  1968. },
  1969. easeBothStrong: function (t, b, c, d) {
  1970. return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
  1971. },
  1972. elasticIn: function (t, b, c, d, a, p) {
  1973. if (t == 0 || (t /= d) == 1) {
  1974. return t == 0 ? b : b + c;
  1975. }
  1976. p = p || (d * .3);
  1977. var s;
  1978. if (a >= abs(c)) {
  1979. s = p / (2 * pi) * asin(c / a);
  1980. } else {
  1981. a = c;
  1982. s = p / 4;
  1983. }
  1984. return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b;
  1985. },
  1986. elasticOut: function (t, b, c, d, a, p) {
  1987. if (t == 0 || (t /= d) == 1) {
  1988. return t == 0 ? b : b + c;
  1989. }
  1990. p = p || (d * .3);
  1991. var s;
  1992. if (a >= abs(c)) {
  1993. s = p / (2 * pi) * asin(c / a);
  1994. } else {
  1995. a = c;
  1996. s = p / 4;
  1997. }
  1998. return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b;
  1999. },
  2000. elasticBoth: function (t, b, c, d, a, p) {
  2001. if (t == 0 || (t /= d / 2) == 2) {
  2002. return t == 0 ? b : b + c;
  2003. }
  2004. p = p || (d * (.3 * 1.5));
  2005. var s;
  2006. if (a >= abs(c)) {
  2007. s = p / (2 * pi) * asin(c / a);
  2008. } else {
  2009. a = c;
  2010. s = p / 4;
  2011. }
  2012. return t < 1 ?
  2013. -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b :
  2014. a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b;
  2015. },
  2016. backIn: function (t, b, c, d, s) {
  2017. s = s || 1.70158;
  2018. return c * (t /= d) * t * ((s + 1) * t - s) + b;
  2019. },
  2020. backOut: function (t, b, c, d, s) {
  2021. if (!s) {
  2022. s = 1.70158;
  2023. }
  2024. return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
  2025. },
  2026. backBoth: function (t, b, c, d, s) {
  2027. s = s || 1.70158;
  2028. return ((t /= d / 2 ) < 1) ?
  2029. c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b :
  2030. c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
  2031. },
  2032. bounceIn: function (t, b, c, d) {
  2033. return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b;
  2034. },
  2035. bounceOut: function (t, b, c, d) {
  2036. if ((t /= d) < (1 / 2.75)) {
  2037. return c * (7.5625 * t * t) + b;
  2038. } else if (t < (2 / 2.75)) {
  2039. return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
  2040. } else if (t < (2.5 / 2.75)) {
  2041. return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
  2042. }
  2043. return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
  2044. },
  2045. bounceBoth: function (t, b, c, d) {
  2046. return (t < d / 2) ?
  2047. EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b :
  2048. EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
  2049. }
  2050. });
  2051. })();
  2052. (function() {
  2053. var EXTLIB = Ext.lib;
  2054. EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
  2055. return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
  2056. }
  2057. EXTLIB.ColorAnim = function(el, attributes, duration, method) {
  2058. EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
  2059. };
  2060. Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase);
  2061. var superclass = EXTLIB.ColorAnim.superclass,
  2062. colorRE = /color$/i,
  2063. transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
  2064. rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
  2065. hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
  2066. hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
  2067. isset = function(v){
  2068. return typeof v !== 'undefined';
  2069. };
  2070. function parseColor(s) {
  2071. var pi = parseInt,
  2072. base,
  2073. out = null,
  2074. c;
  2075. if (s.length == 3) {
  2076. return s;
  2077. }
  2078. Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){
  2079. base = (idx % 2 == 0) ? 16 : 10;
  2080. c = re.exec(s);
  2081. if(c && c.length == 4){
  2082. out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)];
  2083. return false;
  2084. }
  2085. });
  2086. return out;
  2087. }
  2088. Ext.apply(EXTLIB.ColorAnim.prototype, {
  2089. getAttr : function(attr) {
  2090. var me = this,
  2091. el = me.el,
  2092. val;
  2093. if(colorRE.test(attr)){
  2094. while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){
  2095. el = el.parentNode;
  2096. val = "fff";
  2097. }
  2098. }else{
  2099. val = superclass.getAttr.call(me, attr);
  2100. }
  2101. return val;
  2102. },
  2103. doMethod : function(attr, start, end) {
  2104. var me = this,
  2105. val,
  2106. floor = Math.floor,
  2107. i,
  2108. len,
  2109. v;
  2110. if(colorRE.test(attr)){
  2111. val = [];
  2112. end = end || [];
  2113. for(i = 0, len = start.length; i < len; i++) {
  2114. v = start[i];
  2115. val[i] = superclass.doMethod.call(me, attr, v, end[i]);
  2116. }
  2117. val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')';
  2118. }else{
  2119. val = superclass.doMethod.call(me, attr, start, end);
  2120. }
  2121. return val;
  2122. },
  2123. setRunAttr : function(attr) {
  2124. var me = this,
  2125. a = me.attributes[attr],
  2126. to = a.to,
  2127. by = a.by,
  2128. ra;
  2129. superclass.setRunAttr.call(me, attr);
  2130. ra = me.runAttrs[attr];
  2131. if(colorRE.test(attr)){
  2132. var start = parseColor(ra.start),
  2133. end = parseColor(ra.end);
  2134. if(!isset(to) && isset(by)){
  2135. end = parseColor(by);
  2136. for(var i=0,len=start.length; i<len; i++) {
  2137. end[i] = start[i] + end[i];
  2138. }
  2139. }
  2140. ra.start = start;
  2141. ra.end = end;
  2142. }
  2143. }
  2144. });
  2145. })();
  2146. (function() {
  2147. var EXTLIB = Ext.lib;
  2148. EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
  2149. return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
  2150. };
  2151. EXTLIB.Scroll = function(el, attributes, duration, method) {
  2152. if(el){
  2153. EXTLIB.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
  2154. }
  2155. };
  2156. Ext.extend(EXTLIB.Scroll, EXTLIB.ColorAnim);
  2157. var superclass = EXTLIB.Scroll.superclass,
  2158. SCROLL = 'scroll';
  2159. Ext.apply(EXTLIB.Scroll.prototype, {
  2160. doMethod : function(attr, start, end) {
  2161. var val,
  2162. me = this,
  2163. curFrame = me.curFrame,
  2164. totalFrames = me.totalFrames;
  2165. if(attr == SCROLL){
  2166. val = [me.method(curFrame, start[0], end[0] - start[0], totalFrames),
  2167. me.method(curFrame, start[1], end[1] - start[1], totalFrames)];
  2168. }else{
  2169. val = superclass.doMethod.call(me, attr, start, end);
  2170. }
  2171. return val;
  2172. },
  2173. getAttr : function(attr) {
  2174. var me = this;
  2175. if (attr == SCROLL) {
  2176. return [me.el.scrollLeft, me.el.scrollTop];
  2177. }else{
  2178. return superclass.getAttr.call(me, attr);
  2179. }
  2180. },
  2181. setAttr : function(attr, val, unit) {
  2182. var me = this;
  2183. if(attr == SCROLL){
  2184. me.el.scrollLeft = val[0];
  2185. me.el.scrollTop = val[1];
  2186. }else{
  2187. superclass.setAttr.call(me, attr, val, unit);
  2188. }
  2189. }
  2190. });
  2191. })();
  2192. if(Ext.isIE) {
  2193. function fnCleanUp() {
  2194. var p = Function.prototype;
  2195. delete p.createSequence;
  2196. delete p.defer;
  2197. delete p.createDelegate;
  2198. delete p.createCallback;
  2199. delete p.createInterceptor;
  2200. window.detachEvent("onunload", fnCleanUp);
  2201. }
  2202. window.attachEvent("onunload", fnCleanUp);
  2203. }
  2204. })();