common_stat.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * jQuery doTimeout: Like setTimeout, but better! - v1.0 - 3/3/2010
  3. * http://benalman.com/projects/jquery-dotimeout-plugin/
  4. *
  5. * Copyright (c) 2010 "Cowboy" Ben Alman
  6. * Dual licensed under the MIT and GPL licenses.
  7. * http://benalman.com/about/license/
  8. */
  9. (function($) {
  10. var a = {}, c = "doTimeout", d = Array.prototype.slice;
  11. $[c] = function() {
  12. return b.apply(window, [0].concat(d.call(arguments)))
  13. };
  14. $.fn[c] = function() {
  15. var f = d.call(arguments), e = b.apply(this, [c + f[0]].concat(f));
  16. return typeof f[0] === "number" || typeof f[1] === "number" ? this : e
  17. };
  18. function b(l) {
  19. var m = this, h, k = {}, g = l ? $.fn : $, n = arguments, i = 4, f = n[1], j = n[2], p = n[3];
  20. if (typeof f !== "string") {
  21. i--;
  22. f = l = 0;
  23. j = n[1];
  24. p = n[2]
  25. }
  26. if (l) {
  27. h = m.eq(0);
  28. h.data(l, k = h.data(l) || {})
  29. } else {
  30. if (f) {
  31. k = a[f] || (a[f] = {})
  32. }
  33. }
  34. k.id && clearTimeout(k.id);
  35. delete k.id;
  36. function e() {
  37. if (l) {
  38. h.removeData(l)
  39. } else {
  40. if (f) {
  41. delete a[f]
  42. }
  43. }
  44. }
  45. function o() {
  46. k.id = setTimeout(function() {
  47. k.fn()
  48. }, j)
  49. }
  50. if (p) {
  51. k.fn = function(q) {
  52. if (typeof p === "string") {
  53. p = g[p]
  54. }
  55. p.apply(m, d.call(n, i)) === true && !q ? o() : e()
  56. };
  57. o()
  58. } else {
  59. if (k.fn) {
  60. j === undefined ? e() : k.fn(j === false);
  61. return true
  62. } else {
  63. e()
  64. }
  65. }
  66. }}
  67. )(jQuery);
  68. var loadingView, hdBaominFristView;
  69. $(document).ready(function() {
  70. checkYYClient();
  71. // $.doTimeout("checkYYClient", 5000, function() {
  72. // return checkYYClient()
  73. // });
  74. });
  75. function returnCallback(type, callback) {
  76. if (callback && typeof(callback) === "function") {
  77. return callback();
  78. } else {
  79. return type;
  80. }
  81. }
  82. /**
  83. * 检测YY是否有登录
  84. */
  85. var YYClient = {login: false, users: [], stauts: "initing", waitTime: 0, result: null};
  86. var JQ_YY_CHECKER_OBJ = false;//为了防止重复加载<object>标签
  87. function checkYYClient(callback) {
  88. callback = callback || null;
  89. var activeXObj = null;
  90. if (window.ActiveXObject) {
  91. try {
  92. activeXObj = new ActiveXObject('yy_checker.Checker');
  93. } catch (e) {
  94. }
  95. } else {
  96. if (!JQ_YY_CHECKER_OBJ) {
  97. $('body').append('<object id="yyplugin" type="application/x-checker" width="0" height="0"><param name="onload" value="pluginLoaded" /></object>');
  98. JQ_YY_CHECKER_OBJ = true;
  99. }
  100. activeXObj = document.getElementById('yyplugin');
  101. }
  102. if (activeXObj == null) {
  103. YYClient = {login: false, users: [], stauts: "over"};
  104. return returnCallback(true, callback);
  105. }
  106. YYClient.stauts = "checking";
  107. YYClient.result = null;
  108. if (typeof activeXObj.GetYYList == "undefined") {
  109. YYClient = {login: false, users: [], stauts: "over"};
  110. return returnCallback(true, callback);
  111. } else {
  112. activeXObj.GetYYList();
  113. }
  114. $.doTimeout("waitCheckYYClient", 50, function() {
  115. if (YYClient.result !== null) {
  116. YYClient.login = YYClient.result;
  117. return returnCallback(false, callback);
  118. } else if (YYClient.waitTime > 3) {
  119. YYClient.login = false;
  120. YYClient.stauts = "over";
  121. return returnCallback(false, callback);
  122. }
  123. YYClient.waitTime++;
  124. return returnCallback(true, callback);
  125. });
  126. return returnCallback(true, callback);
  127. }
  128. function YYCallback(msgId, cbid, callbackText) {
  129. if (msgId != 0) {
  130. } else {
  131. var parts = callbackText.split("\n");
  132. var uuid = parts[3].split(":")[1];
  133. if (uuid == 0) {
  134. return;
  135. }
  136. YYClient.users[YYClient.users.length] = cbid;
  137. YYClient.result = true;
  138. YYClient.stauts = "over";
  139. }
  140. }
  141. /**
  142. * @param cid
  143. * @returns {boolean}
  144. */
  145. function toChannel(cid, subcid, from) {
  146. var b = checkYYClient(function() {
  147. if (YYClient.login) {
  148. if (!$('#hIframe')[0]) {
  149. $('body').append('<iframe id="hIframe" src="about:Tabs" style="display:none;"></iframe>');
  150. }
  151. $('#hIframe').attr('src', "yy://pd-[sid=" + cid + "&subid=" + subcid + "&yygameliveinfo=" + from + "]");
  152. return false;
  153. } else {
  154. return true;
  155. }
  156. });
  157. if(b){
  158. //跳转页面数据统计触发
  159. _hiido_wid=["_ab8c466"];
  160. hiidov3();
  161. }
  162. return b;
  163. }
  164. /**
  165. * 统计点击下载客户端
  166. */
  167. function statistics(me) {
  168. _hiido_wid=["_8c00849"];
  169. hiidov3();
  170. _hiido_wid=["_8c00849"];
  171. hiidov3();
  172. if (!me) { return }
  173. var params={
  174. "act":"webevent",
  175. "eventid":$(me).attr("hiido_code"),//EVENTID
  176. "value":1,//VALUE
  177. "eventype":1//EVENTTYPE
  178. };
  179. window.appHiido.stat(params);
  180. }
  181. /**
  182. * 美女秀统计
  183. */
  184. function meinvxiu_statistics() {
  185. _hiido_wid=["_1343853"];
  186. hiidov3();
  187. }