exhs = { init: function () { console.info("exhs :: init"); this.initialize(); this.categories(); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ categories: function () { console.info("exhs :: categories"); var url = this._conf._uri + "/api/res/exhs/" + this._conf._authKey + "/" + this._conf._eventKey + "/cats"; $("#exhs-" + this._conf._eventKey.toLowerCase() + "-data").attr("src", url); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ exhibitors: function (id) { console.info("exhs :: exhibitors"); var _this = this; $.each(this._eventInfo.categories, function (i, category) { if (category.id == id) { _this._eventInfo["category"] = category; } }); if (this._eventInfo.category.hasOwnProperty("exhibitors") && this._eventInfo.options.l2) { delete this._eventInfo.category.exhibitors; this.render("categories"); } else { var url = this._conf._uri + "/api/res/exhs/" + this._conf._authKey + "/" + this._conf._eventKey + "/cats/" + id; if (window.location.origin.indexOf("localhost") != -1) url = "data.html"; $("#exhs-" + this._conf._eventKey.toLowerCase() + "-data").attr("src", url); } }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ showDetail: function (id, scrollTo) { console.info("exhs :: showDetail"); var _this = this; $.each(_this._eventInfo.exhibitors, function (e, exh) { if (exh.id == id) { _this.detailContent(_this.renderFull(exh)); } }); if (scrollTo && false) { $(".exhs-overlay>div").animate({scrollTop: $('#' + scrollTo).offset().top - 25}, 1000) } }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ render: function (type) { console.info("exhs :: render :: " + type); switch (type) { case "exhibitors": var categoryId = this._eventInfo.category.id; var exhibitors = this._eventInfo.exhibitors; $.each(this._eventInfo.categories, function (i, category) { if (category.id == categoryId) category["exhibitors"] = exhibitors; }); break; default: //console.info(this._eventInfo[type]); } var html = ""; //--------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------- if (this._eventInfo.options.l2) { var columnGroups = [[[]], [[], []], [[], [], []]]; $.each(this._eventInfo.categories, function (i, category) { columnGroups[0][parseInt(i / $exhs._eventInfo.categories.length)].push(category); columnGroups[1][parseInt(i / ($exhs._eventInfo.categories.length / 2))].push(category); columnGroups[2][parseInt(i / ($exhs._eventInfo.categories.length / 3))].push(category); }); //console.info(columnGroups); $.each(columnGroups, function (i, columnGroup) { var columns = ""; $.each(columnGroup, function (j, column) { var categories = ""; $.each(column, function (k, category) { categories += "
" + " " + " " + " " + " " + " " + "
" + category.name.replaceAll(""", "\"") + "" + (!category.hasOwnProperty("exhibitors") ? "" : "") + "
" + $exhs.renderSummaries(category) + "
"; }); columns += "
" + categories + "
"; }); html += "
" + columns + "
"; }); } //--------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------- else { switch (type) { //--------------------------------------------------------------------------------------------------- case "categories": $.each(this._eventInfo.categories, function (i, category) { html += "
" + category.name.replaceAll(""", "\"") + "
"; }); html = "
" + html + "
"; break; //--------------------------------------------------------------------------------------------------- case "exhibitors": var categoryId = this._eventInfo.category.id; $.each(this._eventInfo.categories, function (i, category) { html += ""; }); html = ""; html += "
"; html += this.renderSummaries(this._eventInfo); break; //--------------------------------------------------------------------------------------------------- default: break; } } //--------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------- this.content(html); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ renderSummaries: function (owner) { if (owner.hasOwnProperty("exhibitors")) { var exhibitors = ""; $.each(owner.exhibitors, function (i, exhibitor) { exhibitors += $exhs.renderSummary(exhibitor); }); if ($exhs._eventInfo.options.c2) { exhibitors = ""; } return "
" + exhibitors + "
"; } return ""; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ renderSummary: function (exh) { console.info("exhs :: renderSummary"); var t = ""; if ($exhs._eventInfo.options.c2) { var url = (exh.url ? exh.url.trim() : (exh.urlFacebook ? exh.urlFacebook.trim() : (exh.urlInstagram ? exh.urlInstagram.trim() : null))); var name = (url ? "" + exh.name + "" : ""+exh.name+""); var incentive = (exh.specialOfferIncentive ? "
" : ""); var contact = (!url ? "
" + (exh.emailAddress ? "" : "") + (exh.phoneNumber ? "" : "") + (exh.mobilePhoneNumber ? "" : "") + "
" : ""); var links = (incentive.length != 0 || contact.length != 0?"
"+incentive + contact+"
":""); t += "
  • " + name + links + "
  • "; } else { var description = exh.description; if (description != null) { description = $exhs.unescape(description).replace(/<\/?[^>]+(>|$)/g, ""); var words = description.split(" "); if (words.length > 70) { description = words.slice(0, 50).join(" ") + " ... more

    "; } } t += "
    " + exh.name + "
    "; t += "
    "; t += (exh.emailAddress ? "" : ""); t += (exh.phoneNumber ? "" : ""); t += (exh.mobilePhoneNumber ? "" : ""); t += (exh.url ? "" : ""); t += (exh.urlFacebook ? "" : ""); t += (exh.urlInstagram ? "" : ""); t += (exh.exhibitorImages && exh.exhibitorImages.length != 0 ? "" : ""); t += (exh.specialOfferIncentive ? "" : ""); t += "
    "; t += (description != null ? "
    " + description + "
    " : ""); t += "
    "; t += (exh.weddingWire ? "WeddingWire Reviews" : ""); t += (exh.googleReviews ? "Google Reviews" : ""); t += "
    "; t = "
    " + t + "
    "; } return t; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ renderFull: function (exh) { console.info("exhs :: renderFull"); this.debug(exh); var _this = this; var t = ""; t += "
    " + exh.name + "
    "; t += "
    "; t += (exh.weddingWire ? "WeddingWire Reviews" : ""); t += (exh.googleReviews ? "Google Reviews" : ""); t += "
    "; t += "
    "; t += (exh.description ? "
    " + this.convertEmbedMedia(this.unescape(exh.description)) + "
    " : ""); t += (exh.specialOfferIncentive ? "
    SPECIAL OFFER INCENTIVE
    " + this.convertEmbedMedia(this.unescape(exh.specialOfferIncentive)) + "
    " : ""); t += ""; t += ""; if (exh.hasOwnProperty("streetAddress1")) { t += ""; } t += "
    "; t += (exh.emailAddress ? "" : ""); t += (exh.phoneNumber ? "" : ""); t += (exh.mobilePhoneNumber ? "" : ""); t += (exh.url ? "" : ""); t += (exh.urlFacebook ? "" : ""); t += (exh.urlInstagram ? "" : ""); t += "
    " + exh.streetAddress1 + ", " + (exh.streetAddress2 ? exh.streetAddress2 + ", " : "") + exh.city + ", " + exh.state + " " + exh.zip + "
    "; if (exh.exhibitorImages) { t += "
    "; $.each(exh.exhibitorImages, function (i, id) { t += _this.img(exh.id, id); }); t += "
    "; t += "
    "; } return t; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ unescape: function (html) { html = html.replace(/\&/gi, "&").replace(/\</gi, "<").replace(/\>/gi, ">"); return html; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ detailContent: function (html) { var fullId = "#exhs-" + $exhs._conf._eventKey.toLowerCase() + "-detail"; var overlayId = "#exhs-" + $exhs._conf._eventKey.toLowerCase() + "-overlay"; html = "
    " + html + "
    "; if ($(fullId).length != 0) { $(fullId).html(html); } else { $("body").append("
    " + html + "
    "); } $('html, body').css({overflow: 'hidden'}); }, hideOverlay: function () { var overlayId = "#exhs-" + $exhs._conf._eventKey.toLowerCase() + "-overlay"; $(overlayId).remove(); $('html, body').css({overflow: 'auto', height: 'auto'}); }, stopHideOverlay: function () { event.stopPropagation(); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ content: function (html) { $("#exhs-" + $exhs._conf._eventKey.toLowerCase()).html("
    " + html + "
    "); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ initialize: function () { console.info("exhs :: renderFull"); var options = {}; $.each(this._eventInfo.options, function (i, option) { options[option] = true; if (option.indexOf("l2") == 0) { options["l2"] = true; } }); this._eventInfo.options = options; //console.info(this._eventInfo); $("head").append(""); this.css(); $("body").append(""); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ data: function (type, data) { this._eventInfo[type] = data; this.render(type); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ img: function (eid, iid) { return ""; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ formatUSPhone: function (phonenumber) { if (phonenumber == null || phonenumber.trim().length == 0) return ""; phonenumber = phonenumber.match(/\d*/g).join('') if (phonenumber.length == 11) phonenumber = phonenumber.substring(1); var parts = phonenumber.match(/(\d{0,3})(\d{0,3})(\d{0,4})/).slice(1); return "(" + parts[0] + ") " + parts[1] + "-" + parts[2]; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ convertEmbedMedia: function (html) { const youTube = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&" \n<]+)(?:[^ \n<]+)?/g; const youTubeFull = /(https?:\/\/)?(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([^& \n<]+)(?:[^ \n<]+)?/g; html = this.convertEmbedMediaDo(html, youTube, youTubeFull, this.embedYouTube); var vimeo = /(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i var vimeoFull = /(https?:\/\/)?(www\.)?(vimeo\.com)\/(.*\/)?(?:.+)/g; html = this.convertEmbedMediaDo(html, vimeo, vimeoFull, this.embedVimeo); return html.replace(/


    <\/p>/gi, "").replace(/


    <\/p>/gi, ""); }, //############################################################################## //############################################################################## convertEmbedMediaDo: function (html, regex, fullreg, createEmbed) { if (!html) return html; const linkreg = /(?:)]+)>(.+?)<\/a>/g; let resultHtml = html; var placeholders = {}; const match = html.match(fullreg); if (match && match.length > 0) { const matchlinks = html.match(linkreg); if (matchlinks && matchlinks.length > 0) { for (var i = 0; i < matchlinks.length; i++) { placeholders["#placeholder" + i + "#"] = matchlinks[i]; resultHtml = resultHtml.replace(matchlinks[i], "#placeholder" + i + "#"); } } $.each(placeholders, function (placeholder, anchor) { let matchParts = anchor.split(regex); if (matchParts.length > 1) { resultHtml = resultHtml.replace(placeholder, createEmbed(matchParts[1])); } }); for (var i = 0; i < match.length; i++) { let matchParts = match[i].split(regex); resultHtml = resultHtml.replace(match[i], createEmbed(matchParts[1])); } if (matchlinks && matchlinks.length > 0) { for (var i = 0; i < matchlinks.length; i++) { resultHtml = resultHtml.replace("#placeholder" + i + "#", matchlinks[i]); } } } return resultHtml; }, //############################################################################## //############################################################################## embedYouTube: function (key) { return ""; }, //############################################################################## //############################################################################## embedVimeo: function (key) { return ""; }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ debug: function (json) { t = ""; $.each(json, function (key, value) { t += "" + key + "" + (value + "").replace(/<\/?[^>]+(>|$)/g, "") + "" }); $("#debug").html("" + t + "
    "); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ style: { ".exhs a": "color:inherit !important;font-size:inherit !important;", ".exhs img": "max-width:98%;margin:1px 1%;border-radius:4px;", ".exhs .fa": "font-size:120%;margin-right:7px;width:15px;text-align:center;", ".exhs, .exhs *": "font-size:12px;color:#666;", ".exhs hr": "border:none;border-bottom:1px solid #eee;margin:10px;", ".exhs .exh-category-list>div": "font-size:100%;padding:7px;border:1px solid #ddd;margin-bottom:-1px;cursor:pointer;", ".exhs .exh-category-list>div:first-child": "border-radius:4px 4px 0 0;", ".exhs .exh-category-list>div:last-child": "border-radius:0 0 4px 4px;", ".exhs .exh-category-list>div table": "width:100%;", ".exhs .exh-category-list>div table tr td": "vertical-align:middle;text-align:center;", ".exhs .exh-category-list>div table tr td:last-child": "width:20px;display:none;", ".exhs .exh-columns": "border:none;padding:0px;margin:0px;", ".exhs .exh-columns > div": "display:inline-block;vertical-align:top;", ".exhs .exh-columns.exh-columns-1": "display:none;", ".exhs .exh-columns.exh-columns-2": "display:none;", ".exhs .exh-columns.exh-columns-3": "display:none;", ".exhs .exh-columns.exh-columns-1.exh-columns-co1": "display:block;", ".exhs .exh-columns.exh-columns-2.exh-columns-co2": "display:block;", ".exhs .exh-columns.exh-columns-3.exh-columns-co3": "display:block;", ".exhs .exh-columns.exh-columns-1 > div": "width:100%;min-width:100%;", ".exhs .exh-columns.exh-columns-2 > div": "width:50%;", ".exhs .exh-columns.exh-columns-3 > div": "width:33.3%;", ".exhs .exh-category-list.exh-category-list-l2 i.fa": "margin-right:0px;font-size:160%;opacity:.4;", ".exhs .exh-category-list.exh-category-list-l2 > div": "padding:0px;margin:10px;border-radius:1px !important;background-color:rgba(200,200,200,.25);border:none;", ".exhs .exh-category-list.exh-category-list-l2 > div table tr td": "text-transform: uppercase;text-align:left;padding:5px 10px;word-break:break-word;", ".exhs .exh-category-list.exh-category-list-l2 > div table tr td:last-child": "display:table-cell;text-align:center;padding:5px 7px 5px 0px;", ".exhs .exh-category-list.exh-category-list-l2 > div > div.exh-category-exhibitors": "padding:10px;border-top:2px solid #ccc;", ".exhs .exh-category-list.exh-category-list-l2 > div > div.exh-category-exhibitors ul": "margin:0px 0px 0px 15px;padding:0px;", ".exhs .exh-category-list.exh-category-list-l2 > div > div.exh-category-exhibitors li": "padding:4px;list-style:circle;", ".exhs .exh-category-list.exh-category-list-l2 > div > div.exh-category-exhibitors a": "text-decoration:none;", ".exhs .exh-category-list.exh-category-list-l2 > div > div.exh-category-exhibitors i.fa": "font-size:100%;", ".exhs .exh-category-select": "border-radius:4px;font-size:110%;padding:7px;text-align:center; width:100%;border:1px solid #ddd;", ".exhs .exh-category": "font-size:150%;margin-top:20px;margin-bottom:5px;", ".exhs .exh-category:first-child": "margin-top:0px;", ".exhs .exh-name": "font-size: 120%;font-weight:bold;", ".exhs .exh-description": "opacity:.75;margin-left: 20px;margin:5px 0px 10px 10px;", ".exhs .exh-description,.exhs .exh-description p ": "font-size: 100%;", ".exhs .exh-description p ": "margin:12px 0;", ".exhs .exh-description * br:first-child": "display:none;", ".exhs .exh-description h1, .exhs .exh-description h2,.exhs .exh-description h3,.exhs .exh-description h4,.exhs .exh-description h5": "margin:10px 0;font-size:115%;", ".exhs .exh-special-offer": "margin:25px 0;border-top:1px solid #bbb;border-bottom:1px solid #bbb;padding:15px 20px 5px 20px;", ".exhs .exh-special-offer .exh-heading": "font-size:160%;margin-bottom:20px;", ".exhs .exh-media": "width:491px;height:240px;max-width:100%;max-height:20%;border:0px;", ".exhs .exh-contact": "margin:15px auto;width:90%;", ".exhs .exh-contact tr td": "font-size:90%;vertical-align:top;", ".exhs .exh-contact-inline .fa": "font-size:100%;margin:2px;opacity:.75;", ".exhs .exh-reviews-inline": "text-align:center;margin-top:5px;", ".exhs .exh-reviews-inline .exh-review": "margin:0 10px;opacity:.60;font-style:italic;font-size:90% !important;", ".exhs .exh-contactrow": "margin-bottom:3px;font-size:100%;", ".exhs .exh-address": "margin-top:15px;font-size:90%;padding-top:10px;", ".exhs .exh-more": "font-size:90%;margin-left:10px;", ".exhs .exh-fa": "margin-bottom:3px;font-size:120%;cursor:pointer;", ".exhs-overlay": "background:rgba(100,100,100,.5);width:100%;height:100%;z-index:999 !important;top:0;left:0;position:fixed;", ".exhs-overlay>div": "border-radius: 6px;width:600px;max-width: 98%;background-color:#fff;margin:5% auto;overflow-y: auto;max-height:90%;border:1px solid #aaa;", ".exhs-overlay .exh-content": "", ".exhs-overlay .exh-name": "font-size:170%;padding-bottom:5px;", ".exhs-overlay .exh-description": "padding-left:10px;padding-right:10px;", ".exhs-overlay .exh-images img": "width:98%", "@media only screen and (min-width: 850px)": ".exhs .exh-columns.exh-columns-3 {display:block;} .exhs .exh-columns.exh-columns-3.exh-columns-co1 {display:none;} .exhs .exh-columns.exh-columns-3.exh-columns-co2 {display:none;}", "@media only screen and (min-width: 550px) and (max-width: 850px)": ".exhs .exh-columns.exh-columns-2 {display:block;} .exhs .exh-columns.exh-columns-2.exh-columns-co1 {display:none;} .exhs .exh-columns.exh-columns-2.exh-columns-co3 {display:none;}", "@media only screen and (max-width: 550px)": ".exhs .exh-columns.exh-columns-1 {display:block;} .exhs .exh-columns.exh-columns-1.exh-columns-co2 {display:none;} .exhs .exh-columns.exh-columns-1.exh-columns-co3 {display:none;}" }, css: function () { var css = ""; $.each(this.style, function (k, v) { css += k + "{" + v + "} "; }); $("").appendTo("head"); }, //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------ _eventInfo: { "zip": "35173", "country": "United States", "city": "Trussville", "endDate": "2024-08-04 18:00:59.0", "eventMapFile": false, "storeKey": "trussville-birmingham-8-4-24-pink-bride-wedding-show", "streetAddress1": "5381 Trussville Clay Road", "endDateTz": "-06", "eventScheduleFile": false, "virtualShow": false, "url": "https://www.thepinkbride.com", "eventMapAssignmentsFile": false, "startDateTz": "-06", "options": [], "name": "Trussville/Birmingham 8_4_24 Pink Bride Wedding Show", "producer": { "zip": "37930", "country": "United States", "city": "Knoxville", "contactName": "Fred Jacob", "companyName": "Jacob Marketing Inc dba The Pink Bride", "streetAddress1": "PO Box 31568", "url": "http://www.ThePinkBride.com", "emailAddress": "fred@thepinkbride.com", "phoneNumber": "18653106875", "producerLogoImage": true, "name": "The Pink Bride", "id": 101, "state": "TN" }, "id": 1631, "state": "AL", "startDate": "2024-08-04 14:00:00.0" }, _conf: { _uri:"https://www.bridescan.com", _authKey:"jmi", _eventKey:"birm" } }; $(function (){eval("window.$exhs = exhs").init();}); window.addEventListener("message", function (event) { //console.info(event); if (typeof event.data === "string") { //console.info(event.data); var parts = event.data.split("::"); //console.info(parts); if (parts.length == 2) { var type = parts[0]; var data = JSON.parse(parts[1]); $exhs.data(type, data); } } });