function createReplayLabel() {
let li = document.createElement("li");
li.classList.add("hs-form-list-label");
let span = document.createElement("span");
span.textContent = "Regarder en arrière";
span.setAttribute("style", "font-weight:500;display:inline-block;margin-bottom:8px;");
li.appendChild(span);
return li;
}
function createListItem(index, value, text, startTime, location, broadcastId, broadcastTitle, replayUrl, adobewebinar, webinarUrl, date, dateDF, multiple, today) {
let li = document.createElement("li");
li.classList.add("hs-form-radio");
let label = document.createElement("label");
label.setAttribute("for", `label_${index}`);
label.setAttribute("style", "align-items: center;");
label.classList.add("hs-form-radio-display");
let input = document.createElement("input");
input.setAttribute("type", "checkbox");
if (!multiple) {
input.setAttribute("type", "radio");
}
if (!multiple || index === 0) {
input.setAttribute("checked", true);
}
input.setAttribute("id", `label_${index}`);
input.setAttribute("name", "marketinglist_number_webinar");
input.setAttribute("value", value);
input.setAttribute("data-time", startTime);
input.setAttribute("data-location", location);
input.setAttribute("data-broadcastid", broadcastId);
input.setAttribute("data-broadcasttitle", broadcastTitle);
input.setAttribute("data-replayurl", replayUrl);
input.setAttribute("data-adobewebinar", adobewebinar);
input.setAttribute("data-webinarurl", webinarUrl);
input.setAttribute("data-date", date);
input.setAttribute("data-datedf", dateDF);
input.classList.add("hs-input");
let span = document.createElement("span");
span.textContent = text;
if (Boolean(+today)) {
span.setAttribute("style", "display: flex;align-items: center;gap: 12px;height: 12px;overflow:visible");
const tag = document.createElement("span");
tag.className = "p-tag p-component p-tag-success mr-1";
tag.style.backgroundColor = "#20b065";
const tagValue = document.createElement("span");
tagValue.className = "p-tag-value";
tagValue.textContent = "aujourd'hui";
tag.appendChild(tagValue);
span.append(" ", tag);
}
label.appendChild(input);
label.appendChild(span);
li.appendChild(label);
return li;
}
hbspt.forms.create({
region: "eu1",
portalId: "143438306",
formId: "dbde6c23-bdcb-42e6-9b05-ea7b14ba43aa",
onFormSubmitted: () => {
trackForm();
let topPos = $(".hs-form-wrapper").offset().top - 180;
$('html, body').scrollTop(topPos);
},
onBeforeFormSubmit: function($form) {
let chosenInputs = Array.from($('input[name="marketinglist_number_webinar"]:checked'));
$('input[name="marketinglist_number_webinar"]').remove();
let formattedData = chosenInputs.reduce((ac,cu) => {
const data = { ...cu.dataset };
const keys = Object.keys(data);
keys.forEach((key) => (ac[key] = (!ac[key]) ? [data[key]] : [...ac[key], data[key]]));
return ac;
}, {});
let selectedMarketingListNumbers = chosenInputs.map((item) => item.value).join(',');
$('input[name="marketing_list_number"]').val(selectedMarketingListNumbers);
$('input[name="start_time"]').val(formattedData?.time?.join(','));
$('input[name="marketinglist_location"]').val(formattedData?.location?.join(','));
$('input[name="adobe_webinar"]').val(formattedData?.adobewebinar?.[0]);
$('input[name="marketinglist_date"]').val(formattedData?.date?.join(','));
$('input[name="marketinglist_date_df"]').val(formattedData?.datedf?.join(','));
if ((formattedData?.broadcastid || []).every(value => (typeof +value === 'number' && Boolean(value)))) {
$('input[name="broadcast_id_list"]').val(formattedData?.broadcastid?.join(','));
$('input[name="broadcast_title"]').val(formattedData?.broadcasttitle?.join(','));
$('input[name="webinar_url"]').val(formattedData?.webinarurl?.join(','));
$('input[name="webinargeek_broadcast_replay_urls"]').val(formattedData?.replayurl?.join(','));
} else {
$('input[name="download_link"]').val('ZMTCa8D_Bvw');
$('input[name="broadcast_id_list"]').val('x');
$('input[name="broadcast_title"]').val('Autodesk Construction Cloud | ISO 19650 compliant modelleren | Terugkijken');
$('input[name="webinar_url"]').val('x');
$('input[name="webinargeek_broadcast_replay_urls"]').val('x');
}
},
onFormReady: function($form, ctx) {
$('input[name="bu"]').val('CDC');
$('input[name="page_url"]').val('https://www.cadac.com/be-nl/events/bim-excelleren-2023-autodesk-construction-cloud-iso-19650-compliant-modelleren/');
$('input[name="pagename"]').val(`Autodesk Construction Cloud | ISO 19650 compliant modelleren | Terugkijken`);
$('input[name="campaign_description"]').val(`Autodesk Construction Cloud | ISO 19650 compliant modelleren | Terugkijken`);
$('input[name="campaign_code"]').val('CMP-02711-X0J0M');
$('input[name="ddlcountry"]').val('us');
$('input[name="weblead_type"]').val('Webinar registration');
let marketinglistElm = document.querySelector('.hs_marketinglist_number_webinar .inputs-list');
marketinglistElm.replaceChildren();
marketinglistElm.appendChild(createReplayLabel());
marketinglistElm.appendChild(createListItem(0, "ML156970","5 septembre 2023 10:00", "10:00", "Cadac TheModus | Verhoog de BIM Productiviteit", "", "", "", "False", "", "5 septembre 2023", "09/05/2023", 1, 0));
marketinglistElm.appendChild(createListItem(1, "ML156971","15 septembre 2023 14:00", "14:00", "Cadac Control | Behoud controle over data", "", "", "", "False", "", "15 septembre 2023", "09/15/2023", 1, 0));
marketinglistElm.appendChild(createListItem(2, "ML156972","19 septembre 2023 13:00", "13:00", "Cadac TheModus | Geef Modelleerwerk in Revit een Boost", "", "", "", "False", "", "19 septembre 2023", "09/19/2023", 1, 0));
marketinglistElm.appendChild(createListItem(3, "ML156973","6 octobre 2023 13:00", "13:00", "Cadac TheModus | Ontdek de Uniforme Objecten Bibliotheek", "", "", "", "False", "", "6 octobre 2023", "10/06/2023", 1, 0));
marketinglistElm.appendChild(createListItem(4, "ML156974","26 octobre 2023 13:30", "13:30", "Cadac TheModus | Snel & efficiënt elektrische installaties modelleren", "", "", "", "False", "", "26 octobre 2023", "10/26/2023", 1, 0));
marketinglistElm.appendChild(createListItem(5, "ML156975","7 novembre 2023 13:30", "13:30", "Cadac TheModus | Automatiseer elektrische meterkast schema's", "", "", "", "False", "", "7 novembre 2023", "11/07/2023", 1, 0));
marketinglistElm.appendChild(createListItem(6, "ML156976","21 novembre 2023 13:30", "13:30", "Cadac TheModus | Versnel het modelleren van leidingsystemen", "", "", "", "False", "", "21 novembre 2023", "11/21/2023", 1, 0));
marketinglistElm.appendChild(createListItem(7, "ML156977","7 décembre 2023 11:00", "11:00", "Autodesk Construction Cloud | ISO 19650-compliant modelleren", "", "", "", "False", "", "7 décembre 2023", "12/07/2023", 1, 0));
}
});