1var thisUrl = window.location.pathname; 2 3$(document) 4 .on('click touchstart', '[data-page-num]', function () { 5 var $this = $(this), 6 blockId = $this.parent().data('blockId'), 7 pageNum = $this.data('pageNum'), 8 $block = $('#' + blockId); 9 10 base_loader(blockId, 'start'); 11 12 $.ajax({ 13 url: dle_root + 'engine/ajax/controller.php', 14 dataType: 'html', 15 data: { 16 mod: 'blockpro', 17 pageNum: pageNum, 18 blockId: blockId, 19 thisUrl: thisUrl 20 } 21 }) 22 .done(function (data) { 23 $block.html($(data).html()); 24 }) 25 .fail(function () { 26 base_loader(blockId, 'stop'); 27 console.log("error"); 28 }) 29 .always(function () { 30 base_loader(blockId, 'stop'); 31 }); 32 33 }) 34 .on('click touchstart', '[data-favorite-id]', function (event) { 35 event.preventDefault(); 36 var $this = $(this), 37 fav_id = $this.data('favoriteId'), 38 action = $this.data('action'); 39 40 ShowLoading(''); 41 $.get(dle_root + 'engine/ajax/controller.php', { 42 fav_id: fav_id, 43 action: action, 44 skin: dle_skin, 45 mod: 'favorites', 46 alert: 1, 47 user_hash: dle_login_hash || '' 48 }, function (data) { 49 HideLoading(''); 50 DLEalert(data, dle_info); 51 }); 52 53 }); 54 55/** 56 * ÐÑоÑÑейÑÐ°Ñ ÑÑнкÑÐ¸Ñ Ð´Ð»Ñ ÑеализаÑии ÑÑÑекÑа загÑÑзки блока 57 * ÐобавлÑеÑ/ÑдалÑÐµÑ Ð·Ð°Ð´Ð°Ð½Ð½Ñй клаÑÑ Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ блока 58 * вÑÑ ÑабоÑа по оÑоÑÐ¼Ð»ÐµÐ½Ð¸Ñ Ð»Ð¾Ð¶Ð¸ÑÑÑ Ð½Ð° css 59 * 60 * @author ÐаÑÐÑÑиР<[email protected]> 61 * 62 * @param id 63 * @param method 64 * @param className 65 */ 66function base_loader(id, method, className) { 67 var $block = $('#' + id), 68 cname = (className) ? className : 'base-loader'; 69 if (method === 'start') { 70 $block.addClass(cname); 71 } 72 73 if (method === 'stop') { 74 $block.removeClass(cname); 75 } 76} 77 78/** 79 * ÐÑÑÑавление ÑейÑинга 80 * @see base_rate 81 * @param rate 82 * @param id 83 */ 84function base_rate(rate, id) { 85 ShowLoading(''); 86 $.get(dle_root + 'engine/ajax/controller.php?mod=rating', { 87 go_rate: rate, 88 news_id: id, 89 skin: dle_skin, 90 user_hash: dle_login_hash || '' 91 }, function(data){ 92 93 HideLoading(''); 94 95 if (data.success) { 96 var rating = data.rating; 97 98 rating = rating.replace(/</g, '<'); 99 rating = rating.replace(/>/g, '>'); 100 rating = rating.replace(/&/g, '&'); 101 102 $('[data-rating-layer="' + id + '"]').html(rating); 103 $('[data-vote-num-id="' + id + '"]').html(data.votenum); 104 105 $('#ratig-layer-' + id).html(rating); 106 $('#vote-num-id-' + id).html(data.votenum); 107 108 $('#likes-id-' + id).html(data.likes); 109 $('#dislikes-id-' + id).html(data.dislikes); 110 111 } else if (data.error) { 112 DLEalert(data.errorinfo, dle_info); 113 } 114 115 }, "json"); 116}
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.