1require([], function (){ 2 3 var isMobileInit = false; 4 var loadMobile = function(){ 5 require(['/js/mobile.js'], function(mobile){ 6 mobile.init(); 7 isMobileInit = true; 8 }); 9 } 10 var isPCInit = false; 11 var loadPC = function(){ 12 require(['/js/pc.js'], function(pc){ 13 pc.init(); 14 isPCInit = true; 15 }); 16 } 17 18 var browser={ 19 versions:function(){ 20 var u = window.navigator.userAgent; 21 return { 22 trident: u.indexOf('Trident') > -1, //IEå æ ¸ 23 presto: u.indexOf('Presto') > -1, //operaå æ ¸ 24 webKit: u.indexOf('AppleWebKit') > -1, //è¹æãè°·æå æ ¸ 25 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //ç«çå æ ¸ 26 mobile: !!u.match(/AppleWebKit.*Mobile.*/), //æ¯å¦ä¸ºç§»å¨ç»ç«¯ 27 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //iosç»ç«¯ 28 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //androidç»ç«¯æè ucæµè§å¨ 29 iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //æ¯å¦ä¸ºiPhoneæè å®åQQæµè§å¨ 30 iPad: u.indexOf('iPad') > -1, //æ¯å¦ä¸ºiPad 31 webApp: u.indexOf('Safari') == -1 ,//æ¯å¦ä¸ºwebåºç¨ç¨åºï¼æ²¡æå¤´é¨ä¸åºé¨ 32 weixin: u.indexOf('MicroMessenger') == -1 //æ¯å¦ä¸ºå¾®ä¿¡æµè§å¨ 33 }; 34 }() 35 } 36 37 $(window).bind("resize", function(){ 38 if(isMobileInit && isPCInit){ 39 $(window).unbind("resize"); 40 return; 41 } 42 var w = $(window).width(); 43 if(w >= 700){ 44 loadPC(); 45 }else{ 46 loadMobile(); 47 } 48 }); 49 50 if(browser.versions.mobile === true || $(window).width() < 700){ 51 loadMobile(); 52 }else{ 53 loadPC(); 54 } 55 56 //æ¯å¦ä½¿ç¨fancybox 57 if(yiliaConfig.fancybox === true){ 58 require(['/fancybox/jquery.fancybox.js'], function(pc){ 59 var isFancy = $(".isFancy"); 60 if(isFancy.length != 0){ 61 var imgArr = $(".article-inner img"); 62 for(var i=0,len=imgArr.length;i<len;i++){ 63 var src = imgArr.eq(i).attr("src"); 64 var title = imgArr.eq(i).attr("alt"); 65 imgArr.eq(i).replaceWith("<a href='"+src+"' title='"+title+"' rel='fancy-group' class='fancy-ctn fancybox'><img src='"+src+"' title='"+title+"'></a>"); 66 } 67 $(".article-inner .fancy-ctn").fancybox(); 68 } 69 }); 70 71 } 72 //æ¯å¦å¼å¯å¨ç» 73 if(yiliaConfig.animate === true){ 74 75 require(['/js/jquery.lazyload.js'], function(){ 76 //avatar 77 $(".js-avatar").attr("src", $(".js-avatar").attr("lazy-src")); 78 $(".js-avatar")[0].onload = function(){ 79 $(".js-avatar").addClass("show"); 80 } 81 }); 82 83 if(yiliaConfig.isHome === true){ 84 //content 85 function showArticle(){ 86 $(".article").each(function(){ 87 if( $(this).offset().top <= $(window).scrollTop()+$(window).height() && !($(this).hasClass('show')) ) { 88 $(this).removeClass("hidden").addClass("show"); 89 $(this).addClass("is-hiddened"); 90 }else{ 91 if(!$(this).hasClass("is-hiddened")){ 92 $(this).addClass("hidden"); 93 } 94 } 95 }); 96 } 97 $(window).on('scroll', function(){ 98 showArticle(); 99 }); 100 showArticle(); 101 } 102 103 } 104 105 //æ¯å¦æ°çªå£æå¼é¾æ¥ 106 if(yiliaConfig.open_in_new == true){ 107 $(".article a[href]").attr("target", "_blank") 108 } 109 110});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.