1var baseUrl = ''; 2var maxShow = 6; 3 4if(window.location.hostname == 'news.vcms.dev.mediaset.net') { 5 baseUrl = 'http://news.vcms.dev.mediaset.net/preview-quimediaset'; 6} 7else if(window.location.hostname == 'test.quimediaset.it') { 8 baseUrl = "http://test.quimediaset.it"; 9} 10else if (window.location.hostname == 'dev.quimediaset.local') { 11 baseUrl = 'http://dev.quimediaset.local'; 12} 13else if(window.location.hostname == 'localhost') { 14 baseUrl = "http://localhost:8800"; 15} 16 17function searchDocs(){ 18 var searchText = $('#searchText').val()!='' ? $('#searchText').val() : ''; 19 20 if(window.location.hostname == 'news.vcms.dev.mediaset.net' || window.location.hostname == 'localhost'){ 21 location.href = baseUrl + '/view/search/?query=' + searchText; 22 } else { 23 location.href = baseUrl + '/search/?query=' + searchText; 24 } 25 26}; 27 28function moreResult(){ 29 var btn = $('.load-button'); 30 var totResults = parseInt(btn.attr('totResults')); 31 var currentPage = parseInt(btn.attr('currentPage')); 32 var link = btn.attr('link'); 33 var param = link.substring(link.indexOf('?')+1); 34 var paramSplit = param.split('&'); 35 var st = paramSplit[0].substring(paramSplit[0].indexOf('=')+1); 36 var query = paramSplit[1].substring(paramSplit[1].indexOf('=')+1); 37 38 var netxPage = currentPage+1; 39 var totPage = Math.ceil(totResults/maxShow); 40 41 var url = baseUrl + '/view/search-loadmore/?st=' + st + '&query=' + query; 42 43 var nextlink = "/search/?st="+(parseInt(st)+6)+"&query="+query; 44 45 if (netxPage < totPage){ 46 $(".load-button").attr("link",nextlink); 47 $(".load-button").attr("currentPage",netxPage); 48 } 49 else{ 50 $("#btn-searchloadMore").hide(); 51 } 52 53 54 $.ajax({ 55 type: 'GET', 56 contentType: 'application/json', 57 url: url, 58 cache: true, 59 success: function(htmlDoc) { 60 var result = document.getElementById("results"); 61 $(result).append(htmlDoc);
62 }, 63 error: function(xhr, status, error) { 64 alert("ko " + error); 65 } 66 }); 67}; 68 69$(document).ready( function() { 70 $("#searchDocBtn").click(function (e) { 71 e.stopImmediatePropagation(); 72 e.preventDefault(); 73 searchDocs(); 74 }); 75}); 76 77$("#btn-searchloadMore").click(function (e) { 78 moreResult(); 79});
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.