"; var known = ["ubereats","asap","doordash","cakes","pickup","grubhub","postmates","favor","waitrapp","seamless"]; var duplicates =[]; var aln = links.split("~"); console.log(aln); if (links.indexOf("seamless") > -1){ console.log("seamless"); } aln.map((l) => { if (l != ''){ l = l.trim(); l = (l.indexOf("cakes") > -1) ? "https://www.dairyqueen.com/en-us/cakes/order/" : l; var linkTo = (l.indexOf("http") < 0) ? ("https://"+l).trim() : l.trim(); var linkParts = (linkTo.split("http")); if (linkParts.length > 2){ l = "http" + linkParts[1]; } var lnk = l.split("//").pop(); lnk = lnk.split("www.").pop(); var lnkparts = lnk.split("."); lnk = lnkparts.shift(); domain = lnk + "." + lnkparts.shift().split("/").shift(); lnk = (lnk.indexOf("grubhub") > -1) ? "grubhub" : lnk; lnk = (lnk.indexOf("restaurant") > -1) ? "grubhub" : lnk; lnk = (linkTo.indexOf("cakes") > -1) ? "cakes" : lnk; lnk = (lnk.indexOf("waitrapp") > -1) ? "asap" : lnk; lnk = (lnk.indexOf("asap") > -1) ? "asap" : lnk; lnk = (lnk.indexOf("go") > -1) ? "asap" : lnk; lnk = (lnk.indexOf("favordelivery") > -1) ? "favor" : lnk; lnk = (lnk.indexOf("pickup") > -1) ? "pickup" : lnk; lnk = (lnk.indexOf("dqtexas") > -1) ? "pickup" : lnk; lnk = (known.indexOf(lnk) >-1) ? lnk : 'order-unknown'; lnk = (linkTo.indexOf("grubhub") > -1) ? "grubhub" : lnk; lnk = (lnk.indexOf("seamless") > -1) ? false : lnk; total = (lnk && lnk != '' && linkTo.indexOf("ordering.app") < 0) ? total+1 : total; inclusion = (lnk && lnk != '' && linkTo.indexOf("ordering.app") < 0) ? true : false; inclusion = (duplicates.indexOf(lnk) < 0 && lnk != 'order-unknown') ? inclusion : (lnk != "order" && lnk != "order-unknown") ? false : inclusion; if (inclusion){ duplicates.push(lnk); if (lnk.indexOf("cakes") > -1){cakelink = [linkTo,lnk,domain];}else{ if (lnk.indexOf("pickup") > -1 || lnk.indexOf("dqtexas") > -1){ sorted.unshift([linkTo,lnk,domain]); }else{ sorted.push([linkTo,lnk,domain]); } } } }}); if (cakelink){ sorted.push(cakelink); } var cls = "full-or-" + total; sorted.map((l) => { var dm = l.pop(); var lnk = l.pop(); var linkTo = l.pop(); var unknown = (lnk == 'order-unknown') ? "
"+dm+"
" : ""; linkContent += (lnk && lnk == 'order-unknown') ? "
" + unknown + "" : (lnk && lnk != '' && lnk.indexOf("ordering.app") < 0) ? "
" + unknown + "" : linkContent; }) jQuery("body").append("
GET YOUR ORDER GOING
Nobody but DQ® makes delivery or pickup this easy.
"+linkContent+"
"+footerButtons+"
"); } function runLoadingCheck(){ } function mapChange(x){ if (x.className === "link-list"){ jQuery("#wpsl-gmap").css("visibility","hidden"); jQuery("#wpsl-gmap").css("position","absolute"); }else{ jQuery("#wpsl-gmap").css("visibility","visible"); jQuery("#wpsl-gmap").css("position","relative"); } } var control = 0; var locs = []; var allurls = []; var storePull = false; var scrollPost = 0; var PC = []; var allStores = false; jQuery('#wpsl-search-input').attr('placeholder','City and State, or Zip Code'); jQuery(document).ready(function(){ jQuery("body").keydown(function(e){ if(e.key === "Escape") { removeDelivery(); } }) jQuery('#wpsl-search-input').keydown(function(){ if (jQuery('.pac-item').attr("class")){ jQuery('.pac-item').each(function(){ if (jQuery(this).hasClass("handled")){ }else{ jQuery(this).addClass("handled"); console.log(jQuery(this).attr("class")); jQuery(this).find("span").mousedown(function(){ jQuery("#wpsl-search-btn").trigger("click"); }) } }); } }); if (jQuery(".wpsl-search-btn-wrap").attr("class")){ jQuery(document).on('submit','form',function(e){ runLoadingCheck(); }) } jQuery(".icon-label").click(function(){ var cpar = jQuery(this).parent(); var cid = cpar.attr("class"); jQuery(".icon-label").each(function(){ var par = jQuery(this).parent(); var pid = par.attr("class"); if (pid != cid){ if (par.find("ul")){ par.find("ul").fadeOut("slow"); par.removeClass("exists"); par.find("hr").css("display","block"); } }else{ if (jQuery("."+pid+" ul").css("display")){ par.find("ul").fadeIn("slow"); if (par.hasClass("exists")){}else{ par.addClass("exists"); par.find("hr").css("display","none"); } } } }); }) if (jQuery("#wpsl-search-wrap").attr("id")){ jQuery("#wpsl-search-input").attr("placeholder","Enter a Location"); } if (jQuery("body").hasClass("page-id-45")){ jQuery("#wpsl-search-wrap").append("
") setTimeout(function(){ setAllHours(); },3000); } jQuery("#wpsl-stores").on("scroll",function(){ newScroll = jQuery(this).scrollTop(); var diff = (parseInt(newScroll) - parseInt(scrollPost)); if (diff > 1000){ setAllHours(); scrollPost = newScroll; } }) if (jQuery("body").hasClass("single-wpsl_stores")){ jQuery("#wpsl-search-btn").click(function(e){ e.preventDefault(); var val = jQuery("#wpsl-search-input").val(); window.location = "/store-locator/?wpsl-search-input="+val; return false; }) var sid = jQuery("#sid").val(); var jqxhr = jQuery.get( "https://dqtexas.com/_compiledStores.json", function(als) { allStores = JSON.parse(als); storePull = true; if (allStores && allStores[sid]){ var resp = allStores[sid]; for (var lm in resp){ if (resp.hasOwnProperty(lm)){ var vl = (resp[lm] == null)?"":resp[lm]; resp[lm] = vl; } } } setHours(resp); setAddress(resp); setPhone(resp); var domain_from_url = function(url) { var result var match if (match = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n\?\=]+)/im)) { result = match[1] if (match = result.match(/^[^\.]+\.(.+\..+)$/)) { result = match[1] } } return (result.indexOf("bit.ly") > -1)?"doordash.com":(result.indexOf("menus.fyi") > -1)?"grubhub.com":result; } var applyOffer = function(label,check){ if (check){ jQuery(".offers").append(""+label+"
"); }else{ jQuery(".offers").append(""+label+"
"); } } if (resp){ for (var p in resp){ resp[p] = (resp[p] == null)?"":resp[p]; var vl = resp[p]; vl = (typeof vl == 'boolean' && vl) ? "yes" : (typeof vl == 'boolean') ? "no" : vl; p = p.replace(/[^a-zA-Z0-9_\s]/g,""); p = (p.indexOf(" ") > -1)?p.replace(/\s/g,"_"):p; var cakeIcon, kidsWelcome , highChairs , wifi , catering , playArea , alcohol , allUCanEat , coffee , halal , childrensMenu , vegetarian , cashOnly , menuLink , orderLink , delivery , curbside , dineIn , driveThru , outDoor , takeout; kidsWelcome = (p.toLowerCase().indexOf("kids_welcome") > -1 && vl.toLowerCase() == 'yes')?true:kidsWelcome; highChairs = (p.toLowerCase().indexOf("high_chairs") > -1 && vl.toLowerCase() == 'yes')?true:highChairs; wifi = (p.toLowerCase().indexOf("wi_fi") > -1 && vl.toLowerCase() == 'yes')?true:wifi; cakeIcon = (p.toLowerCase().indexOf("icecreamshop") > -1 && (vl==="TRUE"))?true:cakeIcon; catering = (p.toLowerCase().indexOf("catering") > -1 && vl.toLowerCase() == 'yes')?true:catering; playArea = (p.toLowerCase().indexOf("play_area") > -1 && vl.toLowerCase() == 'yes')?true:playArea; alcohol = (p.toLowerCase().indexOf("alcohol") > -1 && vl.toLowerCase() == 'yes')?true:alcohol; allUCanEat = (p.toLowerCase().indexOf("all_you_can_eat") > -1 && vl.toLowerCase() == 'yes')?true:allUCanEat; coffee = (p.toLowerCase().indexOf("serves_coffee") > -1 && vl.toLowerCase() == 'yes')?true:coffee; halal = (p.toLowerCase().indexOf("halal") > -1 && vl.toLowerCase() == 'yes')?true:halal; childrensMenu = (p.toLowerCase().indexOf("childrens_menu") > -1 && vl.toLowerCase() == 'yes')?true:childrensMenu; vegetarian = (p.toLowerCase().indexOf("vegitarian") > -1 && vl.toLowerCase() == 'yes')?true:vegetarian; cashOnly = (p.toLowerCase().indexOf("cash_only") > -1 && vl.toLowerCase() == 'yes')?true:cashOnly; menuLink = (p.toLowerCase().indexOf("menu_link") > -1 && vl.toLowerCase() != '')?vl:menuLink; orderLink = (p.toLowerCase().indexOf("delivery") > -1 && resp.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead && resp.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead != "")?(resp.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead+"~").split("~"):orderLink; delivery = (p.toLowerCase().indexOf("service_options_delivery_has_delivery") > -1 && (vl.toLowerCase() == 'yes' || vl == "y"))?true:delivery; curbside = (p.toLowerCase().indexOf("curbside") > -1 && (vl.toLowerCase() == 'yes' || vl == "y"))?true:curbside; dineIn = (p.toLowerCase().indexOf("dine_in") > -1 && (vl.toLowerCase() == 'yes' || vl == ""))?true:dineIn; driveThru = (p.toLowerCase().indexOf("drive_through") > -1 && (vl.toLowerCase() == 'yes' || vl == ""))?true:driveThru; outDoor = (p.toLowerCase().indexOf("seating_outdoors") > -1 && (vl.toLowerCase() == 'yes' || vl == "y"))?true:outDoor; takeout = (p.toLowerCase().indexOf("same_day") > -1 && (vl.toLowerCase() == 'yes' || vl == "y"))?true:takeout; curbside = (orderLink)?true:curbside; delivery = (orderLink)?true:delivery; takeout = (orderLink)?true:takeout; } var ap = false; var devLinks = [] //"+adr["Locality"]+", "+adr["Administrative area"]+" "+z[0]); jQuery(".region").html(", "+adr["Administrative area"]); jQuery(".region-sm").html(adr["Administrative area"]); jQuery(".locality-sm").html(adr["Locality"]); jQuery(".address-sm").html(adr["Address line 1"] + " " + adr["Address line 2"]); } function setPhone(str){ jQuery(".phone-text").html('
'+str["Primary phone"]+''); } function setAllHours(obj){ control = 0; var perc = 20; var inflectDirections = function(xar){ var ret = []; for (var g of xar){ g = g.replace(/north /g,"n"); g = g.replace(/south /g,"s"); g = g.replace(/east /g,"e"); g = g.replace(/west /g,"w"); ret.push(g); } return ret; } var inflectStreets = function(xar){ var ret = []; for (var g of xar){ g = g.replace(/street /g,"st"); g = g.replace(/road /g,"rd"); g = g.replace(/farmers market/g,"fm"); g = g.replace(/drive /g,"dr"); g = g.replace(/avenue /g,"ave"); ret.push(g); } return ret; } var inflectHighways = function(xar){ var ret = []; for (var g of xar){ g = g.replace(/highway /g,"hwy"); g = g.replace(/hw /g,"hwy"); g = g.replace(/high way market/g,"hwy"); g = g.replace(/interstate /g,"i"); ret.push(g); } return ret; } var isAddressMatch = function(a,b){ a = a.replace(/[^A-Za-z0-9\s!?]/g,'').toLowerCase(); var prms = a.replace(/[^A-Za-z0-9\s!?]/g,'').toLowerCase(); var ar = a.split(" "); var b = b.replace(/[^A-Za-z0-9\s!?]/g,'').toLowerCase().split(" "); var firstA = ar[0]; var firstB = b[0]; b.pop(); b.pop(); b.pop(); b = b.join(" "); var abar = [a,b]; abar = inflectDirections(abar); abar = inflectStreets(abar); abar = inflectHighways(abar); a = abar[0]; b = abar[1]; a = a.replace(/[^A-Za-z0-9!?]/g,'').toLowerCase(); b = b.replace(/[^A-Za-z0-9!?]/g,'').toLowerCase(); let aParts = a.split(""); let bParts = b.split(""); let intersection = aParts.filter(x => bParts.includes(x)); var total = aParts.length; var sub = intersection.length; var newPerc = 100 - ((sub/total)*100); if (b.indexOf("southwestern") > -1){ // console.log("CHECKING---",b); } if (firstA == firstB){ if (a.indexOf("wilshire") > -1 && b.indexOf("wilshire") > -1){ } if (a.indexOf("prairie") > -1 && b.indexOf("prairie") > -1){ } } } /*NO ADDRESS MATCH 110 W. Southwestern (index):879 NO ADDRESS MATCH 2000 Long Prairie Rd. (index):879 NO ADDRESS MATCH 825 W. Main St (index):879 NO ADDRESS MATCH 1501 West Hebron Pkwy (index):879 NO ADDRESS MATCH 2421 Valwood Pkwy. (index):879 NO ADDRESS MATCH 1909 Justin Rd. (index):879 NO ADDRESS MATCH 3488 Rosemeade Parkway (index):879 NO ADDRESS MATCH 6360 N. Josey Lane (index):879 NO ADDRESS MATCH 14815 Coit Road (index):879 NO ADDRESS MATCH 2240 Coit Rd (index):879 NO ADDRESS MATCH 8855 Teel Parkway (index):879 NO ADDRESS MATCH 8890 Preston (index):879 NO ADDRESS MATCH 5441 Rufe Snow (index):879 NO ADDRESS MATCH 209 N. Loop 288 (index):879 NO ADDRESS MATCH 6445 Eastridge Dr (index):879 NO ADDRESS MATCH 508 W. Randol Mill Rd. (index):879 NO ADDRESS MATCH 2127 Fort Worth Ave. (index):879 NO ADDRESS MATCH 2425 Avenue "K" (index):879 NO ADDRESS MATCH 3110 W. University (index):879 NO ADDRESS MATCH 2424 W. Park Row Drive (index):879 NO ADDRESS MATCH 719 E. Main Street (index):879 NO ADDRESS MATCH 1926 South 1st Street (index):879 NO ADDRESS MATCH 607 S. Main (index):879 NO ADDRESS MATCH 8150 S. Polk */ if (!allStores && !storePull){ var jqxhr = jQuery.get("https://dqtexas.com/_compiledStores.json", function(obj) { // Check if obj is a string (indicating it needs to be parsed) if (typeof obj === 'string') { allStores = JSON.parse(obj); } else { allStores = obj; } //console.log(allStores);}); storePull = true; updateStores(); }else{ var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; var today = days[ new Date().getDay() ]; jQuery(".wspl-details").each(function(){ var noDev = true; var devLinks = false; var wsdetails = jQuery(this); var sid = jQuery(this).find(".wpsl-store-id").val(); if (!sid || isNaN(parseInt(sid))){ jQuery(this).parent().css("display","none"); }else{ if (sid == "-1"){ jQuery(this).parent().css("display","none"); } } /* var h = parseInt(jQuery(this).parent().find(".wpsl-directions").css("height").replace(/[^0-9?]/g,'')); h += (jQuery(this).parent().find(".wpsl-order").attr("class"))?parseInt(jQuery(this).parent().find(".wpsl-order").css("height").replace(/[^0-9?]/g,'')):0; console.log(h); jQuery(this).parent().find(".wspl-ctas").css("paddingTop","calc(50% - "+h+"px)");*/ jQuery(this).css("cursor","pointer"); var wpar = jQuery(this).parent(); var add = jQuery(this).find(".wpsl-street").html(); var hasLoc = false; var fa = false; var flat = "nolat"; var flng = "nolng"; perc = 20; var toRegularTime = (militaryTime) => { const [hours, minutes, seconds] = militaryTime.split(':'); return `${(hours > 12) ? hours - 12 : hours}:${minutes}${seconds ? `:${seconds}` : ''} ${(hours >= 12) ? 'PM' : 'AM'}`; } var ct = allStores[sid]; if (ct && ct["Address line 1"] && ct["Address line 1"].indexOf("825 W Main") > -1){ /*console.log(ct);*/ } if (ct && !isNaN(parseInt(sid))){ if (ct.delivery){ if (ct.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead){ if (ct.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead != "" && ct.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead != "no" && ct.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead != "No"){ noDev = false; devLinks = ct.delivery.Place_page_URLs_Order_ahead_links_url_order_ahead; } } } wpar.find(".wspl-ctas .wpsl-phone").remove(); if (ct["Primary phone"]){ wpar.find(".wspl-ctas").append(''); } for (var hr in ct){ if (ct.hasOwnProperty(hr)){ if (hr.indexOf(today) > -1){ if (ct[hr] && ct[hr] != null && ct[hr] != ""){ var miliParts = ct[hr].split("-"); jQuery(this).find(".open-today").remove(); jQuery(this).append("
Open: "+ toRegularTime(miliParts[0]) + " - " + toRegularTime(miliParts[1])); } } } } }else{ if (add.toLowerCase().indexOf("rosemeade") > -1){ jQuery(this).parent().css("display","none"); } } if ((!noDev || jQuery(this).parent().find(".wpsl-order").hasClass("hasApp")) && ct){ devLinks = (devLinks) ? devLinks : ""; jQuery(this).parent().find(".wpsl-order").removeAttr("href"); if (jQuery(this).parent().find(".wpsl-order").hasClass("bound")){}else{ devLinks = (jQuery(this).parent().find(".wpsl-order").hasClass("hasApp")) ? devLinks + "~"+jQuery("#orderUrl-"+sid).val() : devLinks; devLinks = (ct && ct.iceCreamShop) ? devLinks + "~" + 'https://www.dqcakes.com/#/home' : devLinks; /*console.log(devLinks,sid,jQuery("#orderUrl-"+sid).value);*/ jQuery(this).parent().find(".wpsl-order").click(function(){ deliveryWindow(devLinks); }) jQuery(this).parent().find(".wpsl-order").addClass("bound"); } jQuery(this).parent().find(".wpsl-order").removeClass("novis"); jQuery(this).parent().find(".wpsl-order").parent().removeClass("halfm"); } }) } } function setHours(obj){ var toRegularTime = (militaryTime) => { const [hours, minutes, seconds] = militaryTime.split(':'); return `${(hours > 12) ? hours - 12 : hours}:${minutes}${seconds ? `:${seconds}` : ''} ${(hours >= 12) ? 'PM' : 'AM'}`; } var smStart; var smEnd; var sm; var hasHours = false; var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; var pref = '
Location Hours
'; var str = '
* This location has limited dine in hours.
'; var hrs = {}; str = '
'+range+' | |
'+q+' |
'; }else{ str = '
* This location has limited dine in hours.
'; } jQuery(".hours").html(pref + str); } function loadSlick(x){ x += 250 if (x < 5000) { //check the limit setTimeout(function(){ if (jQuery('#sbi_images').attr("id") && jQuery('#sbi_images .sbi_item').attr("class")){ jQuery('#sbi_images').slick({ infinite: true, slidesToShow: 6 }); jQuery("#sbi_images,#sb_instagram, #sb_instagram #sbi_images").animate({ opacity:1 }, 2000, function() { // Animation complete. }); x = 10000; }else{ loadSlick(x); } }, 500); //substract 250 (because we already added 250 before the first print } } function loadQuery(x){ x += 250 if (x < 5000) { //check the limit setTimeout(function(){ if (wpsl){ jQuery("#wpsl-search-btn").trigger("click"); x = 10000; setTimeout(function(){ setAllHours(); },3000); }else{ loadQuery(x); } }, 500); //substract 250 (because we already added 250 before the first print } } function convertTime(hrs){ // fetch var hours = parseInt(hrs)/100; var minutes = 0; var seconds = 0; var timeValue; if (hours > 0 && hours <= 12) { timeValue= "" + hours; } else if (hours > 12) { timeValue= "" + (hours - 12); } else if (hours == 0) { timeValue= "12"; } timeValue += (minutes < 10) ? ":0" + minutes : ":" + minutes; // get minutes //timeValue += (seconds < 10) ? ":0" + seconds : ":" + seconds; // get seconds timeValue += (hours >= 12) ? " P.M." : " A.M."; // get AM/PM return timeValue; // show } window.onload = function(){ google.maps.event.addListener(NM, 'bounds_changed', function() { setAllHours(); }); }