The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Javascript limiting search results
chadcollings
post May 8 2017, 09:33 PM
Post #1





Group: Members
Posts: 2
Joined: 28-April 17
Member No.: 26,389



Hey, I am wondering if there is a way to make this script not require the clicking of the "Load More" button to load results.

What I am trying to do it do a scrape of the website to get the source of the table data that is being filtered. Or just load all pages, after the filter. it is currently filtering results 100 at a time.

Is that retrievable from this code?
CODE


function isValidInput(a){return a&&""!=a}var thisInput,windowWidth;$(".filterRow").hover(function(){$(this).prevAll(".filterColTitle:first").addClass("filterColTitleSelected")},function(){$(this).prevAll(".filterColTitle:first").removeClass("filterColTitleSelected")});
function toolTip(a,b){var c=a.attr("data-tool-tip");a.height();var e=a.width()+30,d=$(".filterCol").first().width()+11,f=$(".filterCol").last().position().left-$(".filterCol").first().width();$("#toolTipArrow").attr("class","filterSprite");var k=0;a.hasClass("lgeItem")&&(k=-200);var g="left";windowWidth=$(window).width();var h=b.left-e+460-10,l="-=15";windowWidth-b.left<2*e&&(g="right",h=f,l="+=15");a.hasClass("select")&&(h-=19);$("#toolTipArrow").addClass("toolTip"+g);"right"===g?$("#toolTipArrow").stop(!0,
!1).css({left:d}):$("#toolTipArrow").stop(!0,!1).css({left:""});$("#toolTip").stop(!0,!1).css({top:b.top-12,left:h+k,"max-width":d});$("#toolTipHtml").text(c);$("#toolTip").css({opacity:"0",display:"block"});$("#toolTip").animate({left:l,opacity:1},600)}function closeToolTip(){$("#toolTip").stop(!0,!1).fadeOut(400,function(){$("#toolTipHtml").html("")})}$(".toolTip").focus(function(){var a=$(this),b=a.position();toolTip(a,b)});$(".toolTip").blur(function(){closeToolTip()});
$(function(){$(".date").datepicker({minDate:-90,maxDate:0})});$(".date").focus(function(){var a=$(this);a.addClass("date_selected");var b=a.position().left+150;a.after('<span class="filterSprite clearDate" title="Clear Date" style="left:'+b+'px;"></span>')});$(".date").blur(function(){$(this).removeClass("date_selected");$(this).siblings(".clearDate").remove()});var currentFilters={},currentSelectItem,currentInput,currentHoverItem,invalidKeys=[13,38,40,39,37],selectedItem=-1;
function getList(a,b){var c=selectOBJ[a].parent,e;for(e in selectOBJ[a].list){var d=selectOBJ[a].list[e],f="";b==d.parentValue&&(f=" selectedItem");isValidInput(currentFilters[c])?-1!=$.inArray(d.parentValue,currentFilters[c])&&$("#selectBoxText").append('<li class="selectBoxItem'+f+'">'+d.value+"</li>"):$("#selectBoxText").append('<li class="selectBoxItem'+f+'">'+d.value+"</li>")}}$(".select").click(function(a){a.stopPropagation()});
$(".select").focus(function(a){$("#selectBoxTextHolder").html('<ul id="selectBoxText"></ul>');currentInput=$(this);a=currentInput.val();currentOBJ=currentInput.attr("name");var b=currentInput.position();currentInput.width();currentInput.addClass("select_selected");$("#selectBox").stop(!0,!1).css({top:b.top+28,left:b.left});getList(currentOBJ,a);$("#selectBox").slideDown(250)});
function setChildren(a,b){if(isValidInput(selectOBJ[a].child)){var c=selectOBJ[a].child;$("#"+c).val("");var e=[],d;for(d in selectOBJ[c].list){var f=selectOBJ[c].list[d];~$.inArray(f.parentValue,b)&&e.push(f.value)}currentFilters[c]=e;setChildren(c,e)}}function closeSelect(){$("#selectBox").slideUp(250,function(){$("#selectBoxText").remove()})}$(".select").blur(function(){$(this).removeClass("select_selected")});$(document).click(function(){closeSelect();closeSort()});
$("#selectBoxTextHolder").on("click","#selectBoxText li",function(a){a.stopPropagation();a=$(this).text();currentInput.val(a);var b=currentInput.val();a=currentInput.attr("name");closeSelect();isValidInput(b)&&(b=[b],setChildren(a,b),currentFilters[a]=b)});$("#selectBoxTextHolder").on("mouseover","#selectBoxText li",function(){currentHoverItem=$(this);currentHoverItem.text();$(this).addClass("selectedItem_hover")});$("#selectBoxTextHolder").on("mouseout","#selectBoxText li",function(){$(this).removeClass("selectedItem_hover")});
function selectItem(a){if(38==a){if(0<selectedItem){a=$(".selectBoxItem").eq(selectedItem);selectedItem--;var b=$(".selectBoxItem").eq(selectedItem);a.removeClass("selectedItem_hover");b.addClass("selectedItem_hover")}}else if(40==a)parseFloat($(".selectBoxItem").length-1)>selectedItem&&(-1<selectedItem&&(a=$(".selectBoxItem").eq(selectedItem),a.removeClass("selectedItem_hover")),selectedItem++,b=$(".selectBoxItem").eq(selectedItem),b.addClass("selectedItem_hover"));else if(13==a)$(".selectedItem_hover")[0]&&
currentInput.val($(".selectedItem_hover").text()),currentInput.blur();else return!1}function filterList(a){a=a.toLowerCase();""==a?$(".selectBoxItem").show():$(".selectBoxItem").each(function(){-1!=$(this).text().toLowerCase().indexOf(a)?$(this).show():$(this).hide()})}$(".select").keyup(function(a){var b=$(this).val();-1==$.inArray(a.keyCode,invalidKeys)?filterList(b):-1!=$.inArray(a.keyCode,invalidKeys)?selectItem(a.keyCode):currentInput.blur();return!1});
var symbolTitles={"Less Than":"filterLessThan","Greater Than":"filterGreaterThan","Equal To":"filterEqualTo"};
function updateLGE(a){var b="";$(a.parent(".rightBlock").parent(".filterRow").children(".rightBlock").children(".lgeItem").get().reverse()).each(function(){if($(this).hasClass("lge-icon")){var a=symbolTitles[$(this).attr("title")];$(this).hasClass(a+"_selected")&&(b+=$(this).attr("title")+" ")}else $.trim($(this).val())&&""!=$.trim($(this).val())&&(b+=$.trim($(this).val()))});""!=b?a.siblings(".lge-input").addClass("required"):a.siblings(".lge-input").removeClass("required");a.siblings(".lge-hidden").val(b)}
function changeIcon(a){var b=symbolTitles[a.attr("title")];a.hasClass(b+"_selected")?a.removeClass(b+"_selected"):a.addClass(b+"_selected");""==$.trim(a.siblings("lge-input").val())&&a.siblings("lge-input").val("0");updateLGE(a)}$(".lge-icon").click(function(){changeIcon($(this))});
$(".lge-input").blur(function(){updateLGE($(this));""==$.trim($(this).val())||$(this).siblings(".filterEqualTo").hasClass("filterEqualTo_selected")||$(this).siblings(".filterLessThan").hasClass("filterLessThan_selected")||$(this).siblings(".filterGreaterThan").hasClass("filterGreaterThan_selected")?""==$.trim($(this).val())&&$(this).siblings(".filterEqualTo").removeClass("filterEqualTo_selected"):$(this).siblings(".filterEqualTo").addClass("filterEqualTo_selected")});
$("#clearSearch").click(function(){$(".filterRight").val("");currentFilters={};$(".date").each(function(){$(this).val(this.defaultValue)});$(".filterEqualTo").removeClass("filterEqualTo_selected");$(".filterLessThan").removeClass("filterLessThan_selected");$(".filterGreaterThan").removeClass("filterGreaterThan_selected");$(".boolSelected").each(function(){var a=$(this);a.removeClass("boolSelected");a.parent("span").siblings("input").val("")});return!1});
$(".filterBool").hover(function(){$(this).hasClass("boolSelected")||$(this).addClass("boolHover")},function(){$(this).removeClass("boolHover")});$(".filterBool").click(function(){if($(this).hasClass("boolSelected"))$(this).removeClass("boolSelected"),$(this).parent("span").siblings("input").val("");else{var a=$(this).attr("data-bool-value");$(this).siblings(".filterBool").removeClass("boolSelected");$(this).addClass("boolSelected");$(this).parent("span").siblings("input").val(a)}});
$(".button").hover(function(){$(this).addClass("button_hover")},function(){$(this).removeClass("button_hover")});$(".antiButton").hover(function(){$(this).addClass("antiButton_hover")},function(){$(this).removeClass("antiButton_hover")});var ajaxInterval,randomPhrases="Still loading...;Yeah... It's still loading...;Looking through 100+ million records...;Hmmm, this is taking a while;What building has the most stories?;A library;Mind = Blown;Yep... Still loading".split(";");
$(document).ajaxStart(function(){var a=0;chageLoading("Loading...");ajaxInterval=setInterval(function(){chageLoading(randomPhrases[a]);a<randomPhrases.length-1&&a++},1E4)});$(document).ajaxStop(function(){chageLoading("Done!");clearInterval(ajaxInterval)});
$("#submitSearch").click(function(){showLoading();chageLoading("Saving Search...");var a=!0;$(".required").each(function(){var b=$(this),c=$.trim(b.val());if(""==c||c==b.defaultValue)a=!1,b.addClass("fail")});1==a?$.ajax({url:"/crest/api.php?type=search&subType=save",type:"POST",dataType:"json",data:$("#crestForm").serialize(),success:function(a){buildResults(a)},error:function(a,c){hideLoading();openLightbox("error");logAction("newSearchError","User got an error when searching - "+c+" - "+a)}}):
(hideLoading(),openLightbox("fail"));return!1});$("#crestForm").submit(function(){return!1});function cleanNumber(a){return a.match(/([0-9]|(\<(.*)\>))/g).join("")}$(".number").keyup(function(){var a=cleanNumber($(this).val());$(this).val(a)});$(".number").blur(function(){var a=cleanNumber($(this).val());$(this).val(a)});
var setSort={CallStart:{sortOrder:2,sort:"desc",filter:[]},HasScreen:{sortOrder:1,sort:"desc",filter:[]}},currentTH=$(".crestTH[data-col-name='HasScreen']"),currentTHCol="HasScreen",tableArray,currentTHType="bool";
function resortTable(){$rows=$(".crestTR",$("#crestResultsTable"));$rows.sort(function(a,b){var c,e;switch(currentTHType){case "int":c=parseFloat($(".TD-"+currentTHCol,a).text());e=parseFloat($(".TD-"+currentTHCol,b).text());break;case "lge":c=parseFloat($(".TD-"+currentTHCol,a).text());e=parseFloat($(".TD-"+currentTHCol,b).text());break;case "bool":c=parseFloat($(".TD-"+currentTHCol,a).children().attr("data-sort-value"));e=parseFloat($(".TD-"+currentTHCol,b).children().attr("data-sort-value"));break;
case "date":c=Date.parse($(".TD-"+currentTHCol,a).text());e=Date.parse($(".TD-"+currentTHCol,b).text());break;default:c=$(".TD-"+currentTHCol,a).text().toLowerCase(),e=$(".TD-"+currentTHCol,b).text().toLowerCase()}return"asc"==setSort[currentTHCol].sort?c>e?1:c<e?-1:0:c<e?1:c>e?-1:0});$.each($rows,function(a,b){$("#crestResultsTable").children("tbody").append(b)})}
$("#resultsContainer").on("click","table thead tr .crestTH",function(a){a.stopPropagation();currentTH=$(this);currentTHCol=currentTH.attr("data-col-name");currentTHType=currentTH.attr("data-sort-type");a=currentTH.position();var b=currentTH.width(),b=a.left+(b-200)/2;0>b?b=10:b>windowWidth-200&&(b=windowWidth-210);$("#sortBox").stop(!0,!1).css({top:a.top+50,left:b});$(".crestTH_selected").removeClass("crestTH_selected");currentTH.addClass("crestTH_selected");$(".sortTop").removeClass("sortSelected");
$("#sortLower").html("");setSort[currentTHCol]?setSort[currentTHCol].sort&&$(".sortTop[data-sort='"+setSort[currentTHCol].sort+"'").addClass("sortSelected"):setSort[currentTHCol]={sortOrder:0,sort:"",filter:[]};var c=[];$(".crestTR").each(function(){var a=$.trim($(this).children(".TD-"+currentTHCol).text());-1===$.inArray(a,c)&&c.push(a)});c.sort();$("#sortLower").html('<ul class="sortOptions"></ul>');$.each(c,function(){-1!==$.inArray($.trim(this),setSort[currentTHCol].filter)?$(".sortOptions").append('<li class="sortOption sortOptionSelected">'+
$.trim(this)+"</li>"):$(".sortOptions").append('<li class="sortOption">'+$.trim(this)+"</li>")});currentTH.parent("tr").parent("thead").parent("table").hasClass("floatingHeader")?$("#sortBox").hasClass("sortFloat")||$("#sortBox").addClass("sortFloat"):$("#sortBox").hasClass("sortFloat")&&$("#sortBox").removeClass("sortFloat");$("#sortBox").stop(!0,!1).slideDown(200)});
function resetTable(){$(".crestTR").show();$(".crestTR").each(function(){var a=$(this);a.children("td").each(function(){var b=$(this),c=b.text(),b=b.attr("data-col-name");setSort[b]&&0<setSort[b].filter.length&&-1===$.inArray(c,setSort[b].filter)&&a.fadeOut(100)})})}function closeSort(){$("#sortBox").slideUp(200,function(){currentTH.removeClass("crestTH_selected")})}
$(".sortTop").click(function(){var a=$(this),b=a.attr("data-sort");a.hasClass("sortSelected")?(setSort[currentTHCol].sort="",a.removeClass("sortSelected")):(setSort[currentTHCol].sort=b,$(".sortTop").removeClass("sortSelected"),a.addClass("sortSelected"));fullCloseTRO();resortTable()});$("#sortLower").on("mouseenter",".sortOptions .sortOption",function(){var a=$(this);a.hasClass("sortOptionSelected")||a.addClass("sortOptionHover")});
$("#sortLower").on("mouseout",".sortOptions .sortOption",function(){var a=$(this);a.hasClass("sortOptionHover")&&a.removeClass("sortOptionHover")});
$("#sortLower").on("click",".sortOptions .sortOption",function(){var a=$(this),b=$.trim(a.text());-1!==$.inArray(b,setSort[currentTHCol].filter)?(a.removeClass("sortOptionSelected"),a=setSort[currentTHCol].filter.indexOf(b),setSort[currentTHCol].filter.splice(a,1)):(a.addClass("sortOptionSelected"),setSort[currentTHCol].filter.push(b));fullCloseTRO();resetTable()});$("#sortBox").click(function(a){$("#sortBox").stop(!0,!1);a.stopPropagation()});
$("#loadMoreButton").on("click",function(){showLoading();fullCloseTRO();var a=$(this).data("last-id"),b=$(this).data("search-id");$.getJSON("/crest/api.php?type=search&subType=next&id="+b+"&key="+a,function(a){for(i=0;i<a.list.length;i++){var b='<tr class="crestTR" data-segment-id="'+a.list[i].RecoveryKey+'" data-call-id="'+a.list[i].Variable2+'">';$("#crestResultsTable").children("thead").children("tr").children(".crestTH").each(function(){var f=$(this).attr("data-col-name"),d;switch(f){case "vCRMURL":d=
a.list[i][f]?'<a class="tableLink tableIcon filterSprite playCallActive" href="'+a.list[i][f]+'" title="Play Call in Impact360" target="_blank" data-sort-value="1"></a>':'<span class="tableIcon filterSprite playCallInactive" title="Call Unavailable" data-sort-value="0"></span>';break;case "HasScreen":d=a.list[i][f]?'<span class="tableLink filterSprite tableIcon screenShotActive" title="Screen Capture Available" data-sort-value="1"></span>':'<span class="tableIcon filterSprite screenShotInactive" title="No Screen Capture" data-sort-value="0"><span>';
break;case "iOCR":switch(a.list[i][f]){case 1:d='<a class="iocrExpLink" href="#" data-call-id="['+a.list[i].Variable2+","+a.list[i].BothVar2+']"><span class="tableLink filterSprite tableIcon callbackActive" title="Customer Called Back" data-sort-value="1"></span></a>';break;case 0:d='<span class="tableIcon filterSprite callbackInactive" title="Customer did not call back" data-sort-value="0"><span>';break;default:d=""}break;case "myVOCScore":d=a.list[i][f]?'<a class="tableLink" href="'+a.list[i].vocURL+
a.list[i].myVOC+'" title="'+a.list[i].vocSystemName+'" target="_blank">'+a.list[i][f]+"</a>":a.list[i][f]?'<span title="'+a.list[i].myVOCScore+'" >'+a.list[i][f]+"</span>":"";break;default:d=a.list[i][f]}b+='<td data-col-name="'+f+'" class="crestTD TD-'+f+'">'+$.trim(d)+"</td>"});$("#crestResultsTable tbody").append(b+"</tr>")}25>a.list.length&&$("#loadMore").fadeOut(200);var d=a.details.lastKey;$("#loadMoreButton").data("last-id",d);resortTable();resetTable();hideLoading();logAction("clickLoadMore",
"User clicked Load More button.")})});$("#goToSearchOptions").click(function(){showLoading();fullCloseTRO();closeSort();$("#resultsContainer").fadeOut(500,function(){$("#filtersContainer").fadeIn(500,function(){hideLoading()})});page="filters";return!1});var openSegmentID,openCallID,openTR,openPOS,openImpactURL;function closeTRO(){$("#TRbox").stop(!0,!1).fadeOut(500,function(){$("#TRlower").html("")})}function resizeTRO(){$("#TRbox").width($("#crestResultsTable").width())}
function fullCloseTRO(){$("#TRbox").stop(!0,!1).fadeOut(500,function(){$("#TRlower").html("");openTR&&openTR.removeClass("openTR")})}
function openTRO(){var a=openTR.width();openTR.height();openPOS=openTR.position();$("#TRupper").html("");$("#TRbox").css({width:a,top:openPOS.top+41,left:openPOS.left});$.getJSON("/crest/api.php?type=call&subType=snapshot&id="+openCallID,function(a){var c=0;for(i=0;i<a.list.length;i++){var e=Math.round(a.list[i].callLength/a.details.totalTime*100),c=c+e;100<c&&(e-=c-100);var d="";a.list[i].RecoveryKey==openSegmentID&&(d="snapShotSelected",a.list[i].vCRMURL&&(openImpactURL=a.list[i].vCRMURL,$("#TRupper").append('<span class="iocrExpSpan"><strong>Impact360 Link:</strong> <input class="impactCopy" type="text" value="'+
openImpactURL+'" readonly /></span>')));$("#TRlower").append('<div class="snapShotSegment '+d+'" style="width:'+e+'%;" data-segment-id="'+a.list[i].RecoveryKey+'">'+a.list[i].Name+"<br />"+e+"%</div>")}$("#TRupper").append('<a target="_blank" name="experience" href="/crest/experience/'+openCallID+'" class="fullExpLink">View full experience<span class="filterSprite icon arrowRight"></span></a>');$("#TRbox").stop(!0,!1).fadeIn(500,function(){hideLoading()});logAction("snapShotClick","User clicked on a snapshot.")})}
$(window).resize(function(){resizeTRO()});$("#TRupper").on("click",".iocrExpSpan .impactCopy",function(){$(this).select()});$("#crestResultsTable tbody").on("click",".crestTR",function(){$(this).hasClass("openTR")||(showLoading(),openTR=$(this),openSegmentID=openTR.data("segment-id"),openCallID=openTR.data("call-id"),$(".openTR").removeClass("openTR"),closeTRO(),openTR.addClass("openTR"),setTimeout(function(){openTRO()},600))});
$("#TRlower").on("mouseenter",".snapShotSegment",function(){$(this).hasClass("snapShotSelected")||$(this).addClass("snapShotHover")});$("#TRlower").on("mouseout",".snapShotSegment",function(){$(this).hasClass("snapShotSelected")||$(this).removeClass("snapShotHover")});
$("#TRlower").on("click",".snapShotSegment",function(){if(!$(this).hasClass("snapShotSelected")){var a=$(this).data("segment-id");$.ajax({url:"/crest/api.php?type=search&subType=snapshot&key="+a,dataType:"json",async:!1,success:function(a){a.reply="win";window.open("/crest/index/"+a.details.id)}})}});var possibleMatch={},pastSearches={};
function searchText(a){a=a.trim().split(/\s+/);var b=[],c=[];$.ajax({url:"/crest/script/unique-values.js",type:"GET",dataType:"script",async:!1,cache:!0});for(var e in uniqueValues.list){var d=uniqueValues.list[e];for(i=0;i<d.length;i++)for(ii=0;ii<a.length;ii++){var f=a[ii];-1===forbiddenWords.indexOf(f)&&-1!==d.indexOf(f)&&(possibleMatch[e]=f,unset(a[ii]))}}for(i=0;i<a.length;i++)f=a[i],e=a[i].match("/[0-9]/"),-1===forbiddenWords.indexOf(f)&&null!==e&&(e=e/f.length*100,50<e&&100!=e?(c.push(f),unset(a[i])):
50<e&&(b.push(f),unset(a[i])));possibleMatch.searchDates=c.toString();possibleMatch.searchNumbers=b.toString();possibleMatch.searchWords=a.toString()}$("#searchText").click(function(){showLoading();var a=$("#searchTextInput").val();searchText(a);$.ajax({url:"/crest/api.php?type=search&subType=text&text="+a,type:"POST",dataType:"json",async:!1,data:possibleMatch,success:function(a){a.reply="win";console.log(a);hideLoading()}});return!1});function decodeSlash(a){return a.replace("-sl-","/")}
function encodeSlash(a){return a.replace("/","-sl-")}function toTitleCase(a){return a.replace(/\w\S*/g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()})}
window.addEventListener("popstate",function(a){if(history.pushState){var b=decodeSlash(decodeURIComponent(a.state));if(a.state)$.ajax({url:"/crest/api.php?type=search&subType=id&id="+b,type:"GET",dataType:"json",data:$("#crestForm").serialize(),success:function(a){buildResults(a)},error:function(a){hideLoading();openLightbox("error");logAction("navigationError","User got an error when navigating")}});else return showLoading(),fullCloseTRO(),closeSort(),$("#resultsContainer").fadeOut(500,function(){$("#filtersContainer").fadeIn(500,
function(){hideLoading()})}),page="filters",!1}});
function buildResults(a){chageLoading("herding llamas...");if("win"==a.reply&&a.details.id&&a.list)if(chageLoading("Executing your search..."),0<a.list.length){history.pushState&&window.history.pushState(a.details.id,"Search","/crest/index/"+a.details.id);$("#crestResultsTable tbody").html("");for(i=0;i<a.list.length;i++){var b='<tr class="crestTR" data-segment-id="'+a.list[i].RecoveryKey+'" data-call-id="'+a.list[i].Variable2+'">';$(".crestTH").each(function(){var d=$(this).attr("data-col-name"),
c;switch(d){case "vCRMURL":c=a.list[i][d]?'<a class="tableLink tableIcon filterSprite playCallActive" href="'+a.list[i][d]+'" name="impact360" title="Play Call in Impact360" target="_blank" data-sort-value="1"></a>':'<span class="tableIcon filterSprite playCallInactive" title="Call Unavailable" data-sort-value="0"></span>';break;case "HasScreen":c=a.list[i][d]?'<span class="tableLink filterSprite tableIcon screenShotActive" title="Screen Capture Available" data-sort-value="1"></span>':'<span class="tableIcon filterSprite screenShotInactive" title="No Screen Capture" data-sort-value="0"><span>';
break;case "iOCR":switch(a.list[i][d]){case 1:c='<a class="iocrExpLink" href="#" name="iOCR" data-call-id="['+a.list[i].Variable2+","+a.list[i].BothVar2+']"><span class="tableLink filterSprite tableIcon callbackActive" title="Customer Called Back" data-sort-value="1"></span></a>';break;case 0:c='<span class="tableIcon filterSprite callbackInactive" title="Customer did not call back" data-sort-value="0"><span>';break;default:c=""}break;case "UnRREALScore":c=1==a.properties.qaLink?a.list[i][d]?'<a class="tableLink" href="'+
a.properties.qaURL+a.list[i].UnRREAL+'" title="Click to see call in '+a.properties.qaSystemName+'" target="_blank">'+a.list[i][d]+"</a>":"":a.list[i][d]?'<span title="'+a.list[i].UnRREAL+'" >'+a.list[i][d]+"</span>":"";break;case "myVOCScore":c=1==a.properties.vocLink&&a.list[i].myVOC?a.list[i][d]?'<a class="tableLink" href="'+a.properties.vocURL+a.list[i].myVOC+'" title="'+a.properties.vocSystemName+'" target="_blank">'+a.list[i][d]+"</a>":"":a.list[i][d]?'<span title="'+a.list[i].myVOCScore+'" >'+
a.list[i][d]+"</span>":"";break;default:c=a.list[i][d]}b+='<td data-col-name="'+d+'" class="crestTD TD-'+d+'">'+$.trim(c)+"</td>"});$("#crestResultsTable tbody").append(b+"</tr>")}var c=a.details.lastKey,e=a.details.id;$("#searchTitle").data("search-id",e);$("#loadMoreButton").data("last-id",c);$("#loadMoreButton").data("search-id",e);chageLoading("Showing your results...");$("#filtersContainer").fadeOut(500,function(){$("#resultsContainer").fadeIn(500,function(){0<$(window).scrollTop()&&$("html, body").animate({scrollTop:0},
"500","swing");hideLoading();page="results"})});25>a.list.length?$("#loadMore").fadeOut(200):$("#loadMore").fadeIn(200)}else hideLoading(),openLightbox("results");else hideLoading(),openLightbox("results")}
$(window).scroll(function(){"results"==page&&125<=$(window).scrollTop()?$(".floatingHeader")[0]||($("#resultsContainer").append('<table class="pageWidth floatingHeader"><thead>'+$("#crestResultsTable").children("thead").html()+"</thead></table>"),$("#crestResultsTable").children("thead").children("tr").children("th").each(function(){var a=$(this).data("col-name"),b=$(this).width();$(".floatingHeader").children("thead").children("tr").children(".TH-"+a).width(b)})):($(".floatingHeader").remove(),$("#sortBox").hasClass("sortFloat")&&
$("#sortBox").removeClass("sortFloat"))});$("#crestResultsTable tbody").on("click",".crestTR .crestTD .iocrExpLink",function(){var a=$(this).data("call-id");$.ajax({url:"/crest/api.php?type=search&subType=callBack&id="+a,dataType:"json",async:!1,success:function(a){a.reply="win";window.open("/crest/index/"+a.details.id)}});return!1});$(".filterRow").on("mousedown",".clearDate",function(a){a.stopPropagation();$(this).siblings(".date").val("");return!1});
$("#searchTitle").blur(function(){var a=$.trim($("#searchTitle").val()),b=$("#searchTitle").data("search-id");$.ajax({url:"/crest/api.php?type=search&subType=name",type:"POST",data:{name:a,id:b},dataType:"json",success:function(a){},error:function(){logAction("searchNameError","User got an error when trying to save a search name")}})});$(".filterRow").on("focus",".required",function(){$(this).hasClass("fail")&&$(this).removeClass("fail")});$("#crestForm").submit(function(){return!1});var hoverCount;
$(".filterBool").parent("span").hover(function(){var a=$(this).children(".filterBool"),b=a.parent("span").position();b.left-=75;clearTimeout(hoverCount);hoverCount=setTimeout(function(){toolTip(a,b)},2E3)},function(){clearTimeout(hoverCount);closeToolTip()});$("#crestForm").find(".input").keypress(function(a){if(13==a.which)return $(this).next().focus(),!1});


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th September 2017 - 01:19 AM