PageSourceSearch

https://www.playtika.com/js/greenHouseMain.js

js playtika.com collected 2026-10-01 09:08:26 UTC 20,934 bytes, 724 lines download raw bytes

1
2
3function getGreenHouseJobs() {
4    var url = "https://boards-api.greenhouse.io/v1/boards/playtikaltd/jobs";
5    jQuery.getJSON(url, function(data) {
6        let totalPositions = 0;
7
8        const separators = [' · ', '·', ';', '•'];
9
10        // Count positions including multiple locations
11        data.jobs.forEach(job => {
12            if (job.location && job.location.name) {
13
14                let locations = [job.location.name];
15
16                for (const separator of separators) {
17
18                    const tempLocations = [];
19
20                    for (const loc of locations) {
21
22                        if (loc.includes(separator)) {
23                            tempLocations.push(...loc.split(separator));
24                        } else {
25                            tempLocations.push(loc);
26                        }
27                    }
28
29                    locations = tempLocations;
30                }
31
32                totalPositions += locations.filter(loc => loc.trim()).length;
33            } else {
34                // If no location is specified, count it as one position
35                totalPositions++;
36            }
37        });
38
39        // Update the counter
40        jQuery("#positionsCount").html(totalPositions);
41        jQuery('#positionsCount').counterUp({
42            delay: 10,
43            time: 1000
44        });
45        return;
46    });
47}
48function fixDepartmentNameByName(departmentName) {
49
50    if (departmentName == "customer service") {
51        departmentName = "customer";
52    }
53    if (departmentName == "data & ai") {
54        departmentName = "data";
55    }
56    if (departmentName == "security it") {
57        departmentName = "security";
58    }
59    if (departmentName == "monetization & crm") {
60        departmentName = "monetization";
61    }
62    if (departmentName == "hr & administration") {
63        departmentName = "hr";
64    }
65    if (departmentName =="finance & legal") {
66        departmentName = "finance";
67    }
68    return departmentName;
69}
70
71function getDepartmentIdByName(departmentName) {
72
73    const Departments = [];
74    Departments["Marketing"]= "4019805101";
75    Departments["Customer"]= "4019807101";
76    return Departments[departmentName];
77}
78
79function checkCountryCode(countryCode) {
80    var countryName = "";
81
82    if (countryCode == "IL") {
83        countryName = "Israel";
84    }
85    else if (countryCode == "RO") {
86        countryName = "Romania";
87    }
88    else if (countryCode == "US") {
89        countryName = "USA";
90    }
91    else if (countryCode == "UA") {
92        countryName = "Ukraine";
93    }
94    else if (countryCode == "CA") {
95        countryName = "Canada";
96    }
97    else if (countryCode == "BY") {
98        countryName = "Belarus";
99    }
100    else if (countryCode == "AL") {
101        countryName = "Australia";
102    }
103    else if ( countryCode == "UK" ) {
104        countryName = "UK";
105    }
106    else if (countryCode == "GB" ) {
107        countryName = "UK";
108    }
109    else if (countryCode == "PL" ) {
110        countryName = "Poland";
111    }
112    else if (countryCode == "FI" ) {
113        countryName = "Finland";
114    }
115    else if (countryCode == "EMEA" ) {
116        countryName = "EMEA";
117    }
118    else if (countryCode == "NL" ) {
119        countryName = "Netherlands";
120    }
121    else if (countryCode == "all" ) {
122        countryName = "Any Office";
123    }
124    else {
125        return "IL";
126    }
127
128
129    return countryName;
130
131
132}
133
134
135function getCountryName(countryCode) {
136    var countryName = "";
137
138    if (countryCode == "IL") {
139        countryName = "Israel";
140    }
141    else if (countryCode == "RO") {
142        countryName = "Romania";
143    }
144    else if (countryCode == "US") {
145        countryName = "USA";
146    }
147    else if (countryCode == "UA") {
148        countryName = "Ukraine";
149    }
150    else if (countryCode == "CA") {
151        countryName = "Canada";
152    }
153    else if (countryCode == "BY") {
154        countryName = "Belarus";
155    }
156    else if (countryCode == "AL") {
157        countryName = "Australia";
158    }
159    else if ( countryCode == "UK" ) {
160        countryName = "UK";
161    }
162    else if (countryCode == "GB" ) {
163        countryName = "UK";
164    }
165    else if (countryCode == "PL" ) {
166        countryName = "Poland";
167    }
168    else if (countryCode == "FI" ) {
169        countryName = "Finland";
170    }
171    else if (countryCode == "EMEA" ) {
172        countryName = "EMEA";
173    }
174    else if (countryCode == "NL" ) {
175        countryName = "Netherlands";
176    }
177    else if (countryCode == "all" ) {
178        countryName = "Any Office";
179    }
180    else {
181
182        countryName = countryCode;
183    }
184
185    return countryName;
186
187
188}
189
190function getGreenHouseOffices() {
191
192    var url = "https://boards-api.greenhouse.io/v1/boards/playtikaltd/offices";
193    const all = [];
194    const countries = [];
195    const offices = [];
196
197    var l = 0;
198
199    jQuery.getJSON(url, function(data) {
200        var data = data.offices;
201
202        for (var i = 0, len = data.length; i < len; i++) {
203            if (data[i].parent_id != null) {
204                offices[data[i].name] = data[i].parent_id;
205            }
206            else {
207                countries[data[i].id] = data[i].name;
208            }
209
210            if (data[i].parent_id == null) {
211
212                if (data[i].name != "No Office") {
213                    newOffice = "" +
214                        "<li onclick='clickabledropdown(event)' data-value='"+data[i].name+"' data-country='"+data[i].name+"' class=\"dropdown-item\">"+data[i].name+"</li>";
215
216                    // var filterJobs = document.getElementById("filterJobs");
217                    // filterJobs.insertAdjacentHTML('beforeend',newOffice);
218
219                }
220            } else { //value is city
221                if (data[i].name != "No Office" && data[i].parent_id == '4010570101') { //only Ukraine sites - by demand
222                    //     newOffice = "" +
223                    //        "<li data-value='"+data[i].name+"' data-site='"+data[i].name+"' class=\"dropdown-item\">"+data[i].name+"</li>";
224
225                    //     var filterJobs = document.getElementById("secondFilterJobs");
226                    //      filterJobs.insertAdjacentHTML('beforeend',newOffice);
227                }
228            }
229        }
230    });
231
232    all["countries"] = countries;
233
234    all["offices"] = offices;
235
236    const event = new CustomEvent('itemsGenerated');
237    document.dispatchEvent(event);
238
239    return all;
240
241
242}
243
244function clickabledropdown() {
245    $('.dropdown-item').removeClass('selected');
246    $(this).addClass('selected');
247    checkStringCat();
248}
249
250function getGreenHouseOfficesList() {
251    var url = "https://boards-api.greenhouse.io/v1/boards/playtikaltd/offices";
252    jQuery.getJSON(url, function(data) {
253        var data = data.offices;
254
255        var newOffice = "";
256        for(var i = 0, len = data.length; i < len; i++) {
257
258            if (data[i].parent_id == null) {
259
260                if (data[i].name != "No Office") {
261                    newOffice = "" +
262                        "<li data-value='"+data[i].name+"' data-country='"+data[i].name+"' class=\"dropdown-item\">"+data[i].name+"</li>";
263
264                    var filterJobs = document.getElementById("filterJobs");
265                    filterJobs.insertAdjacentHTML('beforeend',newOffice);
266
267                }
268            }
269        }
270
271        //  $.getScript("/js/custom.js", function(){
272        //     alert("Script loaded and executed.");
273        // });
274
275    });
276
277}
278
279
280function getGreenHouseJobsByDepartment(department_title, officesList) {
281    var url = "https://boards-api.greenhouse.io/v1/boards/playtikaltd/jobs";
282    var jobsSection = document.getElementById("myJob");
283    var l = 0;
284    var officesCountry = officesList;
285
286    function getCountryByOfficeName(name) {
287        const countriesList = [];
288        countriesList["Chicago"] = "USA";
289        countriesList["Las Vegas"] = "USA";
290        countriesList["Santa Monica"] = "USA";
291        countriesList["4010562101"] = "Australia";
292        countriesList["Newport"] = "Austria";
293        countriesList["Minsk"] = "Belarus";
294        countriesList["Brest ( Remote )"] = "Belarus";
295        countriesList["Helsinki"] = "Finland";
296        countriesList["Herzliya"] = "Israel";
297        countriesList["Ramat Gan"] = "Israel";
298        countriesList["Warsaw"] = "Poland";
299        countriesList["Bucharest"] = "Romania";
300        countriesList["Bucharest R&D"] = "Romania";
301        countriesList["Amsterdam"] = "Netherlands";
302        countriesList["Madrid"] = "Spain";
303        countriesList["Vinnytsia"] = "Ukraine";
304        countriesList["Lausanne"] = "Switzerland";
305        countriesList["Kyiv"] = "Ukraine";
306        countriesList["Dnipro"] = "Ukraine";
307        countriesList["London"] = "United-Kingdom";
308
309        return countriesList[name];
310    }
311
312    function createJobCard(jobData, locationName) {
313        var mobileTitle = jobData.title;
314        if (jobData.title.length > 21) {
315            mobileTitle = jobData.title.substr(0, 21) + '..';
316        }
317
318        if (jobData.title.length > 48) {
319            jobData.title = jobData.title.substr(0, 41) + '..';
320        }
321
322        var newCard = document.createElement('card');
323        var cName = getCountryName(locationName);
324
325        var cId = officesCountry["offices"][locationName];
326        var countryName = officesCountry["countries"][cId];
327
328        var ukfix = "";
329        if (locationName === "United Kingdom") {
330            ukfix = "<span style='display: none;'>United-Kingdom</span>";
331            locationName = "United-Kingdom";
332        }
333
334        if (countryName === undefined) {
335            countryName = getCountryByOfficeName(locationName);
336            if (!countryName) {
337                countryName = locationName;
338            }
339        }
340
341        var locationTitle = "<span class='hidden-xs'>" + locationName + ",</span> " + countryName + " </span> ";
342        if (locationName === countryName) {
343            locationTitle = "<span>" + locationName + "</span> &nbsp;</span> ";
344        }
345
346        locationTitle = locationTitle.replace("-", " ");
347        // check param with position
348        var gh_src_p = safeGhSrc(getCookie('gh_src_p'));
349        var gh_jid_p = safeGhJid(getCookie('gh_jid_p'));
350
351        var ghParam = "";
352
353        if (gh_src_p && gh_jid_p) {
354            if (String(jobData.id) === String(gh_jid_p)) {
355                ghParam = "&gh_src=" + encodeURIComponent(gh_src_p);
356            }
357        }
358
359        var gh_src = safeGhSrc(getCookie('gh_src'));
360
361        if (gh_src && ghParam === "") {
362            ghParam = "&gh_src=" + encodeURIComponent(gh_src);
363        }
364
365
366        newCard.innerHTML =
367            "<div class='card " + cName + " " + locationName + " " + countryName + " '>" +
368            ukfix +
369            "<a href='../../position/?gh_jid=" + jobData.id + ghParam + "'>" +
370            "<span class='hide-mobile'>" + jobData.title + "</span>" +
371            "<span class='hide-desktop-inline'>" + mobileTitle + "</span>" +
372            "<div class='align-right'>" +
373            "<span class='job-location'>" + locationTitle +
374            "<svg class='bi bi-chevron-right' viewBox='0 0 16 16' fill='currentColor' xmlns='http://www.w3.org/2000/svg'>" +
375            "<path fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'></path>" +
376            "</svg></div></a></div>";
377
378        return newCard;
379    }
380
381    function handleLocations(jobData) {
382        const separators = [' · ', '·', ';', '•'];
383        let locations = [jobData.location.name];
384
385        for (const separator of separators) {
386
387            const tempLocations = [];
388
389            for (const loc of locations) {
390                if (loc.includes(separator)) {
391                    tempLocations.push(...loc.split(separator));
392                } else {
393                    tempLocations.push(loc);
394                }
395            }
396
397            locations = tempLocations;
398        }
399
400        locations.forEach(location => {
401            const trimmedLocation = location.trim();
402            if (trimmedLocation) {
403                const card = createJobCard(jobData, trimmedLocation);
404                jobsSection.appendChild(card);
405                l++;
406            }
407        });
408    }
409
410    function metadataWebGroup(item, jobData, department_title) {
411        var department_title = department_title.toLowerCase();
412        department_title = department_title.replace('-', ' ');
413        department_title = fixDepartmentNameByName(department_title);
414
415        if (item.name === "Website Group") {
416            var WebsiteGroup = item.value;
417            if (WebsiteGroup != null) {
418                WebsiteGroup = WebsiteGroup.toLowerCase();
419                WebsiteGroup = fixDepartmentNameByName(WebsiteGroup);
420            }
421
422            if (WebsiteGroup === department_title) {
423                handleLocations(jobData);
424            }
425        }
426    }
427
428    jQuery.getJSON(url, function(data) {
429        var data = data.jobs;
430        for(var i = 0, len = data.length; i < len; i++) {
431            data[i].metadata.forEach(item => metadataWebGroup(item, data[i], department_title));
432
433            if (department_title === "All") {
434                department_title = "";
435            }
436
437            if (data[i].location != null && department_title === "all") {
438                if (data[i].location.name !== "") {
439                    handleLocations(data[i]);
440                }
441            }
442        }
443
444        if (l !== 0) {
445            document.getElementById("countOpenings").innerHTML = l;
446        }
447
448        getLocFromIP();
449        getCurrentOffice();
450        return i;
451    });
452}
453
454function getCurrentOffice(countrySelect = null) {
455
456
457    if (countrySelect != null) {
458        countryCode = countrySelect;
459    }
460    else {
461        var countryCode = getCookie("countryCode");
462
463        if (countryCode == "GB")  {
464            countryCode = "UK";
465
466        }
467
468
469
470    }
471
472    countryName = checkCountryCode(countryCode);
473
474
475    if (countryCode == "UA") {
476        var countryName = "Ukraine";
477    }
478
479    $('#filterJobs li').each(function() {
480        if ($(this).data('country') === countryName) {
481            $(this).addClass('selected');
482        }
483    });
484    checkStringCat();
485
486
487    $('#currentOfficeSelect').text(getCountryName(countryCode));
488    var rex = new RegExp(getCountryName(countryCode));
489    if(rex =="/all/"){clearFilter()}else{
490        jQuery('#myJob .card').hide();
491    }
492
493    jQuery('.card').filter(function() {
494
495        return rex.test($(this).text());
496    }).show();
497
498    var allElems = jQuery("#myJob .card");
499
500    var count = 0;
501    for (var i = 0; i < allElems.length; i++)
502    {
503
504        var thisElem = allElems[i];
505        if (thisElem.style.display != 'none')
506        {
507            count++;
508        }
509    }
510    jQuery("#positionsCountHaeder").css( "display", "block" );
511
512
513    if (count == 0) {
514        //var countryNameSelected = getCountryName(countryCode);
515        jQuery("#noPositionsCount").css( "display", "block" );
516        jQuery("#positionsCountHaeder").css( "display", "none" );
517        jQuery('#positionCountry').text(getCountryName(countryCode));
518        //jQuery('#positionCountry').text(countryNameSelected);
519    }
520    else {
521        jQuery("#noPositionsCount").css( "display", "none" );
522        jQuery("#positionsCountHaeder").css( "display", "block" );
523
524    }
525
526    jQuery("#countOpenings").text(count+"");
527    return i;
528}
529
530function htmlDecode(input){
531    var e = document.createElement('div');
532    e.innerHTML = input;
533    return e.childNodes[0].nodeValue;
534}
535
536
537function getPositionById (positionId) {
538
539    var url = "https://boards-api.greenhouse.io/v1/boards/playtikaltd/jobs/"+positionId+"";
540
541    jQuery.getJSON(url, function(data, status) {
542
543
544        var positionName = data.title;
545
546        var newTitle = "Playtika Careers - " +positionName;
547        document.title = newTitle;
548        setCookie('position',positionName, 30);
549        $("meta[property='og\\:title']").attr("content", "Playtika Careers - "+positionName);
550
551        var positionName = positionName.toUpperCase();
552        var positionDescription = data.content;
553
554        var positionResponsibilities = data.Responsibilities;
555        var videoUrl = data.Video_URL;
556        function metadata(item) {
557
558            if (item.name == "Video URL") {
559                var videoUrl = item.value;
560
561                if (videoUrl != null) {
562                    if (videoUrl.startsWith("https://player.vimeo.com/video/") == true) {
563                        //var videoUrl = 'https://player.vimeo.com/video/470875807';
564
565
566                        var video = '<iframe src="' + videoUrl + '" width="100%" height="360" frameBorder="0" allow="autoplay; fullscreen; picture-in-picture" allowFullScreen></iframe>';
567                        if (videoUrl != null) {
568                            $('#video').html(video);
569                            $('#video').show();
570
571                        }
572                    }
573                }
574
575            }
576            if (item.name == "Website Group") {
577                var WebsiteGroup = item.value;
578                WebsiteGroup = WebsiteGroup.toLowerCase();
579                $.get("/img/titles/"+WebsiteGroup+".png")
580                    .done(function() {
581                        var newPositionImageTitle = document.createElement('positionImageTitle');
582                        newPositionImageTitle.innerHTML = "<img class='position-title-image' src='/img/titles/"+WebsiteGroup+".png' alt='"+WebsiteGroup+"'>";
583                        positionImageSection.appendChild(newPositionImageTitle);
584
585
586
587                    })
588
589
590            }
591        }
592
593        data.metadata.forEach(metadata);
594
595
596
597        if (data.requirements == null) {
598            jQuery('#requirements-title').hide();
599
600        }
601        else {
602            jQuery('#requirements-title').show();
603        }
604
605
606        if (data.Responsibilities == null) {
607            jQuery('#responsibilitie-section').hide();
608        }
609        else {
610            jQuery('#responsibilitie-section').show();
611        }
612
613
614        //data.location_object.country  =  data.location_object.country.replace("GB","UK");
615        document.getElementById("description").innerHTML = htmlDecode(positionDescription);
616        // document.getElementById("responsibilities").innerHTML = positionResponsibilities;
617        //document.getElementById("requirements").innerHTML = data.requirements;
618        document.getElementById("positionName").innerHTML = positionName;
619        //document.getElementById("positionLocation").innerHTML = ""+data.location+","+data.location_object.country+"";
620
621        jQuery('#job-desc').show();
622        jQuery('#job-apply').show();
623
624        var departmentName = getCookie("department");
625        var currentLocation = window.location.href;
626
627        if (currentLocation.includes("/he/")) {
628            $(".department-link").attr("href", "/he/careers/"+departmentName+"");
629        }
630        else {
631            $(".department-link").attr("href", "/careers/"+departmentName+"");
632        }
633        var imgTitle = data["departments"][0].name;
634        // var imgTitle = data["Website Group"];
635
636
637
638    }).fail(function(jqxhr){
639        window.location.href = "/careers";
640    });
641
642
643}
644
645
646
647function getSearchParameters() {
648    var prmstr = window.location.search.substr(1);
649    return prmstr != null && prmstr != "" ? transformToAssocArray(prmstr) : {};
650}
651
652function transformToAssocArray( prmstr ) {
653    var params = {};
654    var prmarr = prmstr.split("&");
655    for ( var i = 0; i < prmarr.length; i++) {
656        var tmparr = prmarr[i].split("=");
657        params[tmparr[0]] = tmparr[1];
658    }
659    return params;
660}
661
662function setCookie(cname, cvalue, exdays) {
663    var d = new Date();
664    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
665    var expires = "expires=" + d.toUTCString();
666
667    document.cookie =
668        encodeURIComponent(cname) + "=" + encodeURIComponent(cvalue) +
669        ";" + expires +
670        ";path=/;SameSite=Lax";
671}
672
673function getCookie(cname) {
674    var name = encodeURIComponent(cname) + "=";
675    var ca = document.cookie.split(';');
676
677    for (var i = 0; i < ca.length; i++) {
678        var c = ca[i].trim();
679
680        if (c.indexOf(name) === 0) {
681            try {
682                return decodeURIComponent(c.substring(name.length));
683            } catch (e) {
684                return "";
685            }
686        }
687    }
688
689    return "";
690}
691
692function safeGhSrc(value) {
693    if (!value) return "";
694    return String(value).replace(/[^a-zA-Z0-9_-]/g, "");
695}
696
697function safeGhJid(value) {
698    if (!value) return "";
699    return String(value).replace(/[^0-9]/g, "");
700}
701
702function getLocFromIP(){
703
704
705    var countryCode = getCookie("countryCode");
706
707    if(countryCode == null || countryCode == '') {
708        var chckCotnryCode = "IL";
709
710        if (chckCotnryCode == "IL" || chckCotnryCode == "Israel") {
711            var slectedCountry = "IL";
712            setCookie('countryCode', "IL", 1);
713        }
714    }
715    else {
716        var slectedCountry = countryCode;
717    }
718
719    getCurrentOffice(slectedCountry);
720
721}
722
723
724

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.