duowanFooter.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. (function() {
  2. "use strict";
  3. var Util = {
  4. _regExpTrim: /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
  5. trim: function(text) {
  6. return (text || "").replace(Util._regExpTrim, "");
  7. },
  8. isFunction: function(obj) {
  9. return Object.prototype.toString.call(obj) === "[object Function]";
  10. },
  11. createStyleSheet: function(cssText) {
  12. var stylesheet;
  13. if (document.createStyleSheet) {
  14. stylesheet = document.createStyleSheet();
  15. stylesheet.cssText = cssText;
  16. } else {
  17. stylesheet = document.createElement("style");
  18. stylesheet.appendChild(document.createTextNode(cssText));
  19. document.getElementsByTagName("head")[0].appendChild(stylesheet);
  20. }
  21. return stylesheet;
  22. },
  23. getScript: function(url, callback) {
  24. var head = document.getElementsByTagName("head")[0] || document.documentElement;
  25. var script = document.createElement("script");
  26. script.type = "text/javascript";
  27. script.async = true;
  28. script.charset = "utf-8";
  29. script.src = url;
  30. script.onload = script.onreadystatechange = function() {
  31. if (!script.readyState || /loaded|complete/.test(script.readyState)) {
  32. if (Util.isFunction(callback)) {
  33. callback();
  34. }
  35. script.onload = script.onreadystatechange = null;
  36. if (script.parentNode) {
  37. script.parentNode.removeChild(script);
  38. }
  39. }
  40. };
  41. head.insertBefore(script, null);
  42. }
  43. };
  44. /*!
  45. multiline
  46. Multiline strings in JavaScript
  47. https://github.com/sindresorhus/multiline
  48. by Sindre Sorhus
  49. MIT License
  50. */
  51. var reCommentContents = /\/\*!?(?:\@preserve)?[ \t]*(?:\r\n|\n)([\s\S]*?)(?:\r\n|\n)[ \t]*\*\//;
  52. var multiline = function (fn) {
  53. if (typeof fn !== 'function') {
  54. throw new TypeError('Expected a function');
  55. }
  56. var match = reCommentContents.exec(fn.toString());
  57. if (!match) {
  58. throw new TypeError('Multiline comment missing.');
  59. }
  60. return match[1];
  61. };
  62. var CSS_TEXT = multiline(function(){/*!@preserve
  63. #footer{clear:both;width:100%;margin:0 auto;padding:15px 0;}
  64. #footer div,#footer p{margin:8px auto;text-align:center;line-height:1;}
  65. #footer a{margin:0 4px;}
  66. #footer a b{font-weight:700;color:#F40;}
  67. .footerApprove{line-height: 1.5!important;font-size:0}
  68. .footerApprove__link{position:relative;display:inline-block;*display:inline;*zoom:1;width:64px;height:36px;margin:0 10px!important;padding-left:40px;font-size:12px;text-align:left;cursor:pointer}
  69. .footerApprove__link i{position:absolute;left:0;top:0;width:36px;height:36px;background-image:url(http://assets.dwstatic.com/www/1.2.1/img/approve-icons.gif?20150213);background-repeat:no-repeat;overflow:hidden}
  70. .footerApprove__link.is-short{width:52px}
  71. .footerApprove__315{width:90px}
  72. .footerApprove__315 i{width:130px;margin-top:4px}
  73. .footerApprove__icon2{background-position:-42px 0}
  74. .footerApprove__icon3{background-position:-84px 0}
  75. .footerApprove__icon4{background-position:-214px 2px}
  76. .footerApprove__icon5{background-position:-256px 0}
  77. */console.log});
  78. var FOOT_HTML = multiline(function(){/*!@preserve
  79. <div id="footer">
  80. <div class="foot-nav">
  81. <a href="http://www.huanju.cn/s/introduction.html">关于欢聚</a>|<a href="http://hr.yy.com/">欢聚招聘</a>|<a href="http://www.huanju.cn/s/contact.html">联系欢聚</a>|<a href="http://www.huanju.cn/s/links.html">友情链接</a>|<a href="http://www.huanju.cn/s/contact.html">广告热线:020-29162026</a>|<a href="http://www.yy.com/go.html#10">客服频道:<b>10</b></a>|<a href="http://kf.yy.com">YY客服中心</a>|<a href="http://www.huanju.cn/1207/m_205349693256.html">隐私权保护政策</a>|<a href="http://www.huanju.cn/1207/m_205353486825.html">版权保护投诉指引</a>|<a href="http://www.100.com">100教育</a>
  82. </div>
  83. <div class="copyright">
  84. <p>增值电信业务经营许可证<a href="http://assets.dwstatic.com/common/docs/B2-20050785.jpg">粤B2-20050785</a><a href="http://assets.dwstatic.com/common/docs/B2-20120129.jpg">B2-20120129</a>|<a href="http://assets.dwstatic.com/common/docs/1910441.jpg">视听许可证1910441号</a>|<a href="http://assets.dwstatic.com/common/docs/0605-096.jpg?1229">粤网文[2012]0605-096号</a>| 举报邮箱:dwkf@yy.com</p>
  85. <p><a href="http://www.miitbeian.gov.cn">粤ICP备09075143号</a>|<a href="http://www.miitbeian.gov.cn">京ICP备05047096号</a>|<a href="http://assets.dwstatic.com/common/docs/4401060100548.jpg">穗公网监备案证第4401060100548号</a>|<a href="http://www.gdca.gov.cn/">广东省通信管理局</a>|<a href="http://assets.dwstatic.com/common/docs/038.jpg">互联网出版许可证</a>|<a href="http://assets.dwstatic.com/common/docs/01022.jpg">节目制作经营许可证</a></p>
  86. <p>&copy; 2005-2015 Duowan.com 版权所有</p>
  87. </div>
  88. <div class="footerApprove"><a class="footerApprove__link" href="http://guangzhou.cyberpolice.cn/netalarm/netalarm/wangjian_index.jsp"><i class="footerApprove__icon1"></i>广州网络警察报警平台</a><a class="footerApprove__link" href="http://210.76.65.188/newwebsite/main.jsp?id=4401&amp;adir=&amp;wy=1"><i class="footerApprove__icon2"></i>公共信息安全网络监察</a><a class="footerApprove__link is-short" href="http://netadreg.gzaic.gov.cn/ntmm/WebSear/WebLogoPub.aspx?logo=440106106022005041100016"><i class="footerApprove__icon1"></i>工商网监红盾认证</a><a class="footerApprove__link footerApprove__315" href="http://315web.duowan.com/index.jsp"><i class="footerApprove__icon3"></i></a><a class="footerApprove__link is-short" href="http://www.net.china.com.cn/txt/2015-01/20/content_7622927.htm"><i class="footerApprove__icon5"></i>网络敲诈有偿删帖</a><a class="footerApprove__link" href="http://www.12377.cn/"><i class="footerApprove__icon4"></i>违法不良信息举报中心</a>
  89. </div>
  90. </div>
  91. */console.log});
  92. Util.createStyleSheet(CSS_TEXT);
  93. document.write(FOOT_HTML);
  94. if (!window.jQuery) {
  95. Util.getScript("http://assets.dwstatic.com/b=common/js&f=jquery-1.11.1.min.js,jquery-migrate-1.2.1.min.js&20141230");
  96. }
  97. // 全站弹框
  98. var s = document.getElementById("dw-footer-without-gem");
  99. // var mobi =/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  100. var mobi = (/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera);
  101. if (!s && !mobi) document.writeln('<script src="http://assets.dwstatic.com/amkit/entry.js" data-entry="p/livetip/1.1.0/main"><\/script>');
  102. s = null;
  103. // 适配iOS视频
  104. if(mobi) {
  105. var embeds = jQuery('embed[src*=swf]');
  106. var youkuPattern = /\/sid\/([\w]+)[\W]/;
  107. var tudouPattern = /\/v\/([^\/]+)\//;
  108. var sohuPattern = /id=([\d]+)[\D]/i;
  109. jQuery.each(embeds, function(i, v){
  110. var _U = jQuery(embeds[i]).attr('src');
  111. var _W = jQuery(embeds[i]).attr('width');
  112. var _H = jQuery(embeds[i]).attr('height');
  113. if(_U.match(/youku/)){
  114. var vid = _U.match(youkuPattern)[1];
  115. if(vid != null){
  116. jQuery(embeds[i]).replaceWith('<iframe width='+_W+' height='+_H+' src="http://player.youku.com/embed/'+vid+'" frameborder=0 allowfullscreen></iframe>');
  117. };
  118. }else if(_U.match(/tudou/)){
  119. var vid = _U.match(tudouPattern)[1];
  120. if(vid != null){
  121. jQuery(embeds[i]).replaceWith('<iframe width="'+_W+'" height="'+_H+'" frameborder="0" src="http://www.tudou.com/programs/view/html5embed.action?code='+vid+'"></iframe>');
  122. };
  123. }else if(_U.match(/sohu/)){
  124. var vid = _U.match(sohuPattern)[1];
  125. if(vid != null){
  126. jQuery(embeds[i]).replaceWith('<video width="'+_W+'" height="'+_H+'" x-webkit-airplay="allow" preload controls src="http://my.tv.sohu.com/ipad/'+vid+'.m3u8"></video>');
  127. };
  128. };
  129. });
  130. };
  131. document.writeln('<script src="http://assets.dwstatic.com/amkit/entry.js" data-entry="p/footer/main"><\/script>');
  132. document.writeln('<script src="http://www.duowan.com/duowan.js"><\/script>');
  133. document.writeln('<script src="http://www.duowan.com/public/s/market_count.js"><\/script>');
  134. document.writeln('<script src="http://www.duowan.com/s/statistics.js"><\/script>');
  135. })();