PageSourceSearch

https://www.infoblox.com/wp-content/themes/infoblox-2023/js/libs/localization-script.js?ver=1790773722

js infoblox.com collected 2026-10-01 08:46:09 UTC 7,118 bytes, 188 lines download raw bytes

1function checklanguage(){
2	let lang = "";
3	if (jQuery("body").hasClass("smartling-es")) {
4		lang = "es";
5	}else if (jQuery("body").hasClass("smartling-de")) {
6		lang = "de";
7	}else if (jQuery("body").hasClass("smartling-ja")) {
8		lang = "jp";
9	}else if (jQuery("body").hasClass("smartling-fr")) {
10		lang = "fr";
11	}
12	return lang;
13}
14
15function removeLinksExcludedUrls() {
16    let imagelinks = [], links = [];
17    let lang = checklanguage();
18
19    if (lang) {
20        if (lang === 'jp') {
21            imagelinks = jQuery('.smartling-ja figure a');
22            links = jQuery('.smartling-ja p a');
23        } else {
24            imagelinks = jQuery(`.smartling-${lang} figure a`);
25            links = jQuery(`.smartling-${lang} p a`);
26        }
27    }
28
29    const excludedPaths = [
30        '/glossary/',
31        '/resources/',
32        '/dns-security-resource-center/',
33        '/openstack-cloud-adapter/'
34    ];
35
36    function shouldRemoveLink(href) {
37        if (!href) return false;
38
39        try {
40            const url = new URL(href, location.origin);
41
42            return (
43                (url.hostname === location.hostname || url.hostname === 'www.infoblox.com') &&
44                excludedPaths.some(path => url.pathname.includes(path))
45            );
46        } catch (e) {
47            return false;
48        }
49    }
50    // Remove image links
51    if (imagelinks.length) {
52        imagelinks.each(function () {
53            const href = jQuery(this).attr('href');
54
55            if (shouldRemoveLink(href)) {
56                jQuery(this).contents().unwrap();
57            }
58        });
59    }
60    // Remove text links
61    if (links.length) {
62        links.each(function () {
63            const href = jQuery(this).attr('href');
64
65            if (shouldRemoveLink(href)) {
66                jQuery(this).contents().unwrap();
67            }
68        });
69    }
70}
71
72//Attaches the ES Contact form instead of any CTA link in the bottom CTA banner on pages
73function replaceContactLocalized() {
74    let lang = checklanguage();
75
76    if (!lang) return;
77
78    const newUrl = `https://info.infoblox.com/contact-form-${lang}/`;
79
80    // Replace directly (full external paths - no hostname check needed)
81    jQuery('.vc-anchor-cta a').attr('href', newUrl);
82    jQuery('a[href*="https://info.infoblox.com/contact-form"]').attr('href', newUrl);
83    jQuery('a[href*="https://info.infoblox.com/cyber-threat-intelligence-subscription"]').attr('href', newUrl);
84    jQuery('a[href*="http://info.infoblox.com/contact-sales"]').attr('href', newUrl);
85    jQuery('a[href*="https://info.infoblox.com/contact-sales.html"]').attr('href', newUrl);
86    jQuery('a[href*="https://info.infoblox.com/Join-Infoblox-Voice-of-Customer-Program.html"]').attr('href', newUrl);
87    jQuery('a[href*="https://info.infoblox.com/contact-customer-success.html"]').attr('href', newUrl);
88    jQuery('a[href*="https://info.infoblox.com/technology-alliance-partners-form"]').attr('href', newUrl);
89    jQuery('a[href*="https://info.infoblox.com/BuildingBLOX-Partner-Program.html"]').attr('href', newUrl);
90    jQuery('a[href*="https://info.infoblox.com/resources-evaluations-ddi-eval"]').attr('href', newUrl);
91    jQuery('a[href*="https://info.infoblox.com/resources-evaluations-bloxone-threat-defense.html"]').attr('href', newUrl);
92    jQuery('a[href*="https://info.infoblox.com/resources-evaluations-advanced-dns-protection-users-201705"]').attr('href', newUrl);
93    jQuery('a[href*="https://info.infoblox.com/resources-infoblox-ddi-aws-eval"]').attr('href', newUrl);
94    jQuery('a[href*="https://info.infoblox.com/resources-evaluations-netmri"]').attr('href', newUrl);
95    jQuery('a[href*="https://info.infoblox.com/resources-evaluations-network-insight"]').attr('href', newUrl);
96
97    // Relative/internal paths = hostname check required
98    const internalPaths = [
99        '/contact-infoblox',
100        '/contact-infoblox/',
101        '/support/professional-services/custom-projects',
102        '/support/professional-services/packages/',
103        '/downloads',
104        '/infoblox-download-center/'
105    ];
106
107    jQuery('a').each(function () {
108        const $link = jQuery(this);
109        const href = $link.attr('href');
110        if (!href) return;
111        try {
112            const url = new URL(href, location.origin);
113            if (
114                (url.hostname === location.hostname || url.hostname === 'www.infoblox.com') &&
115                internalPaths.some(path => url.pathname.includes(path))
116            ) {
117                $link.attr('href', newUrl);
118            }
119        } catch (e) {}
120    });
121
122    // Language menu links
123    jQuery('#sidr-id-menu-item-32479 a').attr('href', 'https://www.infoblox.com/');
124    jQuery('#sidr-id-menu-item-35520 a').attr('href', 'https://www.infoblox.com/es/');
125    jQuery('#sidr-id-menu-item-35496 a').attr('href', 'https://www.infoblox.com/de/');
126    jQuery('#sidr-id-menu-item-43031 a').attr('href', 'https://www.infoblox.com/jp/');
127}
128
129// Replace the main domain with /lang-code in marketo contact form footer links
130function replaceMarketoFooterLinks() {
131    const lang = checklanguage();
132    if (!lang) return;
133    const currentUrl = window.location.href;
134    const contactFormUrl = `https://info.infoblox.com/contact-form-${lang}`;
135    // Run only on localized Marketo contact form pages
136    if (!currentUrl.includes(contactFormUrl)) return;
137    // Hide resource links
138    document
139        .querySelectorAll('a[href*="/resources"]')
140        .forEach(link => {
141            link.style.display = 'none';
142        });
143    // Update body links
144    document
145        .querySelectorAll('#bodyId a[href]')
146        .forEach(link => {
147            const href = link.getAttribute('href');
148            if (!href) return;
149            try {
150                const url = new URL(href);
151                // Only modify Infoblox production links
152                if (url.hostname === 'www.infoblox.com') {
153                    url.pathname = `/${lang}${url.pathname}`.replace(/\/+/g, '/');
154                    link.setAttribute('href', url.toString());
155                }
156                link.setAttribute('target', '_blank');
157                link.setAttribute('rel', 'noopener');
158            } catch (e) {
159                // Ignore invalid URLs
160            }
161        });
162}
163window.addEventListener('load', replaceMarketoFooterLinks );
164
165jQuery(document).ready( function () {
166  removeLinksExcludedUrls();
167  replaceContactLocalized();
168});
169// Update the Truste consent link to point to the localized terms and conditions page if available
170(function () {
171  const SUPPORTED_LANGS = ['de', 'es', 'fr', 'jp'];
172  const lang = SUPPORTED_LANGS.find(code =>
173    window.location.pathname.startsWith('/' + code + '/')
174  );
175  if (!lang) return;
176  const anchor = document.querySelector('#truste-consent-text a[href*="infoblox.com/company/legal/website-terms-and-conditions"]');
177  if (!anchor) return;
178  const hasLang = SUPPORTED_LANGS.some(code =>
179    anchor.href.includes('infoblox.com/' + code + '/')
180  );
181  if (hasLang) {
182    anchor.remove();
183  } else {
184    const url = new URL(anchor.href);
185    url.pathname = '/' + lang + url.pathname;
186    anchor.href = url.toString();
187  }
188})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.