(function (window) { if (window.wizeHireJobRollLoaded === true) { return; } window.wizeHireJobRollLoaded = true; // add fake no-op console if this browser doesn't have one if (!window.console && window.console.log) { window.console = { log: function () {} }; } // cross-browser hack var setText = function (domElement, content) { var hasInnerText = document.getElementsByTagName("body")[0].innerText !== undefined; if (hasInnerText) { domElement.innerText = content; } else { domElement.textContent = content; } }; window.wh_cb = function (jobs) { document.createElement("div"); var wizehireJobrollContainer = document.getElementById( "wizehire-jobroll-container" ); if (!wizehireJobrollContainer) { console.log( 'Could not find element with id "wizehire-jobroll-container"' ); return; } wizehireJobrollContainer.style.width = window.wizeHireJobRollWidth || "450px"; var jobRollTitle = document.createElement("h1"); jobRollTitle.style.margin = "0"; setText(jobRollTitle, window.wizeHireJobRollTitle); if (window.wizeHireJobRollTitle && window.wizeHireJobRollTitle.length > 0) { wizehireJobrollContainer.appendChild(jobRollTitle); } wizehireJobrollContainer.style.border = window.wizeHireJobRollBorder || "1px solid #aaa"; wizehireJobrollContainer.style.padding = "5px 10px 30px 10px"; wizehireJobrollContainer.style.fontFamily = window.wizeHireJobRollFontFamily || '"Helvetica Neue", Arial, sans-serif'; wizehireJobrollContainer.style.fontSize = "14px"; wizehireJobrollContainer.style.lineHeight = "1.42857143"; wizehireJobrollContainer.style.color = "#333333"; wizehireJobrollContainer.style.backgroundColor = window.wizeHireJobRollBackgroundColor || "#ffffff"; const locationSelector = document.createElement("select"); locationSelector.style.marginTop = "8px"; locationSelector.style.width = "100%"; locationSelector.style.padding = "5px"; locationSelector.style.borderRadius = "5px"; locationSelector.style.border = "1px solid #ccc"; locationSelector.style.fontSize = "14px"; locationSelector.style.fontFamily = window.wizeHireJobRollFontFamily || '"Helvetica Neue", Arial, sans-serif'; locationSelector.style.color = "#333333"; locationSelector.style.backgroundColor = window.wizeHireJobRollBackgroundColor || "#ffffff"; locationSelector.style.boxSizing = "border-box"; locationSelector.addEventListener("change", (event) => { renderJobRoll(event.target.value); }); const jobLocationMap = new Map(); for (const job of jobs) { if (jobLocationMap.has(job.location)) { jobLocationMap.set(job.location, jobLocationMap.get(job.location) + 1); } else { jobLocationMap.set(job.location, 1); } } const placeholderOption = document.createElement("option"); placeholderOption.textContent = "Filter by Location"; placeholderOption.selected = true; placeholderOption.value = ""; locationSelector.appendChild(placeholderOption); Array.from(jobLocationMap).forEach((jobLocation) => { const option = document.createElement("option"); option.value = jobLocation[0]; option.innerHTML = `${jobLocation[0]} (${jobLocation[1]})`; locationSelector.appendChild(option); }); wizehireJobrollContainer.appendChild(locationSelector); const jobRollJobListContainer = document.createElement("div"); wizehireJobrollContainer.appendChild(jobRollJobListContainer); const renderJobRoll = (selectedLocation) => { jobRollJobListContainer.innerHTML = ""; var maxJobs = window.wizeHireJobRollMaxJobs || 10; const filteredJobs = jobs.filter((job) => { return selectedLocation.length ? job.location === selectedLocation : true; }); for (var i = 0; i < Math.min(maxJobs, jobs.length); i++) { var job = filteredJobs[i]; var row = document.createElement("div"); row.setAttribute("class", "wh-job-row"); var jobTitle = document.createElement("a"); jobTitle.href = job.url; jobTitle.target = "_blank"; jobTitle.innerHTML = job.title; jobTitle.style.fontSize = "18px"; jobTitle.style.color = window.wizeHireJobRollLinkColor || "#428bca"; jobTitle.style.textDecoration = "none"; row.style.paddingTop = "8px"; var snippet = document.createElement("div"); setText(snippet, job.snippet); var companyLocationRow = document.createElement("div"); var companyName = document.createElement("span"); setText(companyName, job.company); var location = document.createElement("span"); location.style.color = "#aaa"; setText(location, job.location); var separator = document.createElement("span"); setText(separator, " - "); companyLocationRow.appendChild(companyName); companyLocationRow.appendChild(separator); companyLocationRow.appendChild(location); companyLocationRow.style.fontSize = "16px"; row.appendChild(jobTitle); row.appendChild(companyLocationRow); row.appendChild(snippet); jobRollJobListContainer.appendChild(row); } if (filteredJobs.length === 0) { var noJobsMessage = document.createElement("div"); setText(noJobsMessage, "No open jobs are available."); jobRollJobListContainer.appendChild(noJobsMessage); } }; renderJobRoll(""); var logoContainer = document.createElement("div"); logoContainer.style.float = "right"; var logoLabel = document.createElement("span"); logoLabel.style.verticalAlign = "middle"; setText(logoLabel, "jobs by "); var logoImage = document.createElement("img"); logoImage.style.verticalAlign = "middle"; logoImage.src = "https://wizehire.com/static/img/WizehireLogoRebrand.svg"; var logoLink = document.createElement("a"); logoLink.href = "https://wizehire.com"; logoLink.appendChild(logoImage); logoContainer.appendChild(logoLabel); logoContainer.appendChild(logoLink); logoImage.style.width = "70px"; wizehireJobrollContainer.appendChild(logoContainer); }; var script = document.createElement("script"); script.src = "https://wizehire.com/jobroll/v1/jobs/10868/jsonp"; document.getElementsByTagName("head")[0].appendChild(script); })(window);