/** * Reusable bootstrap for regional satellite sections. * * Enable on a site: * 1. Add $domens[""] in src/assets/php/satellite_params.php * 2. Optional $satellite_domain_aliases[""] * 3. Set window.HMC_SATELLITE_SECTION = "" before including this script * 4. Add satellite nav + pane markup in workspace_1.php / workspace_2.php */ (function($) { var section = window.HMC_SATELLITE_SECTION || "cfo"; var assetsBase = window.HMC_ASSETS_BASE || "../assets"; if (typeof window.satelliteSection !== "undefined") { window.satelliteSection = section; } if (typeof window.l_satelliteSection !== "undefined") { window.l_satelliteSection = section; } if (typeof window.r_satelliteSection !== "undefined") { window.r_satelliteSection = section; } window.onSatelliteDomenChange = function() { if (typeof window.getSatelliteList === "function") { window.getSatelliteList(section); } }; window.getSatelliteDomenList = function(idSection) { idSection = idSection || section; $.ajax({ type: "POST", url: assetsBase + "/php/satellite/domenhandler.php", data: {id_section: idSection} }).done(function(result) { $("#domen_wrapper").html(result); if (typeof window.getSatelliteList === "function") { window.getSatelliteList(idSection); } }); }; window.l_getSatelliteDomenList = function(idSection) { idSection = idSection || section; $.ajax({ type: "POST", url: assetsBase + "/php/satellite/l_domenhandler.php", data: {id_section: idSection} }).done(function(result) { $("#l_domen").html(result); if (typeof window.l_getSatelliteList === "function") { window.l_getSatelliteList(idSection); } }); }; window.r_getSatelliteDomenList = function(idSection) { idSection = idSection || section; $.ajax({ type: "POST", url: assetsBase + "/php/satellite/r_domenhandler.php", data: {id_section: idSection} }).done(function(result) { $("#r_domen").html(result); if (typeof window.r_getSatelliteList === "function") { window.r_getSatelliteList(idSection); } }); }; $(document).ready(function() { if ($("#domen_wrapper").length && $("#satellite_wrapper").length && typeof window.getSatelliteDomenList === "function") { window.getSatelliteDomenList(section); } }); })(jQuery);