The Custom Companies, Inc.

The Custom Companies, Inc.

  • Post author:
  • Post category:Shipping

The Custom Companies, Inc. 10) { result = false; break; } } } else { result = false; } return result; }; if (injectedData && injectedData.authorFieldName) { appUrl += ‘&authorFieldName=’ + encodeURIComponent(injectedData.authorFieldName); console.log(logPrefix + ‘Form field overriden for author inference = ‘ + injectedData.authorFieldName); } if (injectedData && injectedData.formData) { if (validateInjectedData(injectedData.formData)) { appUrl += ‘&injectedFormData=’ + encodeURIComponent(JSON.stringify(injectedData.formData)); } else { if (typeof injectedData.validationErrorCallback === ‘function’) { injectedData.validationErrorCallback(); } else { console.log(logPrefix + ‘Could not invoke validationErrorCallback as it is not a function’); } } } var iframe = document.createElement(‘iframe’); iframe.setAttribute(‘sandbox’, ‘allow-scripts allow-same-origin allow-forms allow-popups’); iframe.setAttribute(‘id’, appId); iframe.setAttribute(‘style’, ‘position: fixed; width: 312px; height: 410px; border: none; bottom: 0px; right: 0; z-index:999;’); document.body.appendChild(iframe); var frameWindow = iframe.contentWindow ? iframe.contentWindow : iframe; var frameDoc = frameWindow.document; // Trigger a page load for iframe inline content loading to work in Firefox frameDoc.open(); frameDoc.close(); frameDoc.body.innerHTML = ” + ” + ” + ” + ” + msgWaitingForSecureConnectivity + ” + ” + ” + ” + ” + ‘‘ + msgCloseButtonLabel + ” + ” + ” + ” + ”; if (!addNoCacheQueryParam){ addNoCacheQueryParam = function (url) { return url + (url.indexOf(“?”) === -1 ? ‘?’ : ‘&’) + ‘nocache=’ + new Date().getTime(); } } if (!messageEventListener) { messageEventListener = function (event) { console.log(logPrefix + ‘Received event from origin: ‘ + event.origin); console.log(logPrefix + ‘Received event data: ‘ + JSON.stringify(event.data)); switch (event.data.messageType) { case ‘resize’: document.getElementById(appId).style.height = event.data.height + appMargin + ‘px’; console.log(logPrefix + ‘Successfully resized’); break; case ‘unmount’: document.body.removeChild(document.getElementById(appId)); window.removeEventListener(‘message’, messageEventListener); console.log(logPrefix + ‘Successfully unmounted BubbleChat and removed event listener for message’); break; case ‘bubblechat-cert-accepted’: document.getElementById(appId).setAttribute(‘src’, addNoCacheQueryParam(appUrl)); console.log(logPrefix + ‘Successfully validated certificate acceptance and loaded BubbleChat’); break; case ‘set-chat-in-progress’: if (typeof (Storage) !== ‘undefined’) { sessionStorage.chatInProgress = JSON.stringify(true); console.log(logPrefix + ‘chatInProgress flag set in parent window’); } break; case ‘clear-chat-in-progress’: if (typeof (Storage) !== ‘undefined’) { sessionStorage.removeItem(“chatInProgress”); console.log(logPrefix + ‘chatInProgress flag cleared in parent window’); } break; default: console.log(logPrefix + ‘Unknown message type’); } }; } window.addEventListener(‘message’, messageEventListener); console.log(logPrefix + ‘Event listener for message added’); var obtainSecureConnectivity = function () { window.postMessage({ messageType: ‘resize’, height: 395 }, ‘*’); frameDoc.getElementById(‘secure-connectivity-check-container’).style.display = ‘block’; window.open(addNoCacheQueryParam(connectivityCheckUrlSecure), ‘SM_CERT_PAGE’); }; var xhrSecureConnectivityCheck = new XMLHttpRequest(); xhrSecureConnectivityCheck.onreadystatechange = function () { if (this.readyState === 4) { console.log(logPrefix + ‘Secure connectivity check status: ‘ + this.status); switch (this.status) { case 200: iframe.setAttribute(‘src’, addNoCacheQueryParam(appUrl)); break; default: obtainSecureConnectivity(); } } } console.log(logPrefix + ‘Checking secure connectivity to: ‘ + connectivityCheckUrlSecure); xhrSecureConnectivityCheck.open(‘HEAD’, addNoCacheQueryParam(connectivityCheckUrlSecure), true); xhrSecureConnectivityCheck.timeout = secureConnectivityCheckTimeout; xhrSecureConnectivityCheck.ontimeout = function () { console.log(logPrefix + ‘Secure Connectivity check timed out’);} xhrSecureConnectivityCheck.send(); } }; })(); ]]>

Los Angeles310-672-8800

Chicago708-338-8888

Forgot Password Become a Customer Today! Established 1986
©2020 The Custom Companies, Inc.

Source