/* SAGE VDS Module Plug-In */ /* All code copyright (c) 2015-2017 Quick Technologies Inc. All Rights Reserved */ /* Utility functions */ function loadCSS(url) { var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = url; link.media = 'all'; head.appendChild(link); } function loadScript(url, callback) { // Adding the script tag to the head as suggested before var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; // Then bind the event to the callback function. // There are several events for cross browser compatibility. script.onreadystatechange = callback; script.onload = callback; // Fire the loading head.appendChild(script); } //function GetVDSPlotData(SuppID,ItemNum,ProdID) //{ // var dataString = 'AuthKey=PLGIN_203867_4a266584e9c2a086a187b3ef54a6adac&SuppID='+SuppID+'&ItemNum='+ItemNum+'&ProdID='+ProdID; // var PlotData=''; // jQuery.ajax({ // type: "POST", // url: "https://vds.sage.net/service/ws.dll/SuppVDSProdPlotData", // data: dataString, // crossDomain:true, // async:false, // cause it to finish before responding // success: function(data) { PlotData=data; }, // }); // return PlotData; //} /* Load all support files */ loadCSS('https://vds.sage.net/pluginsupport/vdsinclude.css'); var afterJSLoad1 = function() { loadScript("https://vds.sage.net/pluginsupport/highslide/highslide-full.packed.js", afterJSLoad2); }; var afterJSLoad2 = function() { loadScript("https://vds.sage.net/pluginsupport/highslide/highslide.config.js", afterJSLoad3); }; var afterJSLoad3 = function() { hs.lang = { loadingText: '', restoreTitle : 'Click to close. Click and drag to move.' }; hs.expandCursor=null; // hide zoom cursor hs.preserveContent=false; hs.showCredits=false; hs.blockRightClick=true; hs.zIndexCounter=99999; }; // Start here if (typeof jQuery == 'undefined') { // Load the JQuery library if it has not already been loaded (could be loaded on customer's site) loadScript("https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js", afterJSLoad1); } else { loadScript("https://vds.sage.net/pluginsupport/highslide/highslide-full.packed.js", afterJSLoad2); } /* Launch function (called from the client HTML page) */ function LaunchVDS(window,SuppID,ItemNum,ProdID) { // Start it up hs.src='https://vds.sage.net/?{%22authKey%22:%22PLGIN_203867_4a266584e9c2a086a187b3ef54a6adac%22,%22callbackUrl%22:%22/service/ws.dll/SWVDSReturn%22,%22backgroundID%22:%224-'+SuppID+'%7C'+ProdID+'%7C'+ItemNum+'%22,%22companyLogo%22:%22/images/vdslogo_generic.png%22,%22keepAspectRatio%22:true}'; hs.htmlExpand(window, { objectType: 'iframe', objectLoadTime:'after', align:'center', height:800, width:1050, allowWidthReduction:true, minWidth:300, minHeight:400 } ); }