1$(document).ready(function () { 2 3 var animationEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend"; 4 5 $('.interviewSlotWarning').one(animationEnd, function () { 6 $('interviewSlotWarning').removeClass("fadeInUp"); 7 }); 8 9 $('.interviewSlotWarning').addClass("fadeInUp animated"); 10 11 $('.js-dismiss').click(function () { 12 $('.interviewSlotWarning').fadeOut(); 13 }); 14 15 16 var isSafari = !!navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/chrome/i) && typeof document.body.style.webkitFilter !== "undefined" && !window.chrome; 17 18 if (isSafari) { 19 $('select').addClass('safari'); 20 $('input[type="text"]').addClass('safari'); 21 } 22 23 24 /*------------------------------------*\ 25 PROFILE-SIDENAV ACCORDION 26 \*------------------------------------*/ 27 28 $('body').on('click touch', '.js-button--sidebar', function (event) { 29 $('#mapInfoWindow--details').addClass('mapInfoWindow--details--open') 30 31 var src = $(this).data('href') 32 33 $('#iframesrc').attr('src', src); 34 35 36 }); 37 38 39 var profileCurrentPage = $(".profile-sidenav").find('.is-active'); 40 41 if (profileCurrentPage.length > 0) { 42 43 $(".profile-sidenav.is-collapsed").show(); 44 45 profileCurrentPage.closest('.profile-sidenav__section').find('.js-profile-sidenav-button').find('.icon').addClass('icon-keyboard-arrow-down').removeClass('icon-keyboard-arrow-right'); 46 profileCurrentPage.closest('.profile-sidenav__section').find('.js-profile-sidenav-button').attr('aria-expanded', 'true'); 47 profileCurrentPage.closest('.profile-sidenav__list').show(); 48 49 $(this).attr('aria-expanded', 'false'); 50 } 51 52 $('.js-profile-sidenav-button').click(function () { 53 54 var $list = $(this).siblings('.profile-sidenav__list'); 55 56 if ($list.is(":visible")) { 57 $list.hide(); 58 $(this).attr('aria-expanded', 'false'); 59 //set them all to point right 60 $(this).find('.icon').removeClass('icon-keyboard-arrow-down').addClass('icon-keyboard-arrow-right'); 61 } else { 62 $list.show(); 63 $(this).attr('aria-expanded', 'true'); 64 $(this).find('.icon').removeClass('icon-keyboard-arrow-right').addClass('icon-keyboard-arrow-down'); 65 } 66 67 }); 68 69 70 $('body').on('click touch', '.nav--mobile .menu-item-has-children', function (event) { 71 72 event.preventDefault(); 73 74 $(this).toggleClass("open") 75 76 77 }); 78 79 /*------------------------------------*\ 80 QUICKSEARCH GEOLOCATION 81 \*------------------------------------*/ 82 83 $('body').on('click touch', '.js-geolocation', function (event) { 84 85 event.preventDefault(); 86 87 //call geolocation function here 88 89 90 //change the icon to gps-fixed when we have a location set 91 $(this).find('.icon').removeClass('icon-gps-not-fixed'); 92 $(this).find('.icon').addClass('icon-gps-fixed'); 93 94 95 96 }); 97 98 $(".js-geolocation-input").on("input", function () { 99 100 $(this).siblings().find('.icon').addClass('icon-gps-not-fixed'); 101 $(this).siblings().find('.icon').removeClass('icon-gps-fixed'); 102 }); 103}); 104 105// On Page Load find the location hiddenFields and check if they are populated. 106// This will then set the correct class on the icon. 107$(window).on('load', function () { 108 109 var locationDiv = $(".quicksearch__location"); 110 var hiddenFields = $(locationDiv).find('input[type="hidden"]'); 111 112 var hasLng = false; 113 var hasLat = false; 114 $(hiddenFields).each(function (index) { 115 if (index < 2) { 116 117 if (index == 0 && $(this).val()) { 118 hasLng = true; 119 } 120 else if (index == 1 && $(this).val()) { 121 hasLat = true; 122 } 123 } 124 }); 125 126 if (hasLng && hasLat) { 127 $(".js-geolocation").find('.icon').removeClass('icon-gps-not-fixed'); 128 $(".js-geolocation").find('.icon').addClass('icon-gps-fixed'); 129 } 130 else { 131 $(".js-geolocation").find('.icon').removeClass('icon-gps-fixed'); 132 $(".js-geolocation").find('.icon').addClass('icon-gps-not-fixed'); 133 } 134}); 135 136 137$(window).on('load', function () { 138 positionProfileImage('.avatar__img--large', 128); 139 positionProfileImage('.avatar__img--small', 24); 140 positionProfileImage('.avatar__img--medium', 64); 141 positionProfileImage('.topbar__portrait--img', 128); 142}); 143 144 145function positionProfileImage(imageClass, containerSize) { 146 147 var img = $(imageClass); 148 var imgWidth = $(imageClass).outerWidth(); 149 var imgHeight = $(imageClass).outerHeight(); 150 151 if (imgWidth > imgHeight) { 152 img.css({ 'height': containerSize + "px" }) 153 } else { 154 img.css({ 'width': containerSize + "px" }) 155 } 156 157 $(imageClass).css({ 158 'margin-left': 0 - ($(imageClass).outerWidth() / 2) + (containerSize / 2), 159 'margin-top': 0 - ($(imageClass).outerHeight() / 2) + (containerSize / 2), 160 'visibility': 'visible' 161 });
162} 163 164 165function setNavigation() { 166 var path = window.location.pathname; 167 path = path.replace(/\/$/, ""); 168 path = decodeURIComponent(path); 169 path = path.toLowerCase(); 170 171 $(".nav .nav__link").each(function () { 172 173 $(this).removeAttr("aria-current") 174 175 var data_href = $(this).attr('data-href'); 176 177 if (typeof data_href !== typeof undefined && data_href !== false) { 178 179 data_href = data_href.replace(/\/$/, ""); 180 data_href = data_href.toLowerCase(); 181 182 if (data_href == "home") { 183 if (window.location.href == $(this).attr("href")) { 184 $(this).addClass('is-active').attr('aria-current', 'true'); 185 } 186 } else if (path.indexOf(data_href) != -1) { 187 $(this).addClass('is-active').attr('aria-current', 'true'); 188 } 189 190 } 191 }); 192} 193 194 195 196 197 198 199$(document).ready(function () { 200 201 setNavigation(); 202 203 //add validation aria roles for screen readers 204 $('.errorsummary, .red, .error-message').attr('role', 'alert'); 205 206 $('.js-vacancyfilter-toggle').on("click", function () { 207 if (!$('.js-vacancyfilter').hasClass('.is-visible')) { 208 209 //set visible and add visible class 210 $(".js-vacancyfilter").css('visibility', 'visible'); 211 $(".js-vacancyfilter").addClass("is-visible").attr("aria-hidden", "false"); 212 213 ITSTrapFocus($('.js-vacancyfilter'), { namespace: 'filter', onESC: function () { $('.filterblocker').trigger('click'); } }); 214 215 if ($('.filterblocker').length == 0) 216 $('body').append('<div class="filterblocker"></div>'); 217 218 $('.filterblocker, .js-vacancyfilter-close').on('click', function () { 219 220 ITSTrapFocusUndo($('.js-vacancyfilter'), { namespace: 'filter', focusOnElement: $('.js-vacancyfilter-toggle') }); 221 222 $(".js-vacancyfilter").removeClass("is-visible"); 223 $('.filterblocker').remove(); 224 225 $(".js-vacancyfilter").attr("aria-hidden", "true").css('visibility', 'hidden'); 226 }); 227 } 228 }); 229 230 $(document).on('click', function (e) { 231 232 var $popovers = $('.js-reveal-container'); 233 234 //if there are some popovers on the page 235 if ($popovers.length) { 236 237 //if clicked inside popover container 238 if ($(e.target).closest('.js-reveal-container').length) { 239 240 241 //find the popover container 242 var $container = $(e.target).closest('.js-reveal-container'); 243 244 if ($(e.target).closest('.js-popover-trigger').length) { 245 //if the dropdown is closed open it 246 if ($container.data("popoverState") == "closed") { 247 showPopover($container); 248 } 249 //if the dropdown is open then close it 250 else if ($container.data("popoverState") == "open") { 251 hidePopover($container); 252 } 253 } 254 } 255 256 //if clicked anywhere else on the page 257 else { 258 hideAllPopovers(); 259 } 260 } 261 }); 262 263}); 264 265 266 267 268 269 270 271 272 273 274 275function showPopover($container) { 276 hideAllPopovers(); 277 278 var $body = $container.find('.js-reveal-body'); 279 var $trigger = $container.find('.js-popover-trigger'); 280 281 $body.css('display', 'block'); 282 283 ITSTrapFocus($body, { namespace: 'popover', onESC: function () { hidePopover($container); } }); 284 285 $trigger.attr('aria-expanded', 'true'); 286 287 $container.data("popoverState", "open"); 288 $container.attr("data-popover-state", "open"); 289 290 if (window.self !== window.top) { 291 292 var height = $body.outerHeight() + $trigger.outerHeight() + 20; 293 var width = 404; 294 295 parent.LoginWidget.resize(height, width); 296 297 298 } 299} 300 301function hidePopover($container) { 302 var $body = $container.find('.js-reveal-body'); 303 var $trigger = $container.find('.js-popover-trigger'); 304 //$trigger.focus(); 305 306 $body.css('display', 'none'); 307 $trigger.attr('aria-expanded', 'false'); 308 309 $container.data("popoverState", "closed"); 310 $container.attr("data-popover-state", "closed"); 311 312 ITSTrapFocusUndo($body, { namespace: 'popover' }); 313 314 if (window.self !== window.top) { 315 316 var height = $('.login-profile-buttons').outerHeight(); 317 var width = $('.login-profile-buttons').outerWidth(true) + 5; 318 parent.LoginWidget.resize(height, width); 319 320 } 321 322 323} 324 325function hideAllPopovers() { 326 327 $elem = $('.js-reveal-container'); 328 329 $elem.find('.js-reveal-body').css("display", "none"); 330 $elem.find('.js-popover-trigger').attr("aria-expanded", "false"); 331 332 $elem.data("popoverState", "closed"); 333 $elem.attr("data-popover-state", "closed"); 334 335 336 if (window.self !== window.top) { 337 var height = $('.login-profile-buttons').outerHeight(); 338 var width = $('.login-profile-buttons').outerWidth(true) + 5; 339 340 parent.LoginWidget.resize(height, width); 341 } 342 343} 344 345 346 347function setFilterVisibility() { 348 349 350} 351 352//WIDGET FUNCTIONS 353 354 355 356//SAVED JOB STUFF 357 358function setJobAsSaved(config) { 359 var $elem = $('#' + config.clientID); 360 361 if (config.displayType == "icon") { 362 $elem.html('<i class="icon ' + config.icons.jobSaved + '"></i>'); 363 $elem.attr("title", config.resources.jobSaved + " " + config.vacTitle); 364 } 365 else { 366 $elem.html(config.resources.jobSaved + '<i class="icon ' + config.icons.jobSaved + '"></i>'); 367 $elem.attr("aria-label", config.resources.jobSaved + " " + config.vacTitle); 368 } 369 370 $elem.removeAttr("onclick"); 371 $elem.attr("onclick", "javascript: RemoveJob(" + JSON.stringify(config) + ");return false;"); 372 $elem.attr("aria-pressed", "true"); 373 374 $elem.removeClass('is-not-added').addClass('is-added'); 375 376} 377 378 379function setJobAsNotSaved(config) { 380 var $elem = $('#' + config.clientID); 381 382 if (config.displayType == "icon") { 383 $elem.html('<i class="icon ' + config.icons.jobNotSaved + '" aria-hidden="true"></i>'); //Save Job 384 $elem.attr("title", config.resources.jobNotSaved + " " + config.vacTitle); 385 } 386 else { 387 $elem.html(config.resources.jobNotSaved + '<i class="icon ' + config.icons.jobNotSaved + '" aria-hidden="true"></i>'); 388 $elem.attr("aria-label", config.resources.jobNotSaved + " " + config.vacTitle); 389 } 390 391 $elem.removeAttr("onclick"); 392 $elem.attr("onclick", "javascript: AddJob(" + JSON.stringify(config) + ");return false; "); 393 $elem.attr("aria-pressed", "false"); 394 $elem.removeClass('is-added').addClass('is-not-added'); 395 396} 397 398 399function SetUpJobState(config) { 400 $.ajax({
401 type: "POST", 402 url: config.resolvedURL + "WebServices/ClientService.asmx/GetJobState", 403 data: "{iVacancyID:" + config.vacID + "}", 404 contentType: "application/json; charset=utf-8", 405 dataType: "json", 406 success: function (msg) { 407 if (msg.d) { 408 setJobAsSaved(config); 409 } 410 else { 411 setJobAsNotSaved(config); 412 } 413 } 414 }); 415} 416 417function CallSuccess(res, config) { 418 var dest = $("#" + config.clientID); 419 if (res == "OK") { 420 if ($(dest)) { 421 if ($(dest).hasClass('is-added')) { 422 setJobAsNotSaved(config); 423 424 if (window.parent == window.self) 425 ResetSavedJobCount(-1); 426 else 427 updateSavedJobsCount(); 428 } 429 else if ($(dest).hasClass('is-not-added')) { 430 setJobAsSaved(config); 431 432 if (window.parent == window.self) 433 ResetSavedJobCount(1); 434 else 435 updateSavedJobsCount(); 436 } 437 } 438 else { 439 alert('Fail'); 440 } 441 } 442 else { 443 alert('Error'); 444 } 445 return false; 446} 447 448function CallFailed(res) { 449 alert('Error'); 450 return false; 451} 452 453function AddJob(config) { 454 $.ajax({
455 type: "POST", 456 url: config.resolvedURL + "WebServices/ClientService.asmx/AddToJobsList", 457 data: "{iVacancyID:" + config.vacID + " , sCandidate:'" + config.candID + "'}", 458 contentType: "application/json; charset=utf-8", 459 dataType: "json", 460 success: function (msg) { 461 CallSuccess(msg.d, config); 462 } 463 }); 464} 465 466function RemoveJob(config) { 467 $.ajax({ 468 type: "POST", 469 url: config.resolvedURL + "WebServices/ClientService.asmx/RemovedSavedVacancy", 470 data: "{iVacancyID:" + config.vacID + " , sCandidate:'" + config.candID + "'}", 471 contentType: "application/json; charset=utf-8", 472 dataType: "json", 473 success: function (msg) { 474 CallSuccess(msg.d, config); 475 } 476 }); 477} 478 479function watchElements($elems, type, callback) { 480 var config = { attributes: true, childList: true, subtree: true }; 481 482 var callbackfunction = function (mutationsList, observer) { 483 //debugger; 484 $(mutationsList).each(function () { 485 if ($(this)[0].type == type) { 486 if (typeof callback === "function") 487 callback(); 488 } 489 }); 490 }; 491 492 $elems.each(function () { 493 var obj = new MutationObserver(callbackfunction); 494 495 if ($(this)[0] !== null) { 496 obj.observe($(this)[0], config); 497 } 498 }); 499} 500 501 502function updateSavedJobsCount() { 503 try { 504 if (typeof parent.LoginWidget.container !== 'undefined') { 505 parent.LoginWidget.refresh(); 506 } 507 508 if (typeof parent.SavedJobsWidget.container !== 'undefined') { 509 parent.SavedJobsWidget.refresh(); 510 } 511 } 512 catch (error) { 513 console.error(error); 514 } 515} 516 517function completeFormFixedHeaders() { 518 519 520 if ($('.container--topcontent').find('div').hasClass('banner')) { 521 522 $('.container--topcontent').addClass('container--nonFixed'); 523 $('.dfw-process__nav').addClass('dfw-process__nav--nonFixed'); 524 525 } 526 else { 527 var $progressbar = $Eploy('.progress__total'); 528 var $progresslabel = $Eploy('.progress__label-value'); 529 var $titlebar = $Eploy('.title-bar .wrap'); 530 531 var scrollposition = $Eploy(window).scrollTop(); 532 var progressbarOffset = $progressbar.offset().top; 533 var appended = false; 534 535 if ($progressbar.length && $titlebar.length) { 536 var html = "<div id='progress-container' class='its-o-flexi its-o-flexi--middle title-bar__progress-container'>" + 537 "<div id='progress-bar-container' class='its-o-flexi__cell'>" + $progressbar.clone()[0].outerHTML + "</div>" + 538 "<div id='progress-label-container' class='its-o-flexi__fixed-cell soft--left'>" + $progresslabel.clone().html() + "</div>" + 539 "</div>" 540 541 $titlebar.append(html); 542 } 543 544 var $progressContainer = $Eploy('#progress-container'); 545 546 if (scrollposition > progressbarOffset) { 547 $progressContainer.addClass('is-attached'); 548 appended = true; 549 } 550 551 $Eploy(window).on('scroll', function () { 552 553 scrollposition = $Eploy(this).scrollTop(); 554 555 if (scrollposition > progressbarOffset) { 556 if (appended == false) { 557 $progressContainer.addClass('is-attached'); 558 appended = true; 559 } 560 } 561 else { 562 $progressContainer.removeClass('is-attached'); 563 appended = false; 564 } 565 }); 566 } 567}
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.