1/** 2 * 3 * @author Spmtelecom <[email protected]> 4 * 5 * @project cheznoo.net 6 * 7 * @date Friday, 16 Janvier 2014 8 * 9 */ 10 11function readLastClassifieds() { 12 var url = WEBSITE_URL + 'classifieds/xhr-read-last-classifieds'; 13 $.get(url, {_: new Date().getTime()}, function(o) { 14 if (o.success == 1) { 15 var lastClassifieds = o.data.lastClassifieds; 16 if (lastClassifieds[0]) { 17 populateLastClassifieds(lastClassifieds); 18 } 19 } 20 return false; 21 }); 22 return false; 23} 24 25function populateLastClassifieds(lastClassifieds) { 26 27 var html = ''; 28 var i = 0; 29 var length = lastClassifieds.length 30 31 html += '<div class="col-md-12">' 32 + '<div class="panel-group acc-v1" id="accordion-1" style=" margin-bottom: 15px;">'; 33 34 for (i; i < length; i++) { 35 var lastClassified = lastClassifieds[i]; 36 37 38 39 if(lastClassified.files){var image = lastClassified.files[0];} else {var image ="";} 40 41 42 html += '<div class="panel panel-default" >' 43 + '<div class="panel-heading">' 44 45 + '<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-1" href="#collapse-'; 46 if(i == 0){html += 'One'+ '">'} 47 if(i == 1){html += 'Two'+ '">'} 48 if(i == 2){html += 'Three'+ '">'} 49 if(i == 3){html += 'Four'+ '">'} 50 if(i == 4){html += 'Five'+ '">'} 51 if(i == 5){html += 'Six'+ '">'} 52 if(i == 6){html += 'Seven'+ '">'} 53 if(i == 7){html += 'Eight'+ '">'} 54 html += '<span class="label label-primary pull-right" style="background-color: white; color: rgb(72, 20, 160);">' + lastClassified.category + '</span>' 55 56 if (lastClassified.name.length > 70) { 57 html += '' + lastClassified.name.substr(0, 70) + '...'; 58 } else { 59 html += '' + lastClassified.name; 60 } 61 html += '' 62 + '</a>' 63 64 + '</div>' 65 + '<div id="collapse-'; 66 if(i == 0){html += 'One'} 67 if(i == 1){html += 'Two'} 68 if(i == 2){html += 'Three'} 69 if(i == 3){html += 'Four'} 70 if(i == 4){html += 'Five'} 71 if(i == 5){html += 'Six'} 72 if(i == 6){html += 'Seven'} 73 if(i == 7){html += 'Eight'} 74 75 html += '" class="panel-collapse collapse'+ '">' 76 //if(i == 0){html += ' in">';} else { html += '">';} 77 html += '<div class="panel-body">' 78 + '<div class="row">' 79 + '<div class="col-md-4">' 80 + '<img class="img-responsive" src="'; 81 82if(image != ""){ html += FILES_URL 83+ image.ownerType 84+ '/' 85+ +lastClassified.memberId 86+ '/' 87+ image.itemType 88+ '/' 89+ image.itemId 90+ '/medium/' 91+ image.name 92+ '" alt="">'; 93 94} else { 95 html += WEBSITE_URL + 'assets/img/petitesannonces.png' 96 + '" alt="">'; 97 } 98 99 html += '</div>' 100 + '<div class="col-md-8">' 101 + '<p>' + lastClassified.description + '</p>' 102 103 104 + '</div>' 105 + '</div>' 106 + '<a class="btn-u btn-u-small pull-right" style=" background: #4814a0;" href="' + WEBSITE_URL + 'classifieds/read/' + lastClassified.id + '">' 107 + '<i class="icon-plus-sign"> </i> Voir l\'annonce</a>' 108 + '</div>' 109 110 + '</div>' 111 112 + '</div>'; 113 114 } 115 116 html += '</div>' 117 + '</div>'; 118 119 $('#lastClassifiedsList').html(html); 120 121} 122 123$(function() { 124// $(window).on("load", function() { 125// var ClassifiedsVisited = false; 126// $(window).scroll(function() { 127// if(ClassifiedsVisited == false){ 128// var ClassifiedsVisible = $('#lastClassifieds').visible() 129// if (ClassifiedsVisible == true) { 130 readLastClassifieds(); 131// ClassifiedsVisited = true; 132// } 133// } 134// }); 135// 136// }); 137 138 139 140 $('#lastClassifieds #textPageHomeLastClassifiedsClassifieds').replaceWith( 141 text['page']['home']['lastClassifieds']['classifieds']); 142 $('#lastClassifieds #textPageHomeLastClassifiedsMoreClassifieds') 143 .replaceWith(text['page']['home']['lastClassifieds']['moreClassifieds']); 144 return false; 145});
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.