PageRenderTime 57ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/src/js/core.js

http://searchforchrome.googlecode.com/
JavaScript | 1933 lines | 1105 code | 198 blank | 630 comment | 340 complexity | 44514321500c3ecea7f9d230cdaa0246 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /**
  2. * @fileOverview ????????
  3. * @author wx
  4. * @version 1.0.0
  5. */
  6. // Inspired by base2 and Prototype
  7. (function(){
  8. var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\bbase\b/ : /.*/;
  9. // The base Class implementation (does nothing)
  10. this.Class = function(){};
  11. // Create a new Class that inherits from this class
  12. Class.extend = function(prop) {
  13. var base = this.prototype;
  14. // Instantiate a base class (but only create the instance,
  15. // don't run the init constructor)
  16. initializing = true;
  17. var prototype = new this();
  18. initializing = false;
  19. // Copy the properties over onto the new prototype
  20. for (var name in prop) {
  21. // Check if we're overwriting an existing function
  22. prototype[name] = typeof prop[name] == "function" &&
  23. typeof base[name] == "function" && fnTest.test(prop[name]) ?
  24. (function(name, fn){
  25. return function() {
  26. var tmp = this.base;
  27. // Add a new .base() method that is the same method
  28. // but on the super-class
  29. this.base = base[name];
  30. // The method only need to be bound temporarily, so we
  31. // remove it when we're done executing
  32. var ret = fn.apply(this, arguments);
  33. this.base = tmp;
  34. return ret;
  35. };
  36. })(name, prop[name]) :
  37. prop[name];
  38. }
  39. // The dummy class constructor
  40. function Class() {
  41. // All construction is actually done in the init method
  42. if ( !initializing && this.init )
  43. this.init.apply(this, arguments);
  44. }
  45. // Populate our constructed prototype object
  46. Class.prototype = prototype;
  47. // Enforce the constructor to be what we expect
  48. Class.constructor = Class;
  49. // And make this class extendable
  50. Class.extend = arguments.callee;
  51. return Class;
  52. };
  53. })();/**
  54. * @fileOverview ???????
  55. * @author lxl
  56. * @version 1.0.0
  57. */
  58. //string.js
  59. if (!String.prototype.trim)
  60. String.prototype.trim = function(sStr) {
  61. /// <summary>
  62. /// ????????????????
  63. /// </summary>
  64. /// <param name="sStr">
  65. /// ????????????????????????
  66. /// </param>
  67. var re;
  68. if (!sStr) re = /^\s+|\s+$/g;
  69. else re = RegExp("^(?:" + sStr + ")+|(?:" + sStr + ")+$", "g");
  70. return this.replace(re, "");
  71. };
  72. if (!String.prototype.leftTrim)
  73. String.prototype.leftTrim = function(sStr) {
  74. /// <summary>
  75. /// ???????????????
  76. /// </summary>
  77. /// <param name="sStr">
  78. /// ????????????????????????
  79. /// </param>
  80. var re;
  81. if (!sStr) re = /^\s+/;
  82. else re = new RegExp("^(?:" + sStr + ")+");
  83. return this.replace(re, "");
  84. };
  85. if (!String.prototype.rightTrim)
  86. String.prototype.rightTrim = function(sStr) {
  87. /// <summary>
  88. /// ???????????????
  89. /// </summary>
  90. /// <param name="sStr">
  91. /// ????????????????????????
  92. /// </param>
  93. var re;
  94. if (!sStr) re = /\s+$/;
  95. else re = new RegExp("(?:" + sStr + ")+$");
  96. return this.replace(re, "");
  97. };
  98. if (!String.prototype.startsWith)
  99. String.prototype.startsWith = function(sStr, bIgnoreCase) {
  100. /// <summary>
  101. /// ????????????????????????
  102. /// </summary>
  103. /// <param name="sStr">
  104. /// ????????
  105. /// </param>
  106. /// <param name="bIgnoreCase">
  107. /// ?????????????true??????????????false
  108. /// </param>
  109. var ignore = bIgnoreCase || false;
  110. if (ignore) {
  111. var oRegex = new RegExp('^' + sStr, 'i');
  112. return oRegex.test(this);
  113. }
  114. else
  115. return (this.substring(0, sStr.length) == sStr);
  116. };
  117. if (!String.prototype.endsWith)
  118. String.prototype.endsWith = function(sStr, bIgnoreCase) {
  119. /// <summary>
  120. /// ????????????????????????
  121. /// </summary>
  122. /// <param name="sStr">
  123. /// ????????
  124. /// </param>
  125. /// <param name="bIgnoreCase">
  126. /// ?????????????true??????????????false
  127. /// </param>
  128. var L1 = this.length;
  129. var L2 = sStr.length;
  130. var ignore = bIgnoreCase || false;
  131. if (L2 > L1)
  132. return false;
  133. if (ignore) {
  134. var oRegex = new RegExp(sStr + '$', 'i');
  135. return oRegex.test(this);
  136. }
  137. else
  138. return (L2 == 0 || this.substring(L1 - L2) == sStr);
  139. };
  140. //format???????????
  141. if (!String.prototype.format)
  142. String.prototype.format = function(aStr) {
  143. /// <summary>
  144. /// ??dot net??format?? ?????"{i}"??????????
  145. /// </summary>
  146. /// <param name="aStr">
  147. /// ?????["str1","str2"]????????"str1","str2"
  148. /// </param>
  149. aStr = arguments[0] && arguments[0].constructor === Array ? arguments[0] : Array.prototype.slice.call(arguments);
  150. if (aStr.length == 0) return this;
  151. for (var s = this, i = 0, j = aStr.length; i < j; i++){
  152. s = s.replace(new RegExp("\\{" + i + "\\}", "g"), aStr[i]);
  153. }
  154. return s;
  155. };
  156. /**
  157. * @fileOverview ??????
  158. * @author lxl
  159. * @version 1.0.0
  160. */
  161. //array.js
  162. Array.prototype.inArray = function(value) {
  163. /// <summary>
  164. /// ????????????????
  165. /// </summary>
  166. /// <param name="value">
  167. /// ??????
  168. /// </param>
  169. for (var i = 0; i < this.length; i++) {
  170. if (this[i] === value) {
  171. return true;
  172. }
  173. }
  174. return false;
  175. };
  176. /**
  177. *@fileOverview ????????????
  178. *@version 1.0.0
  179. *@author wx
  180. */
  181. //util.js
  182. (function() {
  183. //core.js?????
  184. var version = "0.3.4";
  185. var ua = navigator.userAgent.toLowerCase();
  186. //each by:john
  187. function each(object, callback, args) {
  188. /// <summary>
  189. /// ????
  190. /// </summary>
  191. /// <param name="object">
  192. /// ???????
  193. /// </param>
  194. /// <param name="callback">
  195. // ?????????
  196. /// </param>
  197. /// <param name="args">
  198. /// ??????
  199. /// </param>
  200. var name, i = 0, length = object.length;
  201. //???????
  202. if (args) {
  203. //?????length??(???? ??? ???)
  204. if (length == undefined) {
  205. //?????????
  206. for (name in object)
  207. //???????
  208. if (callback.apply(object[name], args) === false) break;
  209. //??length??
  210. } else
  211. //????????? ???????
  212. for (; i < length; )
  213. if (callback.apply(object[i++], args) === false) break;
  214. //????
  215. } else {
  216. if (length == undefined) {
  217. for (name in object)
  218. if (callback.call(object[name], name, object[name]) === false) break;
  219. } else
  220. for (var value = object[0]; i < length && callback.call(value, i, value) !== false; value = object[++i]) { }
  221. }
  222. return object;
  223. }
  224. function nameSpace(a, b) {
  225. /// <summary>
  226. /// ??????????
  227. /// util.nameSpace("ajax.get",fn);
  228. /// </summary>
  229. /// <param name="a">
  230. /// ????
  231. /// </param>
  232. /// <param name="b">
  233. /// ??
  234. /// </param>
  235. var c = a.split(/\./);
  236. var d = window;
  237. for (var e = 0; e < c.length - 1; e++) {
  238. //?????????????
  239. if (!d[c[e]]) {
  240. //??????
  241. d[c[e]] = {};
  242. }
  243. //?????
  244. d = d[c[e]];
  245. }
  246. //?????? ?????????????
  247. d[c[c.length - 1]] = b;
  248. }
  249. //??????????
  250. function toggle(obj, attr, v1, v2) {
  251. /// <summary>
  252. /// ???:??????????
  253. /// </summary>
  254. /// <param name="obj">
  255. /// ????
  256. /// </param>
  257. /// <param name="attr">
  258. // ????
  259. /// </param>
  260. /// <param name="v1">
  261. /// ??????
  262. /// </param>
  263. /// <param name="v2">
  264. /// ??????
  265. /// </param>
  266. return function() {
  267. obj[attr] = (obj[attr] != v2) ? v2 : v1;
  268. };
  269. }
  270. function setCookie(name, value, expires, path, domain, secure) {
  271. /// <summary>
  272. /// ??Cookie?
  273. /// </summary>
  274. /// <param name="name">
  275. /// Cookie?
  276. /// </param>
  277. /// <param name="value">
  278. /// Cookie?
  279. /// </param>
  280. var today = new Date();
  281. today.setTime(today.getTime());
  282. if (expires) {
  283. expires = expires * 1000 * 60 * 60 * 24;
  284. }
  285. var expires_date = new Date(today.getTime() + (expires));
  286. document.cookie = name + "=" + escape(value) +
  287. ((expires) ? ";expires=" + expires_date.toGMTString() : "") + //expires.toGMTString()
  288. ((path) ? ";path=" + path : "") +
  289. ((domain) ? ";domain=" + domain : "") +
  290. ((secure) ? ";secure" : "");
  291. }
  292. function getCookie(name) {
  293. /// <summary>
  294. /// ?????Cookie?
  295. /// </summary>
  296. /// <param name="name">
  297. /// Cookie?
  298. /// </param>
  299. var start = document.cookie.indexOf(name + "=");
  300. var len = start + name.length + 1;
  301. if ((!start) && (name != document.cookie.substring(0, name.length))) {
  302. return null;
  303. }
  304. if (start == -1) return null;
  305. var end = document.cookie.indexOf(";", len);
  306. if (end == -1) end = document.cookie.length;
  307. return unescape(document.cookie.substring(len, end));
  308. }
  309. function deleteCookie(name, path, domain) {
  310. /// <summary>
  311. /// ?????Cookie
  312. /// </summary>
  313. /// <param name="name">
  314. /// Cookie?
  315. /// </param>
  316. if (getCookie(name)) document.cookie = name + "=" +
  317. ((path) ? ";path=" + path : "") +
  318. ((domain) ? ";domain=" + domain : "") +
  319. ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
  320. }
  321. //??ie6??????
  322. if (/msie/.test(ua)) {
  323. try {
  324. document.execCommand("BackgroundImageCache", false, true);
  325. }
  326. catch (e) {
  327. }
  328. }
  329. //public
  330. each("each,nameSpace,toggle,setCookie,getCookie,deleteCookie".split(","), function() {
  331. nameSpace("tx.util." + this, eval("(" + this + ")"));
  332. });
  333. //??????
  334. each("each".split(","), function() {
  335. nameSpace("tx." + this, eval("(" + this + ")"));
  336. });
  337. tx.toString = function() {
  338. return "[object tx(version " + version + ")]";
  339. };
  340. })();
  341. /**
  342. * @fileOverview ??css????????
  343. * @author wx
  344. * @version 1.0.0
  345. */
  346. //style.js
  347. (function() {
  348. /**
  349. * Convert a CSS property to camel case (font-size to fontSize)
  350. * @param {String} str The property that requires conversion to camel case
  351. * @return {String} The camel cased property string
  352. */
  353. var toCamelCase = (function() {
  354. var cache = {};
  355. return function(str) {
  356. if (!cache[str]) {
  357. return cache[str] = str.replace(/-([a-z])/g, function($0, $1) {
  358. return $1.toUpperCase();
  359. });
  360. } else {
  361. return cache[str];
  362. }
  363. }
  364. })();
  365. //?????????oStyle??
  366. function toStyleObj(str) {
  367. // var aTemp = ['{"'];
  368. // aTemp.push(str.replace(/\:/gi, function() { return '":"'; }).replace(/\;$/, function() { return ""; }).replace(/\;/gi, function() { return '","' }));
  369. // aTemp.push('"}');
  370. // return aTemp.join("");
  371. //??"background : url(http://192.168.1.41:8099/img/template1/ImgConbj_1.png) no-repeat"???url??":"?? Edit: Kim Wang Date: 2009-6-18
  372. var aTemp = ['{"'];
  373. aTemp.push(str.replace(/[^\d]\:[^\/\/]/g, function(str) {
  374. return str.replace(/\:/, "\":\"");
  375. }).replace(/\;$/, function() { return ""; }).replace(/\;/gi, function() { return '","' }));
  376. aTemp.push('"}');
  377. return aTemp.join("");
  378. }
  379. function setStyle(elements, prop, val) {
  380. /// <summary>
  381. /// ???????
  382. /// </summary>
  383. /// <param name="elements">
  384. /// ????
  385. /// </param>
  386. /// <param name="prop">
  387. // css??
  388. /// </param>
  389. /// <param name="val">
  390. /// css???
  391. /// </param>
  392. var el = null;
  393. for (var i = 0, len = elements.length; i < len; i++) {
  394. el = (typeof elements[i] == "string") ? document.getElementById(elements[i]) : elements[i];
  395. if (prop == "opacity") {
  396. el.style.filter = "alpha(opacity=" + val * 100 + ")";
  397. el.style.opacity = val;
  398. continue;
  399. }
  400. if (prop == "float") {
  401. el.style.styleFloat = val; //IE
  402. el.style.cssFloat = val; //firefox and others explorer
  403. continue;
  404. }
  405. el.style[toCamelCase(prop)] = val;
  406. }
  407. }
  408. function setCSS(el, styles) {
  409. /// <summary>
  410. /// ???????
  411. /// </summary>
  412. /// <param name="el">
  413. /// ?????????
  414. /// </param>
  415. /// <param name="styles">
  416. /// css??json????css??
  417. /// </param>
  418. if (typeof styles == "string") styles = eval("(" + toStyleObj(styles) + ")");
  419. for (var prop in styles) {
  420. if (!styles.hasOwnProperty(prop)) continue;
  421. setStyle(el, prop.trim(), styles[prop].trim());
  422. }
  423. }
  424. function addClass(elem, classname) {
  425. /// <summary>
  426. /// ??????????
  427. /// </summary>
  428. /// <param name="elem">
  429. /// dom??
  430. /// </param>
  431. /// <param name="classname">
  432. // css??
  433. /// </param>
  434. if (typeof elem == "string") elem = document.getElementById(elem);
  435. elem.className += " " + classname;
  436. }
  437. function removeClass(elem, classname) {
  438. /// <summary>
  439. /// ??????????
  440. /// </summary>
  441. /// <param name="elem">
  442. /// dom??
  443. /// </param>
  444. /// <param name="classname">
  445. /// css??
  446. /// </param>
  447. if (typeof elem == "string") elem = document.getElementById(elem);
  448. elem.className = elem.className.replace(classname, " ");
  449. }
  450. tx.util.each("setCSS,setStyle,addClass,removeClass".split(","), function() {
  451. tx.util.nameSpace("tx.style." + this, eval("(" + this + ")"));
  452. });
  453. tx.util.each("setCSS,addClass,removeClass".split(","), function() {
  454. tx.util.nameSpace("tx." + this, eval("(" + this + ")"));
  455. });
  456. })();/**
  457. * @fileOverview ??dom???
  458. * @author lxl
  459. * @version 1.0.0
  460. */
  461. //dom.js
  462. (function() {
  463. function $() {
  464. /// <summary>
  465. /// ??id??????,??????????????
  466. /// </summary>
  467. /// <param name="id">
  468. /// ?????????id
  469. /// </param>
  470. var elements = [];
  471. for (var i = 0; i < arguments.length; i++) {
  472. var element = arguments[i];
  473. if (typeof element == 'string')
  474. element = document.getElementById(element);
  475. //?????????????
  476. if (arguments.length == 1)
  477. return element;
  478. elements.push(element);
  479. }
  480. return elements;
  481. }
  482. function tag(sTagName, oElem) {
  483. /// <summary>
  484. /// ??????????
  485. /// </summary>
  486. /// <param name="sTagName">
  487. /// ?????????
  488. /// </param>
  489. /// <param name="oElem">
  490. /// ?????????
  491. /// </param>
  492. return (oElem || document).getElementsByTagName(sTagName);
  493. }
  494. function byClass(sSearchClass, oNode, sTag) {
  495. /// <summary>
  496. /// ??class??????
  497. /// </summary>
  498. /// <param name="searchClass">
  499. /// ???????
  500. /// </param>
  501. /// <param name="node">
  502. /// ?????????
  503. /// </param>
  504. /// <param name="tag">
  505. /// ??????????????
  506. /// </param>
  507. var classElements = [];
  508. if (oNode == null)
  509. oNode = document;
  510. if (sTag == null)
  511. //???
  512. sTag = '*';
  513. var els = oNode.getElementsByTagName(tag);
  514. var pattern = new RegExp("(^|\\s)" + sSearchClass + "(\\s|$)");
  515. for (i = 0, j = 0; i < els.length; i++) {
  516. //??className?????????
  517. if (pattern.test(els[i].className)) {
  518. classElements[j] = els[i];
  519. j++;
  520. }
  521. }
  522. return classElements;
  523. }
  524. function prev(oElement) {
  525. ///<summary>
  526. ///??????????????
  527. ///</summary>
  528. ///<param name="oElement">
  529. ///??????
  530. ///</param>
  531. do {
  532. oElement = oElement.previousSibling;
  533. //???????????
  534. } while (oElement && oElement.nodeType != 1);
  535. return oElement;
  536. }
  537. function next(oElement) {
  538. ///<summary>
  539. ///??????????????
  540. ///</summary>
  541. ///<param name="oElement">
  542. ///??????
  543. ///</param>
  544. do {
  545. oElement = oElement.nextSibling;
  546. } while (oElement && oElement.nodeType != 1);
  547. return oElement;
  548. }
  549. function first(oElement) {
  550. ///<summary>
  551. ///???????????????
  552. ///</summary>
  553. ///<param name="oElement">
  554. ///??????
  555. ///</param>
  556. var oElement = oElement.firstChild;
  557. return (oElement && oElement.nodeType != 1) ? next(oElement) : oElement;
  558. }
  559. function last(oElement) {
  560. ///<summary>
  561. ///????????????????
  562. ///</summary>
  563. ///<param name="oElement">
  564. ///??????
  565. ///</param>
  566. var oElement = oElement.lastChild;
  567. return (oElement && oElement.nodeType != 1) ? prev(oElement) : oElement;
  568. }
  569. function getParent(oElement, iNum) {
  570. ///<summary>
  571. ///???????nNum??????
  572. ///</summary>
  573. ///<param name="oElement">
  574. ///??????
  575. ///</param>
  576. ///<param name="nNum">
  577. ///?????????
  578. ///</param>
  579. var iNum = iNum || 1;
  580. for (var i = 0; i < iNum; i++)
  581. if (oElement != null) oElement = oElement.parentNode;
  582. return oElement;
  583. }
  584. // function before(oParent, oCurrent, oElem) {
  585. // ///<summary>
  586. // ///?????????????????
  587. // ///</summary>
  588. // ///<param name="oParent">
  589. // ///??????????
  590. // ///</param>
  591. // ///<param name="oCurrent">
  592. // ///??????
  593. // ///</param>
  594. // ///<param name="elem">
  595. // ///???????????????????????
  596. // ///</param>
  597. // // Check to see if no parent node was provided
  598. // if (oElem == null) {
  599. // oElem = oCurrent;
  600. // oCurrent = oParent;
  601. // oParent = oCurrent.parentNode;
  602. // }
  603. // var elems = checkElem(oElem);
  604. // for (var i = elems.length - 1; i >= 0; i--) {
  605. // oParent.insertBefore(elems[i], oCurrent);
  606. // }
  607. // }
  608. function before(oCurrent, oElem) {
  609. ///<summary>
  610. ///???????????????????
  611. ///</summary>
  612. ///<param name="oCurrent">
  613. ///??????
  614. ///</param>
  615. ///<param name="elem">
  616. ///???????????????????????
  617. ///</param>
  618. // Check to see if no parent node was provided
  619. var oParent = oCurrent.parentNode;
  620. var elems = checkElem(oElem);
  621. for (var i = elems.length - 1; i >= 0; i--) {
  622. oParent.insertBefore(elems[i], oCurrent);
  623. }
  624. }// Des: ???????????????after?? Author: lxl; Date:2009-9-10
  625. function after(oCurrent, oElement) {
  626. ///<summary>
  627. ///???????????????????
  628. ///</summary>
  629. ///<param name="oCurrent">
  630. ///??????
  631. ///</param>
  632. ///<param name="oElement">
  633. ///???????????????????????
  634. ///</param>
  635. var elems = checkElem(oElement);
  636. for (var i = elems.length - 1; i >= 0; i--) {
  637. if (oCurrent.nextSibling)
  638. oCurrent.parentNode.insertBefore(elems[i], oCurrent.nextSibling);
  639. else
  640. oCurrent.parentNode.appendChild(elems[i]);
  641. }
  642. }
  643. function create(sTagName) {
  644. ///<summary>
  645. ///????????????
  646. ///</summary>
  647. ///<param name="sTagName">
  648. ///???????????
  649. ///</param>
  650. return document.createElementNS ?
  651. document.createElementNS('', sTagName) :
  652. document.createElement(sTagName);
  653. }
  654. function append(oParent, oElement) {
  655. ///<summary>
  656. ///??????????????
  657. ///</summary>
  658. ///<param name="oParent">
  659. ///??????
  660. ///</param>
  661. ///<param name="oElement">
  662. ///????????????????????????
  663. ///</param>
  664. var elems = checkElem(oElement);
  665. for (var i = 0; i < elems.length; i++) {
  666. oParent.appendChild(elems[i]);
  667. }
  668. }
  669. function remove(oElem) {
  670. ///<summary>
  671. ///??????
  672. ///</summary>
  673. ///<param name="elem">
  674. ///????????
  675. ///</param>
  676. if (oElem) oElem.parentNode.removeChild(oElem);
  677. }
  678. function empty(oElem) {
  679. ///<summary>
  680. ///???????????????
  681. ///</summary>
  682. ///<param name="elem">
  683. ///??????
  684. ///</param>
  685. while (oElem.firstChild)
  686. remove(oElem.firstChild);
  687. }
  688. function getAttr(oElement, sName) {
  689. ///<summary>
  690. ///?????????
  691. ///</summary>
  692. ///<param name="oElement">
  693. ///??????
  694. ///</param>
  695. ///<param name="sName">
  696. ///????????
  697. ///</param>
  698. return attr(oElement, sName);
  699. }
  700. function setAttr(oElement, sName, sValue) {
  701. ///<summary>
  702. ///????????????????
  703. ///</summary>
  704. ///<param name="oElement">
  705. ///??????
  706. ///</param>
  707. ///<param name="sName">
  708. ///????????
  709. ///</param>
  710. ///<param name="sValue">
  711. ///????
  712. ///</param>
  713. return attr(oElement, sName, sValue);
  714. }
  715. function attr(oElement, sName, sValue) {
  716. ///<summary>
  717. ///????????????????
  718. ///</summary>
  719. ///<param name="oElement">
  720. ///??????
  721. ///</param>
  722. ///<param name="sName">
  723. ///????????
  724. ///</param>
  725. ///<param name="sValue">
  726. ///????
  727. ///</param>
  728. //?????name???????
  729. if (!sName || sName.constructor != String) return "";
  730. //??name?????getter?setter ???js????
  731. //??????????? {}.for
  732. sName = { "for": "htmlFor", "class": "className"}[sName] || sName;
  733. //??????value??
  734. if (sValue != null) {
  735. //????????setter
  736. oElement[sName] = sValue;
  737. //setAttribute?????
  738. if (oElement.setAttribute)
  739. oElement.setAttribute(sName, sValue);
  740. }
  741. //getter || getAttribute
  742. return oElement[sName] || oElement.getAttribute(sName) || "";
  743. }
  744. //???????HTML??? ????? DOM?? DOM????
  745. //?HTML??????DOM??
  746. function checkElem(a) {
  747. var r = [];
  748. //???????? ??????? ???????
  749. if (a.constructor != Array) a = [a];
  750. for (var i = 0; i < a.length; i++) {
  751. //??????????
  752. if (a[i].constructor == String) {
  753. //??????????HTML
  754. var div = document.createElement("div");
  755. //??HTML ???DOM??div.childNodes[i]
  756. div.innerHTML = a[i];
  757. //div.childNodes.length????
  758. for (var j = 0; j < div.childNodes.length; j++)
  759. r[r.length] = div.childNodes[j];
  760. //???????????
  761. }else if (a[i].length) {
  762. //???DOM????
  763. for (var j = 0; j < a[i].length; j++)
  764. r[r.length] = a[i][j];
  765. }else {//?????DOM??
  766. r[r.length] = a[i];
  767. }
  768. }
  769. return r;
  770. }
  771. tx.util.each("$,byClass,tag,prev,next,first,last,getParent,before,after,create,append,remove,empty,getAttr,setAttr,attr".split(","), function() {
  772. tx.util.nameSpace("tx.dom." + this, eval("(" + this + ")"));
  773. });
  774. tx.util.each("$,byClass,tag".split(","), function() {
  775. tx.util.nameSpace("tx." + this, eval("(" + this + ")"));
  776. });
  777. })();/**
  778. *@fileOverview ??????????????????,dom???
  779. *@version 1.0.0
  780. *@author wx
  781. */
  782. //events.js
  783. (function() {
  784. // written by Dean Edwards, 2005
  785. // with input from Tino Zijdel, Matthias Miller, Diego Perini
  786. // http://dean.edwards.name/weblog/2005/10/add-event/
  787. function addEvent(element, type, handler) {
  788. /// <summary>
  789. /// ???????
  790. /// </summary>
  791. /// <param name="element">
  792. /// ??
  793. /// </param>
  794. /// <param name="type">
  795. // ????
  796. /// </param>
  797. /// <param name="handler">
  798. /// ??????
  799. /// </param>
  800. if (element.addEventListener) {
  801. element.addEventListener(type, handler, false);
  802. } else {
  803. // ?????????????????ID
  804. if (!handler.$$guid) handler.$$guid = addEvent.guid++;
  805. // ???????????????
  806. if (!element.events) element.events = {};
  807. // ?????/????????????????
  808. var handlers = element.events[type];
  809. if (!handlers) {
  810. handlers = element.events[type] = {};
  811. // ???????????(???????)
  812. if (element["on" + type]) {
  813. handlers[0] = element["on" + type];
  814. }
  815. }
  816. // ??????????????
  817. handlers[handler.$$guid] = handler;
  818. // ???????????????????
  819. element["on" + type] = handleEvent;
  820. }
  821. };
  822. // ????ID????
  823. addEvent.guid = 1;
  824. function removeEvent(element, type, handler) {
  825. /// <summary>
  826. /// ???????????
  827. /// </summary>
  828. /// <param name="element">
  829. /// ??
  830. /// </param>
  831. /// <param name="type">
  832. // ????
  833. /// </param>
  834. /// <param name="handler">
  835. /// ??????
  836. /// </param>
  837. if (element.removeEventListener) {
  838. element.removeEventListener(type, handler, false);
  839. } else {
  840. // ?????????????
  841. if (element.events && element.events[type]) {
  842. delete element.events[type][handler.$$guid];
  843. }
  844. }
  845. };
  846. function handleEvent(event) {
  847. var returnValue = true;
  848. // ?????? (IE ?????????)
  849. event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
  850. // ??????????????
  851. var handlers = this.events[event.type];
  852. // ????????????
  853. for (var i in handlers) {
  854. this.$$handleEvent = handlers[i];
  855. if (this.$$handleEvent(event) === false) {
  856. returnValue = false;
  857. }
  858. }
  859. return returnValue;
  860. };
  861. // ????IE?????????
  862. function fixEvent(event) {
  863. // ??W3C??????
  864. event.preventDefault = fixEvent.preventDefault;
  865. event.stopPropagation = fixEvent.stopPropagation;
  866. return event;
  867. };
  868. fixEvent.preventDefault = function() {
  869. this.returnValue = false;
  870. };
  871. fixEvent.stopPropagation = function() {
  872. this.cancelBubble = true;
  873. };
  874. /*
  875. domReady??
  876. */
  877. var isReady = false, readyList = [];
  878. function domReady(fn) {
  879. /// <summary>
  880. /// dom?????????
  881. /// </summary>
  882. /// <param name="fn">
  883. /// ???????
  884. /// </param>
  885. // ??????
  886. bindReady();
  887. // ??DOM????
  888. if (isReady)
  889. // ??????
  890. fn.call(document);
  891. // ?? ????
  892. else
  893. // ?????????
  894. readyList.push(fn);
  895. }
  896. function ready() {
  897. // ??DOM????
  898. if (!isReady) {
  899. // DOM ????
  900. isReady = true;
  901. // ??readyList????????
  902. if (readyList) {
  903. // ?????????
  904. tx.each(readyList, function() {
  905. this.call(document);
  906. });
  907. // ????????
  908. readyList = null;
  909. }
  910. }
  911. }
  912. var readyBound = false;
  913. function bindReady() {
  914. if (readyBound) return;
  915. readyBound = true;
  916. // ???Mozilla, Opera a?????????
  917. if (document.addEventListener) {
  918. // ????????
  919. document.addEventListener("DOMContentLoaded", function() {
  920. document.removeEventListener("DOMContentLoaded", arguments.callee, false);
  921. ready();
  922. }, false);
  923. // ??? IE ???
  924. } else if (document.attachEvent) {
  925. // ensure firing before onload,
  926. // maybe late but safe also for iframes
  927. document.attachEvent("onreadystatechange", function() {
  928. if (document.readyState === "complete") {
  929. document.detachEvent("onreadystatechange", arguments.callee);
  930. ready();
  931. }
  932. });
  933. // ?? IE ????? iframe
  934. // ????????????
  935. //!window.frameElement??window == window.top,window.frameElement????ie???
  936. if (document.documentElement.doScroll && window == window.top) (function() {
  937. if (isReady) return;
  938. try {
  939. // If IE is used, use the trick by Diego Perini
  940. // http://javascript.nwbox.com/IEContentLoaded/
  941. document.documentElement.doScroll("left");
  942. } catch (error) {
  943. setTimeout(arguments.callee, 0);
  944. return;
  945. }
  946. // ?????????
  947. ready();
  948. })();
  949. }
  950. // ??window.onload???????????
  951. addEvent(window, "load", ready);
  952. }
  953. tx.util.each("addEvent,removeEvent,domReady".split(","), function() {
  954. tx.util.nameSpace("tx.event." + this, eval("(" + this + ")"));
  955. });
  956. //????????
  957. tx.util.each("addEvent,removeEvent,domReady".split(","), function() {
  958. tx.util.nameSpace("tx." + this, eval("(" + this + ")"));
  959. });
  960. })();
  961. /**
  962. * @fileOverview ajax?????
  963. * @author wx
  964. * @version 1.0.0
  965. */
  966. //ajax.js
  967. (function() {
  968. var isIE6 = !(navigator.userAgent.toLowerCase().indexOf("opera") > -1) && ((document.all) ? true : false) && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
  969. /**
  970. * ??ajax?
  971. * @module _private
  972. * @title fast ajax
  973. */
  974. //private
  975. var _ajax = {
  976. _objPool: [], //???
  977. async: true, //?????
  978. /**
  979. * ??XmlHttpRequest????
  980. * ????????????ajax????,???XMLHttpRequest???? ??????
  981. * @method _getInstance
  982. * @private
  983. */
  984. _getInstance: function() {
  985. for (var i = 0; i < this._objPool.length; i++) {
  986. if (this._objPool[i].readyState == 0 || this._objPool[i].readyState == 4) {
  987. return this._objPool[i];
  988. }
  989. }
  990. // IE5????push??
  991. this._objPool[this._objPool.length] = this._CreateXHR();
  992. return this._objPool[this._objPool.length - 1];
  993. },
  994. /**
  995. * ??XmlHttpRequest??
  996. * @method _CreateXHR
  997. * @private
  998. */
  999. _CreateXHR: function() {
  1000. if (window.XMLHttpRequest) {
  1001. var objXMLHttp = new XMLHttpRequest();
  1002. }
  1003. else {
  1004. var MSXML = ['Msxml2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
  1005. for (var i = 0; i < MSXML.length; i++) {
  1006. try {
  1007. var objXMLHttp = new ActiveXObject(MSXML[i]);
  1008. break;
  1009. }
  1010. catch (e) {
  1011. }
  1012. }
  1013. }
  1014. //mozilla??????readyState??,?????????
  1015. if (objXMLHttp.readyState == null) {
  1016. objXMLHttp.readyState = 0;
  1017. //addEventListener?????true?capture false?bubbling
  1018. objXMLHttp.addEventListener("load", function() {
  1019. objXMLHttp.readyState = 4;
  1020. if (typeof objXMLHttp.onreadystatechange == "function") {
  1021. objXMLHttp.onreadystatechange();
  1022. }
  1023. }, false);
  1024. }
  1025. return objXMLHttp;
  1026. },
  1027. /**
  1028. * ??????????json,object???????????????
  1029. * @method _param
  1030. * @param {String}/{Json}/{Object} data ??????????,
  1031. * ???????POST.
  1032. * @private
  1033. */
  1034. _param: function(data) {
  1035. if (data == "null")
  1036. return null;
  1037. var s = [];
  1038. if (data.constructor == Object) {
  1039. for (var key in data) {
  1040. s.push(encodeURIComponent(key.toString()) + "=" + encodeURIComponent(data[key]));
  1041. }
  1042. }
  1043. else {
  1044. var arr = data.split("&");
  1045. for (var i = 0; i < arr.length; i++) {
  1046. var temp = arr[i].split("=");
  1047. s.push(encodeURIComponent(temp[0]) + "=" + encodeURIComponent(temp[1]));
  1048. }
  1049. }
  1050. return s.join("&").replace(/%20/g, "+");
  1051. },
  1052. /**
  1053. * ????ajax???
  1054. *
  1055. * @method _send
  1056. * @static
  1057. * @param {String} method ????[POST]?[GET]
  1058. * @param {String} url ????
  1059. * @param {String}/{Json}/{Object} data ??????????,
  1060. * ???????POST.
  1061. * @param {function} callback ???????????
  1062. * ????XmlHttpRequest??
  1063. * @return {none} ?????
  1064. */
  1065. _send: function(method, url, data, callback) {
  1066. var objXMLHttp = this._getInstance();
  1067. callback = callback || function() { };
  1068. with (objXMLHttp) {
  1069. try {
  1070. // ????????
  1071. if (url.indexOf("?") > 0) {
  1072. url += "&randnum=" + Math.random();
  1073. }
  1074. else {
  1075. url += "?randnum=" + Math.random();
  1076. }
  1077. open(method, url, true);
  1078. // ????????
  1079. setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
  1080. send(this._param(data));
  1081. onreadystatechange = function() {
  1082. if (objXMLHttp.readyState == 4 && (objXMLHttp.status == 200 || objXMLHttp.status == 304)) {
  1083. if (typeof callback == "function") {
  1084. callback(objXMLHttp);
  1085. }
  1086. }
  1087. }
  1088. }
  1089. catch (e) {
  1090. alert(e);
  1091. }
  1092. }
  1093. },
  1094. /**
  1095. * post??
  1096. * @method post
  1097. * @private
  1098. */
  1099. post: function(url, data, callback) {
  1100. /// <summary>
  1101. /// post????
  1102. /// </summary>
  1103. /// <param name="url">
  1104. /// ????url
  1105. /// </param>
  1106. /// <param name="data">
  1107. // ???????json?key=value
  1108. /// </param>
  1109. /// <param name="callback">
  1110. /// ????
  1111. /// </param>
  1112. _ajax._send("POST", url, data, callback);
  1113. },
  1114. /**
  1115. * get??
  1116. * @method get
  1117. * @private
  1118. */
  1119. get: function(url, callback) {
  1120. /// <summary>
  1121. /// get??????
  1122. /// </summary>
  1123. /// <param name="url">
  1124. /// ????
  1125. /// </param>
  1126. /// <param name="callback">
  1127. /// ????
  1128. /// </param>
  1129. //????
  1130. if (!url.indexOf("http") || !url.indexOf("//")) {
  1131. var _head = document.getElementsByTagName("head")[0];
  1132. var _script = document.createElement("script");
  1133. _script.src = url;
  1134. _script.onload = _script.onreadystatechange = function() {
  1135. if ((!_script.readyState ||
  1136. _script.readyState == "loaded" || _script.readyState == "complete")) {
  1137. (callback || function() { })();
  1138. (!isIE6) && _head.removeChild(_script);
  1139. }
  1140. };
  1141. _head.appendChild(_script);
  1142. } else {
  1143. _ajax._send("GET", url, "null", callback);
  1144. }
  1145. }
  1146. };
  1147. /*
  1148. *??nameSpace??post?get??
  1149. */
  1150. tx.util.nameSpace("tx.ajax.post", _ajax.post);
  1151. tx.util.nameSpace("tx.ajax.get", _ajax.get);
  1152. })();
  1153. /**
  1154. * @fileoverview ??????????
  1155. * @version 1.0.0
  1156. * @author wx
  1157. */
  1158. (function() {
  1159. window['tx'] = window['tx'] || {};
  1160. window['tx']['loader'] = window['tx']['loader'] || {};
  1161. tx.loader.ServiceBase = 'http://img.txooo.com/js';
  1162. tx.loader.TxoooApisBase = 'http://img.txooo.com/js';
  1163. //util ================================================================================
  1164. function setLoad(obj, fn) {
  1165. return obj.load = fn
  1166. }
  1167. var F = {};
  1168. //???????
  1169. function E(a) {
  1170. //??
  1171. if (a in F)
  1172. return F[a];
  1173. return F[a] = navigator.userAgent.toLowerCase().indexOf(a) != -1
  1174. }
  1175. //??
  1176. function inherit(a, b) {
  1177. var c = function() {
  1178. };
  1179. c.prototype = b.prototype;
  1180. a.K = b.prototype;
  1181. a.prototype = new c
  1182. }
  1183. function H(a, b) {
  1184. var c = a.w || [];
  1185. c = c.concat(Array.prototype.slice.call(arguments, 2));
  1186. if (typeof a.r != "undefined")
  1187. b = a.r;
  1188. if (typeof a.q != "undefined")
  1189. a = a.q;
  1190. var d = function() {
  1191. var g = c.concat(Array.prototype.slice.call(arguments));
  1192. return a.apply(b, g)
  1193. };
  1194. d.w = c;
  1195. d.r = b;
  1196. d.q = a;
  1197. return d
  1198. }
  1199. //error?
  1200. function error(msg) {
  1201. var temp = new Error(msg);
  1202. temp.toString = function() {
  1203. return this.message
  1204. };
  1205. return temp
  1206. }
  1207. //??????
  1208. function nameSpace(a, b) {
  1209. for (var c = a.split(/\./), d = window, g = 0; g < c.length - 1; g++) {
  1210. d[c[g]] || (d[c[g]] = {});
  1211. d = d[c[g]]
  1212. }
  1213. d[c[c.length - 1]] = b
  1214. }
  1215. function K(a, b, c) {
  1216. a[b] = c
  1217. }
  1218. //tx.loader.? ================================================================================
  1219. //tx.loader.callbacks
  1220. if (!L)
  1221. var L = nameSpace;
  1222. if (!aa)
  1223. var aa = K;
  1224. tx.loader.callbacks = {};
  1225. L("tx.loader.callbacks", tx.loader.callbacks);
  1226. var Moudles = {}, N = {};
  1227. tx.loader.eval = {};
  1228. L("tx.loader.eval", tx.loader.eval);
  1229. /*
  1230. * ???????????
  1231. */
  1232. setLoad(tx, function(a, b, c) {
  1233. var d = Moudles[":" + a];
  1234. if (d) {
  1235. if (c && !c.language && c.locale)
  1236. c.language = c.locale;
  1237. if (c && typeof c.callback == "string") {
  1238. var g = c.callback;
  1239. if (g.match(/^[[\]A-Za-z0-9._]+$/)) {
  1240. g = window.eval(g);
  1241. c.callback = g
  1242. }
  1243. }
  1244. var l = c && c.callback != f;
  1245. if (l && !d.p(b))
  1246. throw error("Module: '" + a + "' must be loaded before DOM onLoad!");
  1247. else
  1248. if (l)
  1249. d.k(b, c) ? window.setTimeout(c.callback, 0) : d.load(b, c);
  1250. else
  1251. d.k(b, c) || d.load(b, c)
  1252. }
  1253. else
  1254. throw error("??: \"" + a + "\" ???!");
  1255. });
  1256. L("tx.load", tx.load);
  1257. /**
  1258. * ??????,??????????
  1259. *
  1260. *
  1261. * @param {Function} fn ????
  1262. */
  1263. tx.setOnLoadCallback = function(fn) {
  1264. var moudle = tx.loader["mname"];
  1265. var a = moudle;
  1266. Moudles[":" + a]["load"].setOnLoad(fn);
  1267. //delete tx.loader["mname"];
  1268. };
  1269. L("tx.setOnLoadCallback", tx.setOnLoadCallback);
  1270. tx.loader.writeLoadTag = function(a, b, c) {
  1271. if (c) {
  1272. var d;
  1273. if (a == "script") {
  1274. d = document.createElement("script");
  1275. d.type = "text/javascript";
  1276. d.src = b
  1277. }
  1278. else
  1279. if (a == "css") {
  1280. d = document.createElement("link");
  1281. d.type = "text/css";
  1282. d.href = b;
  1283. d.rel = "stylesheet"
  1284. }
  1285. var g = document.getElementsByTagName("head")[0];
  1286. g || (g = document.body.parentNode.appendChild(document.createElement("head")));
  1287. g.appendChild(d)
  1288. }
  1289. else
  1290. if (a == "script")
  1291. document.write('<script src="' + b + '" type="text/javascript"><\/script>');
  1292. else
  1293. a == "css" && document.write('<link href="' + b + '" type="text/css" rel="stylesheet"></link>')
  1294. };
  1295. L("tx.loader.writeLoadTag", tx.loader.writeLoadTag);
  1296. tx.loader.rfm = function(a) {
  1297. N = a
  1298. };
  1299. L("tx.loader.rfm", tx.loader.rfm);
  1300. tx.loader.rpl = function(a) {
  1301. for (var b in a)
  1302. if (typeof b == "string" && b && b.charAt(0) == ":" && !Moudles[b])
  1303. Moudles[b] = new rpl(b.substring(1), a[b])
  1304. };
  1305. L("tx.loader.rpl", tx.loader.rpl);
  1306. tx.loader.rm = function(a) {
  1307. if ((a = a.specs) && a.length)
  1308. for (var b = 0; b < a.length; ++b) {
  1309. var c = a[b];
  1310. if (typeof c == "string")
  1311. Moudles[":" + c] = new U(c);
  1312. else {
  1313. var d = new V(c.name, c.baseSpec, c.customSpecs);
  1314. Moudles[":" + d.name] = d
  1315. }
  1316. }
  1317. };
  1318. L("tx.loader.rm", tx.loader.rm);
  1319. tx.loader.loaded = function(a) {
  1320. Moudles[":" + a.module].i(a)
  1321. };
  1322. L("tx.loader.loaded", tx.loader.loaded);
  1323. //Classes U W V rpl loadScript =========================================================
  1324. //class U
  1325. function U(a) {
  1326. this.a = a;
  1327. this.n = {};
  1328. this.b = {};
  1329. this.j = true;
  1330. this.c = -1
  1331. }
  1332. U.prototype.f = function(a, b) {
  1333. var c = "";
  1334. if (b != undefined) {
  1335. if (b.language != undefined)
  1336. c += "&hl=" + encodeURIComponent(b.language);
  1337. if (b.nocss != undefined)
  1338. c += "&output=" + encodeURIComponent("nocss=" + b.nocss);
  1339. if (b.nooldnames != undefined)
  1340. c += "&nooldnames=" + encodeURIComponent(b.nooldnames);
  1341. if (b.packages != undefined)
  1342. c += "&packages=" + encodeURIComponent(b.packages);
  1343. if (b.callback != f)
  1344. c += "&async=2";
  1345. if (b.other_params != undefined)
  1346. c += "&" + b.other_params
  1347. }
  1348. if (!this.j) {
  1349. if (k[this.a] && k[this.a].JSHash)
  1350. c += "&sig=" + encodeURIComponent(k[this.a].JSHash);
  1351. var d = [];
  1352. for (var g in this.n)
  1353. g.charAt(0) == ":" && d.push(g.substring(1));
  1354. for (g in this.b)
  1355. g.charAt(0) == ":" && d.push(g.substring(1));
  1356. c += "&have=" + encodeURIComponent(d.join(","))
  1357. }
  1358. return tx.loader.ServiceBase +
  1359. "/?file=" +
  1360. this.a +
  1361. "&v=" +
  1362. a +
  1363. tx.loader.AdditionalParams +
  1364. c
  1365. };
  1366. U.prototype.u = function(a) {
  1367. var b = f;
  1368. if (a)
  1369. b = a.packages;
  1370. var c = f;
  1371. if (b)
  1372. if (typeof b == "string")
  1373. c = [a.packages];
  1374. else
  1375. if (b.length) {
  1376. c = [];
  1377. for (var d = 0; d < b.length; d++)
  1378. typeof b[d] == "string" && c.push(b[d].replace(/^\s*|\s*$/, "").toLowerCase())
  1379. }
  1380. c || (c = ["default"]);
  1381. var g = [];
  1382. for (d = 0; d < c.length; d++)
  1383. this.n[":" + c[d]] || g.push(c[d]);
  1384. return g
  1385. };
  1386. //U.prototype.load
  1387. setLoad(U.prototype, function(a, b) {
  1388. var c = this.u(b), d = b && b.callback != f;
  1389. if (d)
  1390. var g = new W(b.callback);
  1391. for (var l = [], u = c.length - 1; u >= 0; u--) {
  1392. var y = c[u];
  1393. d && g.z(y);
  1394. if (this.b[":" + y]) {
  1395. c.splice(u, 1);
  1396. d && this.b[":" + y].push(g)
  1397. }
  1398. else
  1399. l.push(y)
  1400. }
  1401. if (c.length) {
  1402. if (b && b.packages)
  1403. b.packages = c.sort().join(",");
  1404. if (!b && N[":" + this.a] != f && N[":" + this.a].versions[":" + a] != f && !tx.loader.AdditionalParams && this.j) {
  1405. var z = N[":" + this.a];
  1406. k[this.a] = k[this.a] ||
  1407. {};
  1408. for (var Q in z.properties)
  1409. if (Q && Q.charAt(0) == ":")
  1410. k[this.a][Q.substring(1)] = z.properties[Q];
  1411. tx.loader.writeLoadTag("script", tx.loader.ServiceBase +
  1412. z.path +
  1413. z.js, d);
  1414. z.css && tx.loader.writeLoadTag("css", tx.loader.ServiceBase + z.path + z.css, d)
  1415. }
  1416. else
  1417. if (!b || !b.autoloaded)
  1418. tx.loader.writeLoadTag("script", this.f(a, b), d);
  1419. if (this.j) {
  1420. this.j = false;
  1421. this.c = (new Date).getTime();
  1422. if (this.c % 100 != 1)
  1423. this.c = -1
  1424. }
  1425. for (u = 0; u < l.length; u++) {
  1426. y = l[u];
  1427. this.b[":" + y] = [];
  1428. d && this.b[":" + y].push(g)
  1429. }
  1430. }
  1431. });
  1432. U.prototype.i = function(a) {
  1433. if (this.c != -1) {
  1434. this.c = -1
  1435. }
  1436. for (var b = 0; b < a.components.length; b++) {
  1437. this.n[":" + a.components[b]] = true;
  1438. var c = this.b[":" + a.components[b]];
  1439. if (c) {
  1440. for (var d = 0; d < c.length; d++)
  1441. c[d].C(a.components[b]);
  1442. delete this.b[":" + a.components[b]]
  1443. }
  1444. }
  1445. };
  1446. U.prototype.k = function(a, b) {
  1447. return this.u(b).length == 0
  1448. };
  1449. U.prototype.p = function() {
  1450. return true
  1451. };
  1452. //class W
  1453. function W(a) {
  1454. this.B = a;
  1455. this.l = {};
  1456. this.o = 0
  1457. }
  1458. W.prototype.z = function(a) {
  1459. this.o++;
  1460. this.l[":" + a] = true
  1461. };
  1462. W.prototype.C = function(a) {
  1463. if (this.l[":" + a]) {
  1464. this.l[":" + a] = false;
  1465. this.o--;
  1466. this.o == 0 && window.setTimeout(this.B, 0)
  1467. }
  1468. };
  1469. //class V
  1470. function V(a, b, c) {
  1471. this.name = a;
  1472. this.A = b;
  1473. this.m = c;
  1474. this.t = this.g = false;
  1475. this.h = [];
  1476. tx.loader.callbacks[this.name] = H(this.i, this)
  1477. }
  1478. inherit(V, U);
  1479. V.prototype.load = function(a, b) {
  1480. var c = b && b.callback != f;
  1481. if (c) {
  1482. this.h.push(b.callback);
  1483. b.callback = "tx.loader.callbacks." + this.name
  1484. }
  1485. else
  1486. this.g = true;
  1487. if (!b || !b.autoloaded) {
  1488. var src = this.f(a, b);
  1489. tx.loader["mname"] = this.name;
  1490. Moudles[":" + this.name]["load"] = new loadScript(src);
  1491. }
  1492. };
  1493. V.prototype.k = function(a, b) {
  1494. return b && b.callback != f ? this.t : this.g
  1495. };
  1496. V.prototype.i = function() {
  1497. this.t = true;
  1498. for (var a = 0; a < this.h.length; a++)
  1499. window.setTimeout(this.h[a], 0);
  1500. this.h = []
  1501. };
  1502. // var Y = function(a, b) {
  1503. // return a.string ? encodeURIComponent(a.string) + "=" + encodeURIComponent(b) : a.regex ? b.replace(/(^.*$)/, a.regex) : ""
  1504. // };
  1505. V.prototype.f = function(a, b) {
  1506. return this.F(this.v(a), a, b)
  1507. };
  1508. V.prototype.F = function(a, b, c) {
  1509. var d = "";
  1510. // if (a.key)
  1511. // d += "&" + Y(a.key, tx.loader.ApiKey);
  1512. // if (a.version)
  1513. // d += "&" + Y(a.version, b);
  1514. var

Large files files are truncated, but you can click here to view the full file