-->
`;
const embedded = createRawHtml(rawHtml);
embedded.appendChild(appendScript("https://platform.twitter.com/widgets.js"));
return embedded;
}
function processSingleContentElement(contentElement) {
switch (contentElement.displayType) {
case 'section': return contentElement.elements.map(it => processSingleContentElement(it));
case 'paragraph': return createSimpleTextElement(contentElement.text);
case 'header': return createSimpleTextElement(contentElement.text, 'h' + contentElement.level);
case 'image': return createImage(contentElement);
case 'twitter': return createTwitter(contentElement);
case 'youtube': return createYoutube(contentElement);
default: return createSimpleTextElement(JSON.stringify(contentElement));
}
}
function fillContentIntoElement(createdElement, htmlEl) {
try {
console.log(createdElement, htmlEl);
if (createdElement.length) {
createdElement.forEach(ch => htmlEl.appendChild(ch));
} else {
htmlEl.appendChild(createdElement);
}
} catch (e) {
console.error(e.message);
}
}
function fillContent(contentElementsList, htmlElements) {
const contentElements = Array.from(contentElementsList);
console.log(contentElements);
const lastElementIndex = htmlElements.length - 1;
htmlElements.forEach((htmlEl, index) => {
htmlEl.innerHTML = '';
if(contentElements.length > index) {
if(index === lastElementIndex) {
contentElements.slice(index).forEach(ce => fillContentIntoElement(processSingleContentElement(ce),htmlEl))
} else {
const createdElement = processSingleContentElement(contentElements[index]);
fillContentIntoElement(createdElement, htmlEl);
}
}
});
}
function createSlides(slides) {
const templateWrapper = document.getElementById('slide-template');
const template = templateWrapper.content.querySelector(".slide-template");
return slides.map((it, index) => {
const cloned = template.cloneNode(true);
const contentPlaceholders = cloned.querySelectorAll(".content-placeholder");
fillContent(it.elements, contentPlaceholders)
if (infiniteLayout) {
cloned.querySelectorAll(".adslot").forEach(slot => {
slot.id = slot.id + '_' + index;
});
}
return cloned;
});
}
var slides = [{"elements":[{"text":"At the moment when he proposed and the ring fell in the water, everyone was speechless - even people who were simply watching from the sidelines.","level":3,"displayType":"header"},{"elements":[{"text":"Lots of things can go wrong during a proposal, the worst of which being that the person says no. However, this comes in as a pretty close second. Matthew Picca surprised his girlfriend Kayla Harrity with a proposal while they were on vacation. While they were enjoying the view from a seaside restaurant dock, Matthew got down on one knee. **When he opened the ring box, the ring rolled out and through a crack in the dock, into the water below**. The thought of it is enough to make you nauseous, but luckily, Matthew didn't let the moment derail his entire plan. With a little help from observers, he was able to make the proposal happen - and it was even better than both of them could have hoped for.","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/5317cde7-72d0-3510-bc70-c41d03c7f8d8.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Before Kayla knew it, several people were in the water looking for the ring.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/2147036d-91dd-334e-92e9-29dcffb1de47.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Matthew used the flashlight on his phone, sticking it into the water (ruining it entirely) to illuminate the murky sea floor. It took ten flashlights, five pairs of goggles, and over an hour of searching in the water, but the ring was finally found.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/997b1de7-f0d9-3f95-9af3-4edab5c7b567.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Of course, then came the most important part of the day.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/2137dec0-77a9-3bb3-bacd-1610d629622a.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"Naturally, Kayla said yes.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/a8f46822-e1cc-3dbe-906f-014de490f6ef.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"The happy couple thanked everyone who helped, and were met with cheers from the crowd when they were finally able to seal the deal.","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/fe096c7d-1463-3998-a5bb-59751b4858f0.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]},{"elements":[{"text":"And while the experience must have been incredibly stressful, in the end, it made the proposal even more meaningful. \"It was the best feeling in the world,\" Kayla said. \"My fiancé, soaking wet, smelling like salty fishing water, proceeded to get down on one knee and put the beautiful ring on my finger!\"","level":3,"displayType":"header"},{"elements":[{"text":"","level":0,"displayType":"paragraph"}],"displayType":"section"},{"imageUrl":"/static/02e4b5e0-4b53-31a9-8b24-5dfa12d00d58.jpeg","caption":"Kayla Harrity","displayType":"image"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]}];
var slide_index = parseInt(0);
var slide_json = createSlides(slides);
var initial_slide = slide_index;
var initial_url = location.pathname + location.search;
var base_url = '/awry-proposal';
var next_gallery = '/bird-panhandling';
var first_load = true;
var has_scrolled = false;
var title = "This Guy's Proposal Went The Worst Way Possible, And It Wasn't From Her Saying "No." LOL!";
var path = base_url
var utm_campaign, utm_subid, utm_source, utm_content, utm_term = 'n/a';
// try {
// var url = new URL(window.location.href);
// utm_campaign = encodeURIComponent(url.searchParams.get("utm_campaign"));
// utm_source = encodeURIComponent(url.searchParams.get("utm_source"));
// utm_content = encodeURIComponent(url.searchParams.get("utm_content"));
// utm_term = encodeURIComponent(url.searchParams.get("utm_term"));
// utm_medium = encodeURIComponent(url.searchParams.get("utm_medium"));
// if (utm_content && utm_campaign){
// var googletag = googletag || {};
// googletag.cmd = googletag.cmd || [];
// googletag.cmd.push(function() {
// googletag.pubads().setTargeting("utm_subid", utm_term);
// googletag.pubads().setTargeting("utm_subid_c", utm_campaign);
// });
// }
// } catch (e) {
// }