function createElement(name, id, value, type) {
var input = document.createElement("input")
input.setAttribute("type", type)
input.setAttribute("name", name)
input.setAttribute("value", value)
input.setAttribute("id", id)
return input
}
// function setNativeValue(element, value) {
// var valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set;
// var prototype = Object.getPrototypeOf(element);
// var prototypeValueSetter = Object.getOwnPropertyDescriptor(
// prototype,
// 'value'
// ).set;
// if (valueSetter && valueSetter !== prototypeValueSetter) {
// prototypeValueSetter.call(element, value);
// } else {
// valueSetter.call(element, value);
// }
// }
// IE does not support the Event constructor. We need this fallback.
function createEvent(eventName, eventOptions) {
if (typeof Event === 'function') {
// This is a modern browser that supports the Event constructor.
return new Event(eventName, eventOptions)
} else {
// This is IE :(.
var event = document.createEvent('Event')
event.initEvent(eventName, eventOptions.bubbles, eventOptions.cancelable, eventOptions.detail)
return event
}
}
function getCookie(cname) {
const name = cname + '='
const ca = document.cookie.split(';')
for (let i = 0; i < ca.length; i++) {
let c = ca[i]
while (c.charAt(0) === ' ') {
c = c.substring(1)
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length)
}
}
return '';
}
/**
* options: {
* enableLogs: Boolean,
* intervalFrequency: Number,
* logIdentifier: String,
* maxIterations: Number,
* onSuccess: () => void,
* successCheck: () => Boolean,
* }
*/
function waitForX(options) {
var log = function log() {
if (options.enableLogs)
console.log.apply(console, arguments)
}
var logSuffix = options.logIdentifier ? ' -- [' + options.logIdentifier + ']' : ''
var intervalFrequency = options.intervalFrequency || 100
var maxIterations = options.maxIterations || 100
// Do 1 immediate check before the interval starts.
if (options.successCheck()) {
log('SUCCESS (immediate), no interval needed' + logSuffix)
options.onSuccess()
return;
}
log('every ' + intervalFrequency + 'ms, for ' + intervalFrequency * maxIterations + 'ms' + logSuffix)
var iterations = 0
var waitTimer = window.setInterval(function() {
if (options.successCheck.apply(options)) {
log('SUCCESS, waited: ' + ((iterations + 1) * intervalFrequency) + 'ms (' + (iterations + 1) + ' iterations)' + logSuffix)
options.onSuccess.apply(options)
window.clearInterval(waitTimer);
log('cleared interval' + logSuffix)
}
if (iterations >= maxIterations) {
log('TIMED OUT' + logSuffix)
// Safety net to ensure this interval won't run forever.
window.clearInterval(waitTimer)
log('cleared interval' + logSuffix)
}
iterations++
}, options.intervalFrequency)
}
if (data.page == 'contactInfo') {
console.log("Inside the contactInfo page")
waitForX({
enableLogs: true,
intervalFrequency: 50,
logIdentifier: 'LOGGING',
maxIterations: 20,
onSuccess: function() {
var inputs = [
{
element: $('#1557521510696001N5gM')[0],
value: getCookie('srcAACookie')
},
{
element: $('#1557521621200001NEx7')[0],
value: getCookie('srcIntAACookie')
},
{
element: $('#1557521556013001j9BK')[0],
value: getCookie('cidAACookie')
},
{
element: $('#1557521582125001NVVe')[0],
value: getCookie('cidIntAACookie')
}
];
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if (input.element) {
input.element.parentElement.style.display = 'none';
if (input.value) {
input.element.setAttribute('value', input.value);
input.element.dispatchEvent(createEvent('input', { bubbles: true }));
}
}
}
// var input;
// var $ID_ATTRIBUTE_NAME = ;
// console.log(1234, $ID_ATTRIBUTE_NAME);
// $ID_ATTRIBUTE_NAME.parent().css('display', 'none');
// var COOKIE_VALUE_ID = getCookie('cidIntAACookie');
// if (COOKIE_VALUE_ID) {
// input = $ID_ATTRIBUTE_NAME[0];
// if (input) {
// // setNativeValue(input, COOKIE_VALUE_ID);
// input.setAttribute('value', COOKIE_VALUE_ID);
// input.dispatchEvent(createEvent('input', { bubbles: true }));
// }
// }
},
successCheck: function () {
return document.querySelector('#myDynamicForm');
}
});
}
// LinkedIn Pixel Init Code
// ----- our code -----
// try to remove tracking scripts for linked in if they exist already on the page
var script1Id = 'rf-tracking-scripts-linked-in-1'
var script2Id = 'rf-tracking-scripts-linked-in-2'
var script1 = document.getElementById(script1Id)
var script2 = document.getElementById(script2Id)
// do script removal if elements exist
if (script1 !== null) {script1.parentNode.removeChild(script1);}
if (script2 !== null) {script2.parentNode.removeChild(script2);}
// ----- end our code -----
_linkedin_partner_id = "5314194";
window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
window._linkedin_data_partner_ids.push(_linkedin_partner_id);
(function(l) {
if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};
window.lintrk.q=[]}
var s = document.getElementsByTagName("script")[0];
var b = document.createElement("script");
b.type = "text/javascript";b.async = true;
b.src = 'https://snap.licdn.com/li.lms-analytics/insight.min.js';
s.parentNode.insertBefore(b, s);})(window.lintrk);
//End LinkedIn Pixel Init Code
var javascriptText = decodeURI('%3Cscript%20src=%22https://www.vmware.com/files/templates/inc/utag_data.js%22%3E%3C/script%3E') +
decodeURI('%3Cscript%20type=%22text/javascript%22%3E') +'utag_data.content_system="vmworld = rainfocus"'+ decodeURI('%3C/script%3E')
console.log('javascriptText', javascriptText)
if (postscribe) {
postscribe(document.head, javascriptText, {
done: function() {}
});
}
if (window.EventBus) {
window.EventBus.on('form:contactInfo:rendered', function () {
var dynamicForm = document.getElementById('myDynamicForm');
if (dynamicForm) {
// Adding this attribute to the form was an analytics request.
dynamicForm.setAttribute('name', 'form1');
}
});
}
window.utag_cfg_ovrd = {noview : true};
var page = data.page || ''
var pathname = document.location.pathname || ''
pathname = pathname.replace(/\//g, " : ")
var wtUtg;
function waitForUtag() {
if (typeof utag !== "undefined") {
clearTimeout(wtUtg);
utag.view({
tealium_event: 'page_view',
event_name: 'rf_' + page + '_page_view',
page_type: 'rf_' + page,
page_name: 'vmware : event ' + pathname,
},
function () {
utag.DB(' Rainfocus - ' + page + ' has been tracked')
})
}
else {
wtUtg = setTimeout(waitForUtag, 250);
}
}
try {
if (typeof utag !== "undefined") {
utag.view({
tealium_event: 'page_view',
event_name: 'rf_' + page + '_page_view',
page_type: 'rf_' + page,
page_name: 'vmware : event ' + pathname,
},
function () {
utag.DB(' Rainfocus - ' + page + ' has been tracked')
})
}
else {
waitForUtag();
}
} catch (e) {
console.log('ERR calling "utag.view"', e);
}
//Meta Pixel Init Code
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1239328756778971');
// noscript
//var noscriptElement = document.createElement("noscript");
//var imgElement = document.createElement("img");
//imgElement.setAttribute("src", "https://www.facebook.com/tr?id=1239328756778971&ev=PageView&noscript=1");
//imgElement.setAttribute("height", "1");
//imgElement.setAttribute("width", "1");
//imgElement.style.display = "none";
//noscriptElement.appendChild(imgElement);
//document.body.appendChild(noscriptElement);
//End Meta Pixel Init Code
fbq('track', 'PageView');
fbq('track', 'Lead');