(function (global) { //global paths var tcwTpl = 'https://widget.netsheet.com/'; // make a global object to store stuff in if(!global.tcWidget) { global.tcWidget = {}; }; var tcWidget = global.tcWidget; var vdate = new Date(); var vtime = vdate.getTime(); var widgetInfo; var x = sessionStorage.getItem('tqc'); var sessionInfo = JSON.parse(x); if(sessionInfo !== null && typeof parseInt(sessionInfo) === 'number') { widgetInfo = sessionInfo; } else { widgetInfo = window.parent.tclp_Option.q; } sessionStorage.setItem('apiPath', 'https://api.titlecapture.com/api-30/'); sessionStorage.setItem('rootPath', 'https://widget.netsheet.com/'); sessionStorage.setItem('apiNodePath', 'https://pytxof1vl1.execute-api.us-east-1.amazonaws.com/prod/'); sessionStorage.setItem('apiNetSheetPath', 'https://api.netsheet.com/'); // To keep track of which embeds we have already processed if(!tcWidget.processedScripts) { tcWidget.processedScripts = []; }; var processedScripts = tcWidget.processedScripts; if(!tcWidget.styleTags) { tcWidget.styleTags = []; }; var styleTags = tcWidget.styleTags; var scriptTags = document.getElementsByTagName('script'); for(var i = 0; i < scriptTags.length; i++) { var scriptTag = scriptTags[i]; //if ( scriptTag.id == 'tc_widget_js' && processedScripts.indexOf(scriptTag) < 0 ) { if ( scriptTag.id == 'tc_widget_js' ) { processedScripts.push(scriptTag); if(styleTags.length == 0) { // add a style tag to the head var linkTag = document.createElement('link'); linkTag.href = tcwTpl + 'css/tcw-common.css?v=' + vtime; linkTag.type = 'text/css'; linkTag.rel = 'stylesheet'; linkTag.id = 'tcw-common-style'; document.getElementsByTagName('head')[0].appendChild(linkTag); } // Create a Button var tcwBtn = document.createElement('iframe'); tcwBtn.id = 'tcWidgetBtn'; tcwBtn.scrolling= 'no'; tcwBtn.allowTransparency='true'; tcwBtn.frameBorder='0'; tcwBtn.style.background = 'transparent'; tcwBtn.style.border = 'none'; tcwBtn.style.position = 'fixed'; tcwBtn.style.zIndex = '999999'; tcwBtn.style.width = '190px'; tcwBtn.style.height = '150px'; if( widgetInfo.offsetRight ){ tcwBtn.style.right = ( widgetInfo.offsetRight - 15 )+ 'px'; }else{ tcwBtn.style.right = '25px'; } if( widgetInfo.offsetBottom ){ tcwBtn.style.bottom = ( widgetInfo.offsetRight - 15 ) + 'px'; }else{ tcwBtn.style.bottom = '25px'; } document.body.appendChild(tcwBtn); //add js for launcher var jsURI = tcwTpl + 'js/tcw-launcher.js?v=' + vtime; var iframeHTML = ''; tcwBtn.contentWindow.document.write(iframeHTML); // Create a click to see text if ( widgetInfo.showcase == true ){ } }/* end : if */ } })(this);