1layui.use(['element','laytpl','util','layer','laypage'], function(){ 2 //注æï¼ä¸è½åæ use(['jquery',...],function($))ââ页é¢å·²å è½½å ¨å±jQueryæ¶layuiä¼è·³è¿jquery模åï¼åè°åæ°ä¼éä½ 3 var $ = layui.jquery; 4 var element = layui.element; 5 var laytpl = layui.laytpl; 6 var util = layui.util; 7 var layer = layui.layer; 8 var laypage = layui.laypage; 9 var page = 1; 10 var collect_id=getQueryVariable("collect_id") ; 11 var category_id=getQueryVariable("category_id") ; 12 var search_val = getQueryVariable("search_val") ; 13 loadList(page); 14 /*å è½½å表*/ 15 function loadList(page){ 16 $(".updatelist").html('<div class="loadding"> <span></span> <span></span> <span></span> <span></span> <span></span> </div>'); 17 request({ 18 url:config.api.upd_page, 19 data:{ 20 page:page, 21 category_id:category_id, 22 collect_id:collect_id, 23 search_val:search_val 24 }, 25 success:function (res) { 26 console.log(res); 27 rec(res); 28 html_demo(res); 29 }, 30 error:function(){ 31 $(".updatelist").html(''); 32 } 33 }) 34 } 35 $("#search_btn").click(function () { 36 search_val = $("input[name=search]").val(); 37 page=1; 38 loadList(page); 39 }) 40 function rec(res) { 41 laypage.render({ 42 elem: 'page', 43 limit:15, 44 count: res.count 45 ,jump: function(obj, first){ 46 console.log(obj.curr); 47 if(!first) { 48 page = obj.curr; 49 loadList(obj.curr); 50 } 51 } 52 }); 53 } 54 //ç¼åæ¨¡æ¿ 55 function html_demo(res) { 56 laytpl($("#list").html()).render(res, function(html){ 57 $(".updatelist").html(html); 58 // =========== éè¦ï¼å¦æä½ æ³ç¨èªå·±åçgetTimeTextï¼ä¸é¢è¿è¡æ³¨éæï¼ =========== 59 /* 60 $(".updatelist li").each(function(index, item) { 61 var timeDom = $(item).find(".new-time"); 62 timeDom.html(util.timeAgo(timeDom.html(), true)); 63 }); 64 */ 65 $('html,body').animate({scrollTop: 0},0); 66 }); 67 } 68 /*è·åå½åæ¶é´æ®µ*/ 69 function getTime(){ 70 var now = new Date(); 71 var year = now.getFullYear(); //å¹´ 72 var month = now.getMonth() + 1; //æ 73 var day = now.getDate(); //æ¥ 74 var hh = now.getHours(); //æ¶ 75 var mm = now.getMinutes(); //å 76 var ss = now.getSeconds(); //ç§ 77 if(month < 10) month = "0" + month; 78 if(day < 10) day = "0" + day; 79 if(hh < 10) hh = "0" + hh; 80 if (mm < 10) mm = "0" + mm; 81 if (ss < 10) ss = "0" + ss; 82 return year+"-"+month+"-"+day; 83 } 84 /*æå¼é¡µé¢*/ 85 /*$(".updatelist").on("click","li a[href]",function(e){ 86 var that = $(this).parents("li").find(".url"); 87 var index = layer.open({ 88 type: 2, 89 title:that.html(), 90 content: that.attr("href"), 91 area: ['100%', window.innerHeight+"px"], 92 maxmin: true 93 }); 94 layer.full(index); 95 e.preventDefault(); 96 });*/ 97 /*å¯¼èªæ ç®åæ¢*/ 98 $(".content .left li a").click(function(){ 99 category_id = $(this).parent('li').attr('data-id'); 100 page=1; 101 if(category_id==undefined){ 102 category_id=null; 103 } 104 $(".content .left li .hover").removeClass("hover"); 105 $(this).addClass("hover"); 106 loadList(page); 107 }); 108 $(".content .fenlei li a").click(function(){ 109 collect_id = $(this).parent('li').attr('data-id'); 110 page=1; 111 if(collect_id==undefined){ 112 collect_id=null; 113 } 114 $(".content .fenlei li .hover").removeClass("hover"); 115 $(this).addClass("hover"); 116 loadList(page); 117 }); 118 function getQueryVariable(variable) 119 { 120 var query = window.location.search.substring(1); 121 var vars = query.split("&"); 122 for (var i=0;i<vars.length;i++) { 123 var pair = vars[i].split("="); 124 if(pair[0] == variable){return pair[1];} 125 } 126 return null; 127 } 128});
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.