-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestportal
1 lines (1 loc) · 25 KB
/
testportal
1
javascript: function test() { setTimeout(async () => { await navigator.clipboard.readText().then((clipboardString) => { const obj = JSON.parse(clipboardString); function get_sel(x) { var res = ""; for (var i = 0; i < x.options.length; i++) { if (x.options[i].value == x.value) { res = x.options[i].textContent; } }; return (res) } function get_full_state(stateName) { const stateNameToAbbreviation = { 'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ', 'Arkansas': 'AR', 'California': 'CA', 'Colorado': 'CO', 'Connecticut': 'CT', 'Delaware': 'DE', 'Florida': 'FL', 'Georgia': 'GA', 'Hawaii': 'HI', 'Idaho': 'ID', 'Illinois': 'IL', 'Indiana': 'IN', 'Iowa': 'IA', 'Kansas': 'KS', 'Kentucky': 'KY', 'Louisiana': 'LA', 'Maine': 'ME', 'Maryland': 'MD', 'Massachusetts': 'MA', 'Michigan': 'MI', 'Minnesota': 'MN', 'Mississippi': 'MS', 'Missouri': 'MO', 'Montana': 'MT', 'Nebraska': 'NE', 'Nevada': 'NV', 'New Hampshire': 'NH', 'New Jersey': 'NJ', 'New Mexico': 'NM', 'New York': 'NY', 'North Carolina': 'NC', 'North Dakota': 'ND', 'Ohio': 'OH', 'Oklahoma': 'OK', 'Oregon': 'OR', 'Pennsylvania': 'PA', 'Rhode Island': 'RI', 'South Carolina': 'SC', 'South Dakota': 'SD', 'Tennessee': 'TN', 'Texas': 'TX', 'Utah': 'UT', 'Vermont': 'VT', 'Virginia': 'VA', 'Washington': 'WA', 'West Virginia': 'WV', 'Wisconsin': 'WI', 'Wyoming': 'WY' }; const abbreviation = stateNameToAbbreviation[stateName]; if (abbreviation) { return abbreviation; } else { return stateName; } }; function get_short_state(statename) { const abbreviationToStateName = { 'AL': 'Alabama', 'AK': 'Alaska', 'AZ': 'Arizona', 'AR': 'Arkansas', 'CA': 'California', 'CO': 'Colorado', 'CT': 'Connecticut', 'DE': 'Delaware', 'FL': 'Florida', 'GA': 'Georgia', 'HI': 'Hawaii', 'ID': 'Idaho', 'IL': 'Illinois', 'IN': 'Indiana', 'IA': 'Iowa', 'KS': 'Kansas', 'KY': 'Kentucky', 'LA': 'Louisiana', 'ME': 'Maine', 'MD': 'Maryland', 'MA': 'Massachusetts', 'MI': 'Michigan', 'MN': 'Minnesota', 'MS': 'Mississippi', 'MO': 'Missouri', 'MT': 'Montana', 'NE': 'Nebraska', 'NV': 'Nevada', 'NH': 'New Hampshire', 'NJ': 'New Jersey', 'NM': 'New Mexico', 'NY': 'New York', 'NC': 'North Carolina', 'ND': 'North Dakota', 'OH': 'Ohio', 'OK': 'Oklahoma', 'OR': 'Oregon', 'PA': 'Pennsylvania', 'RI': 'Rhode Island', 'SC': 'South Carolina', 'SD': 'South Dakota', 'TN': 'Tennessee', 'TX': 'Texas', 'UT': 'Utah', 'VT': 'Vermont', 'VA': 'Virginia', 'WA': 'Washington', 'WV': 'West Virginia', 'WI': 'Wisconsin', 'WY': 'Wyoming' }; const abbreviation = abbreviationToStateName[stateName]; if (abbreviation) { return abbreviation; } else { return stateName; } } var dic = {};if (document.domain == "secure.bswift.com") { if (document.getElementById("MasterPage_ctl00_Base_Content_pageContent_WrapperMemberView") != null) { dic = { "SSN": "Social Security Number", "ID": "Employee ID", "DOH": "Hire Date", "ELIG_DATE": "", "TERM_DATE": "", "FIRST_NAME": "First Name", "MIDDLE_NAME": "Middle Initial", "LAST_NAME": "Last Name", "DOB": "Date of Birth", "ADD1": "Address 1", "ADD2": "Address 2", "ADDCITY": "City", "ADDSTATE": "State", "ADDZIP": "Zip", "HOMEPHONE": "Home Phone", "WORK_EMAIL": "Work Email", "PERSONAL_EMAIL": "Home Email", "GENDER": "Gender", "HOUR_PER_WEEK": "Hours per Week", "ANNUAL_SALARY": "Annual Salary", }; var allPageTags = document.getElementsByTagName("td"); for (i = 0; i < allPageTags.length; i++) { for (var key in dic) { if (allPageTags[i].textContent != "") { if (dic[key] == allPageTags[i].textContent) { obj.ee_BASIC_info[key] = allPageTags[i].nextElementSibling.textContent; } } } }; } if (document.getElementById("depInfoRelationshipMaskedID") != null) { dic_dep = { "FIRST_NAME": "depInfoFirstName", "MIDDLE_NAME": "depInfoMiddleInitial", "LAST_NAME": "depInfoLastName", "DOB": "depInfoBirthDate", "SSN": "depInfoSSN", "ADD1": "depAddressAddressLine1", "ADD2": "depAddressAddressLine2", "ADDCITY": "depAddressCity", "ADDZIP": "depAddressZip", "ADDCOUNTY": "depAddressCounty" }; var x = document.getElementById("depInfoRelationshipMaskedID"); relation = get_sel(x); if (relation in obj.ee_DEPT_info) { if (obj.ee_DEPT_info[relation]["FIRST_NAME"] == "") { for (key in dic_dep) { if (document.getElementById(dic_dep[key]) != null) { if (document.getElementById(dic_dep[key]).value != "") { if (key in obj.ee_DEPT_info[relation]) { obj.ee_DEPT_info[relation][key] = document.getElementById(dic_dep[key]).value } } } }; if (document.getElementById("depInfoGender0") != null) { if (document.getElementById("depInfoGender0").getAttribute("checked") != null) { obj.ee_DEPT_info[relation].GENDER = "M" }; if (document.getElementById("depInfoGender1").getAttribute("checked") != null) { obj.ee_DEPT_info[relation].GENDER = "F" }; }; } else { for (key in dic_dep) { if (document.getElementById(dic_dep[key]) != null) { if (document.getElementById(dic_dep[key]).value != "") { if (key in obj.ee_DEPT_info[relation]) { obj.ee_DEPT_info[relation][key] = obj.ee_DEPT_info[relation][key] + "|" + document.getElementById(dic_dep[key]).value } } } }; if (document.getElementById("depInfoGender0") != null) { if (document.getElementById("depInfoGender0").getAttribute("checked") != null) { obj.ee_DEPT_info[relation].GENDER = obj.ee_DEPT_info[relation].GENDER + "|" + "M" }; if (document.getElementById("depInfoGender1").getAttribute("checked") != null) { obj.ee_DEPT_info[relation].GENDER = obj.ee_DEPT_info[relation].GENDER + "|" + "F" }; }; }; } } };if (document.domain.includes('ease.com')) { if (document.getElementById("detailsModal") != null) { if (document.getElementById("detailsModal").getAttribute("class") == "c-modal c-modal--responsive c-modal__background fadeInTop") { dic = { "DATE_OF_HIRE": "Hire Date", "FULL_PART_TIME": "Type", "TERM_REASON": "Termination Reason", "ANNUAL_SALARY": "Compensation", "HOUR_PER_WEEK": "Hours", "JOB_TITLE": "Job Title", "WORK_EMAIL": "Email", "PERSONAL_EMAIL": "Personal Email", "HOMEPHONE": "Personal Phone", "WORKPHONE": "Work Phone", "MARITAL_STATUS": "Marital Status", }; var cmb = document.getElementsByClassName('c-modal__body'); for (i = 0; i < cmb.length; i++) { if (cmb[i].children[0].getAttribute('class') == 'o-input-groups') { var cmb_el = cmb[i]; break; } } if (cmb_el) { var el_up = cmb_el.getElementsByClassName('o-input-groups')[0]; var allPageTags = el_up.getElementsByTagName("strong"); for (key in dic) { for (i = 0; i < allPageTags.length; i++) { var info = allPageTags[i].parentElement.textContent; t_title = info.split(":")[0]; t_value = info.split(":")[1]; if (dic[key] == t_title) { if (t_title == 'Compensation') { if (t_value.includes('Hourly')) { obj.ee_BASIC_info['PAY_PERIOD'] = 'H'; obj.ee_BASIC_info['HOURLY_SALARY'] = t_value.trim().split('/')[0].trim(); } else { obj.ee_BASIC_info['PAY_PERIOD'] = 'A'; obj.ee_BASIC_info['ANNUAL_SALARY'] = t_value.trim().split('/')[0].trim(); }; } else { obj.ee_BASIC_info[key] = t_value.trim() } } } }; var el_down = cmb_el.getElementsByClassName('c-list-view')[0].getElementsByClassName('c-list-view__body')[0]; var erow = el_down.getElementsByClassName("e-row"); for (i = 0; i < erow.length; i++) { var ediv = erow[i].getElementsByTagName("div"); relation = ediv[1].textContent.trim(); if (relation == 'Employee') { obj.ee_BASIC_info["FIRST_NAME"] = ediv[0].children[0].textContent.trim(); if (ediv[0].children.length > 2) { obj.ee_BASIC_info["MIDDLE_NAME"] = ediv[0].children[1].textContent.trim(); obj.ee_BASIC_info["LAST_NAME"] = ediv[0].children[2].textContent.trim(); } else { obj.ee_BASIC_info["LAST_NAME"] = ediv[0].children[1].textContent.trim(); }; obj.ee_BASIC_info["SSN"] = ediv[2].textContent.trim(); obj.ee_BASIC_info["GENDER"] = ediv[3].textContent.trim()[0]; obj.ee_BASIC_info["DOB"] = ediv[4].textContent.split(" ")[0].trim(); if (ediv[5].innerHTML.split('<br>').length > 3) { var len_add = ediv[5].innerHTML.split('<br>').length; obj.ee_BASIC_info.ADDZIP = ediv[5].innerHTML.split('<br>')[len_add - 1].trim(); obj.ee_BASIC_info.ADDSTATE = ediv[5].innerHTML.split('<br>')[len_add - 2].trim(); obj.ee_BASIC_info.ADDCITY = ediv[5].innerHTML.split('<br>')[len_add - 3].trim(); obj.ee_BASIC_info.ADD1 = ediv[5].innerHTML.split('<br>')[0].trim(); if (ediv[5].innerHTML.split('<br>').length > 4) { obj.ee_BASIC_info.ADD2 = ediv[5].innerHTML.split('<br>')[1].trim(); }; } }; const typeDict = { "Spouse": ["Spouse", "Spouse-Ex", "Domestic Partner"], "Child": ["Child", "Child-Domestic Partner", "Child-Adopted", "Child-Legal Guardian", "Child-Foster", "Child-Step", "Child-Grandchild"] }; function getType(name) { for (const [type, keywords] of Object.entries(typeDict)) { if (keywords.some(keyword => name.includes(keyword))) { type_dic = [type, name]; return type_dic; } } return ""; }; var relation_dic = getType(relation); if (relation_dic != '' && relation_dic[0] in obj.ee_DEPT_info) { if (obj.ee_DEPT_info[relation_dic[0]]["FIRST_NAME"] == "") { if (ediv[0].children.length > 2) { obj.ee_DEPT_info[relation_dic[0]]["MIDDLE_NAME"] = ediv[0].children[1].textContent.trim(); obj.ee_DEPT_info[relation_dic[0]]["LAST_NAME"] = ediv[0].children[2].textContent.trim(); } else { obj.ee_DEPT_info[relation_dic[0]]["LAST_NAME"] = ediv[0].children[1].textContent.trim(); }; obj.ee_DEPT_info[relation_dic[0]]["FIRST_NAME"] = ediv[0].children[0].textContent.trim(); obj.ee_DEPT_info[relation_dic[0]]["SSN"] = ediv[2].textContent.trim(); obj.ee_DEPT_info[relation_dic[0]]["GENDER"] = ediv[3].textContent.trim()[0]; obj.ee_DEPT_info[relation_dic[0]]["DOB"] = ediv[4].textContent.split(" ")[0].trim(); obj.ee_DEPT_info[relation_dic[0]]["RELATION"] = relation_dic[1]; } else { if (ediv[0].children.length > 2) { obj.ee_DEPT_info[relation_dic[0]]["MIDDLE_NAME"] = obj.ee_DEPT_info[relation_dic[0]]["MIDDLE_NAME"] + "|" + ediv[0].children[1].textContent.trim(); obj.ee_DEPT_info[relation_dic[0]]["LAST_NAME"] = obj.ee_DEPT_info[relation_dic[0]]["LAST_NAME"] + "|" + ediv[0].children[2].textContent.trim(); } else { obj.ee_DEPT_info[relation_dic[0]]["LAST_NAME"] = obj.ee_DEPT_info[relation_dic[0]]["LAST_NAME"] + "|" + ediv[0].children[1].textContent.trim(); }; obj.ee_DEPT_info[relation_dic[0]]["FIRST_NAME"] = obj.ee_DEPT_info[relation_dic[0]]["FIRST_NAME"] + "|" + ediv[0].children[0].textContent.trim(); obj.ee_DEPT_info[relation_dic[0]]["SSN"] = obj.ee_DEPT_info[relation_dic[0]]["SSN"] + "|" + ediv[2].textContent.trim(); obj.ee_DEPT_info[relation_dic[0]]["GENDER"] = obj.ee_DEPT_info[relation_dic[0]]["GENDER"] + "|" + ediv[3].textContent.trim()[0]; obj.ee_DEPT_info[relation_dic[0]]["DOB"] = obj.ee_DEPT_info[relation_dic[0]]["DOB"] + "|" + ediv[4].textContent.split(" ")[0].trim(); obj.ee_DEPT_info[relation_dic[0]]["RELATION"] = obj.ee_DEPT_info[relation_dic[0]]["RELATION"] + "|" + relation_dic[1]; }; } } } }; } else { if (document.getElementById("dependentModalTrigger") == null) { dic = { "FIRST_NAME": "firstname", "MIDDLE_NAME": "middlename", "LAST_NAME": "lastname", "DOB": "birthdate", "SSN": "ssn", "ADD1": "addr1", "ADD2": "addr2", "ADDZIP": "zip", "HOMEPHONE": "homephone", "WORKPHONE": "workphone", "ADDCITY": "city", "ADDCOUNTY": "county", "ANNUAL_SALARY": "compensationAmount", "HOUR_PER_WEEK": "hours", "DATE_OF_HIRE": "hiredate", "PERSONAL_EMAIL": "personalemail", }; for (key in dic) { if (document.getElementById(dic[key]) != null) { if (document.getElementById(dic[key]).value != "") { if (key in obj.ee_BASIC_info) { obj.ee_BASIC_info[key] = document.getElementById(dic[key]).value } } } }; if (obj.ee_BASIC_info.ANNUAL_SALARY!='' && obj.ee_BASIC_info.HOUR_PER_WEEK==''){ obj.ee_BASIC_info['PAY_PERIOD'] = 'A'; }else if (obj.ee_BASIC_info.ANNUAL_SALARY=='' && obj.ee_BASIC_info.HOUR_PER_WEEK!=''){ obj.ee_BASIC_info['PAY_PERIOD'] = 'H'; }; if (document.getElementById('c-input__label-sex') != null) { if (document.getElementById('c-input__label-sex').parentElement.nextElementSibling != null) { obj.ee_BASIC_info.GENDER = document.getElementById('c-input__label-sex').parentElement.nextElementSibling.textContent } }; var state_el = document.querySelector("#stateRow > div > div.c-input > div.c-select__handle > div.c-input__value"); if (state_el) { obj.ee_BASIC_info.ADDSTATE = state_el.textContent }; var married_el = document.querySelector("#maritalRow > div > div.c-input > div.c-select__handle > div.c-input__value"); if (married_el) { obj.ee_BASIC_info.MARITAL_STATUS = married_el.textContent }; } else if (document.getElementById('dependentModalTrigger') != null) { var dept_obj = JSON.parse(document.getElementById('dependentModalTrigger').value); for (i = 0; i < dept_obj.data.length; i++) { if (dept_obj.data[i].key == "relationship") { relation_v = (dept_obj.data[i].value); break; } }; const typeDict = { "Spouse": ["Spouse", "Spouse-Ex", "Domestic Partner"], "Child": ["Child", "Child-Domestic Partner", "Child-Adopted", "Child-Legal Guardian", "Child-Foster", "Child-Step", "Child-Grandchild"] }; function getType(name) { for (const [type, keywords] of Object.entries(typeDict)) { if (keywords.some(keyword => name.includes(keyword))) { type_dic = [type, name]; return type_dic; } } return ""; }; var relation_dic = getType(relation_v); if (relation_dic != '' && relation_dic[0] in obj.ee_DEPT_info) { dic = { "FIRST_NAME": "firstname", "MIDDLE_NAME": "middlename", "LAST_NAME": "lastname", "GENDER": "sex", "DOB": "birthdate", "SSN": "ssn", "ADD1": "addr1", "ADD2": "addr2", "ADDZIP": "zip", "HOMEPHONE": "homephone", "WORKPHONE": "workphone", "ADDCITY": "city", "ADDCOUNTY": "county", }; if (obj.ee_DEPT_info[relation_dic[0]]["FIRST_NAME"] == "") { for (i = 0; i < dept_obj.data.length; i++) { for (key in dic) { if (dept_obj.data[i].key == dic[key]) { obj.ee_DEPT_info[relation_dic[0]][key] = dept_obj.data[i].value } } }; obj.ee_DEPT_info[relation_dic[0]]['RELATION'] = relation_dic[1]; } else { for (i = 0; i < dept_obj.data.length; i++) { for (key in dic) { if (dept_obj.data[i].key == dic[key]) { obj.ee_DEPT_info[relation_dic[0]][key] = obj.ee_DEPT_info[relation_dic[0]][key] + "|" + dept_obj.data[i].value } } }; } } else { alert('this relationship is not valid in JS, need manual entry') }; }; } };if (document.domain.includes("employeenavigator.com")) { if (document.querySelector("#companyWall > div > div.wall_header") != null) { const wall_dic = {}; const tables = document.querySelector("#event_print > div:nth-child(3) > div:nth-child(1)").querySelectorAll('.table'); for (t = 0; t < tables.length; t++) { const k = tables[t].previousElementSibling.textContent.trim(); const tableRows = tables[t].querySelectorAll(' tbody tr'); const info = {}; tableRows.forEach((row) => { const key = row.querySelector("td.bold").textContent.trim(); const value = row.querySelector("td:not(.bold)").textContent.trim(); info[key] = value; }); wall_dic[k] = info; } if (Object.keys(wall_dic).length > 0) { dic = { "First Name:": "FIRST_NAME", "Last Name:": "LAST_NAME", "Middle:": "MIDDLE_NAME", "SSN:": "SSN", "DOB:": "DOB", "Sex:": "GENDER", "Marital Status:": "MARITAL_STATUS", "Home Phone:": "HOMEPHONE", "Work Phone:": "WORKPHONE", "Email:": "WORK_EMAIL", "Home Address 1:": "ADD1", "Home Address 2:": "ADD2", "City:": "ADDCITY", "State:": "ADDSTATE", "Zip:": "ADDZIP", "County:": "ADDCOUNTY", "Date of Hire:": "DATE_OF_HIRE", "Base Salary:": "ANNUAL_SALARY", "Hours Worked Per Week:": "HOUR_PER_WEEK", "Job Title:": "JOB_TITLE", }; const tier = ['Employee Information', 'Employment Information']; for (kitem of tier) { for (var wkdk in wall_dic[kitem]) { if (wkdk in dic && wall_dic[kitem][wkdk] != '') { if (dic[wkdk] in obj.ee_BASIC_info) { if (dic[wkdk] == "HOMEPHONE" || dic[wkdk] == "WORKPHONE") { obj.ee_BASIC_info[dic[wkdk]] = wall_dic[kitem][wkdk].replace(/[^\d]+/g, ''); } else { obj.ee_BASIC_info[dic[wkdk]] = wall_dic[kitem][wkdk]; } } } } } const SPkitem_list = ['Employment Information', 'Event Details', 'Employee Information']; const dpt_dic = { "DOB:": "DOB", "Disabled:": "IF_DISABLED", "First Name:": "FIRST_NAME", "Last Name:": "LAST_NAME", "Middle Name:": "MIDDLE_NAME", "Relationship:": "RELATION", "SSN:": "SSN", "Sex:": "GENDER", }; for (var kitem in wall_dic) { if (!SPkitem_list.includes(kitem)) { if ('Relationship:' in wall_dic[kitem] && wall_dic[kitem]['Relationship:'] in obj.ee_DEPT_info) { var rel = wall_dic[kitem]['Relationship:']; for (var wkdk in wall_dic[kitem]) { if (wkdk in dpt_dic && wall_dic[kitem][wkdk] != '') { if (obj.ee_DEPT_info[rel][dpt_dic[wkdk]] == '') { obj.ee_DEPT_info[rel][dpt_dic[wkdk]] = wall_dic[kitem][wkdk]; } else { obj.ee_DEPT_info[rel][dpt_dic[wkdk]] = wall_dic[kitem][wkdk] + '|' + obj.ee_DEPT_info[rel][dpt_dic[wkdk]]; } } } } } } } } else { if (document.getElementById("LkpRelationshipId") == null) { dic = { "SSN": "SSN", "FIRST_NAME": "FirstName", "MIDDLE_NAME": "MiddleName", "LAST_NAME": "LastName", "JOB_TITLE": "JobTitle", "DATE_OF_HIRE": "HireDate", "DOB": "DOB", }; for (key in dic) { if (document.getElementById(dic[key]) != null) { if (document.getElementById(dic[key]).value != "") { if (key in obj.ee_BASIC_info) { obj.ee_BASIC_info[key] = document.getElementById(dic[key]).value; } } } }; if (document.body.textContent.includes('Phones')) { var parentDiv = document.querySelector("#contact_phone_list > div > h4").parentElement.children[1].getElementsByTagName("table"); if (parentDiv.length > 0) { var trow = parentDiv[0].getElementsByTagName("tbody")[0].getElementsByTagName("tr")[0]; var typeCell = trow.getElementsByTagName("td")[0]; var numberCell = trow.getElementsByTagName("td")[1]; if (typeCell.innerText == 'Home') { obj.ee_BASIC_info.HOMEPHONE = numberCell.innerText.replace(/[^\d]+/g, ''); } else { obj.ee_BASIC_info.WORKPHONE = numberCell.innerText.replace(/[^\d]+/g, ''); } } const primary_email = document.getElementById('LkpPrimaryEmailTypeId').options[document.getElementById('LkpPrimaryEmailTypeId').selectedIndex].text; if (primary_email == 'Work') { obj.ee_BASIC_info['WORK_EMAIL'] = document.getElementById('WorkEmail').value; } else if (primary_email == 'Personal') { obj.ee_BASIC_info['PERSONAL_EMAIL'] = document.getElementById('PersonalEmail').value; } else { obj.ee_BASIC_info['WORK_EMAIL'] = document.getElementById('WorkEmail').value; obj.ee_BASIC_info['PERSONAL_EMAIL'] = document.getElementById('PersonalEmail').value; }; } dic_sel = { "PAY_PERIOD": "LkpPayrollGroup", "DIVISION": "LkpDivision", "DEPARTMENT": "LkpDept", "FULL_PART_TIME": "LkpClientClass", }; for (key in dic_sel) { if (document.getElementById(dic[key]) != null) { if (get_sel(document.getElementById(dic_sel[key])) != "") { if (key in obj.ee_BASIC_info) { obj.ee_BASIC_info[key] = document.getElementById(dic_sel[key]).selectedOptions[0].textContent } } } }; if (document.getElementById("DOB") != null) { var allPageTags = document.getElementsByTagName("input"); for (i = 0; i < allPageTags.length; i++) { if (allPageTags[i].name == 'Gender') { if (allPageTags[i].checked == true) { obj.ee_BASIC_info.GENDER = (allPageTags[i].value) } } } }; if (window.__PROFILE_ADDRESS_LIST__ != null) { obj.ee_BASIC_info.ADD1 = window.__PROFILE_ADDRESS_LIST__[0].Address1; if (window.__PROFILE_ADDRESS_LIST__[0].Address2 != null) { obj.ee_BASIC_info.ADD2 = window.__PROFILE_ADDRESS_LIST__[0].Address2; } obj.ee_BASIC_info.ADDCITY = window.__PROFILE_ADDRESS_LIST__[0].City; obj.ee_BASIC_info.ADDSTATE = window.__PROFILE_ADDRESS_LIST__[0].StateDisplay; if (window.__PROFILE_ADDRESS_LIST__[0].Zip.length >= 5) { obj.ee_BASIC_info.ADDZIP = window.__PROFILE_ADDRESS_LIST__[0].Zip.slice(0, 5); }; }; if (document.getElementById('LkpMaritalStatusId') != null) { if (document.getElementById('LkpMaritalStatusId').selectedOptions[0].textContent != '--Select--') { obj.ee_BASIC_info.MARITAL_STATUS = document.getElementById('LkpMaritalStatusId').selectedOptions[0].textContent }; } if (document.documentElement.innerText.includes("Annual base salary")) { list_e = [document.querySelectorAll('div[class="form-control-static"]')[0], document.querySelectorAll('div[class="form-control-static"]')[1], document.querySelector("#hris_form > div > div.col-md-9 > div:nth-child(10) > div.col-md-8")]; list_j = ['ANNUAL_SALARY', 'HOURLY_SALARY', 'HOUR_PER_WEEK']; for (let i = 0; i < list_e.length; i++) { var myVariable = list_e[i] && list_e[i].textContent.trim(); if (myVariable) { if (i != 2) { obj.ee_BASIC_info[list_j[i]] = myVariable.match(/\$\d{1,3}(?:,?\d{3})*(?:\.\d{2})?/)[0]; } else { obj.ee_BASIC_info[list_j[i]] = myVariable.trim(); } } } } }; if (document.getElementById("LkpRelationshipId") != null) { dic_dep = { "FIRST_NAME": "FirstName", "MIDDLE_NAME": "MiddleName", "LAST_NAME": "LastName", "DOB": "DOB", "SSN": "SSN", "RELATION": "LkpRelationshipId" }; relation = get_sel(document.getElementById('LkpRelationshipId')); if (relation in obj.ee_DEPT_info) { if (obj.ee_DEPT_info[relation]["SSN"] == "") { for (key in dic_dep) { if (document.getElementById(dic_dep[key]) != null) { if (document.getElementById(dic_dep[key]).value != "") { if (key in obj.ee_DEPT_info[relation]) { if (key == 'RELATION') { const selectElement = document.getElementById(dic_dep[key]); const selectedIndex = selectElement.selectedIndex; const selectedOption = selectElement.options[selectedIndex]; obj.ee_DEPT_info[relation][key] = selectedOption.textContent; } else { obj.ee_DEPT_info[relation][key] = document.getElementById(dic_dep[key]).value } } } } }; var allPageTags = document.getElementById('edit_data_modal').getElementsByTagName("input"); for (i = 0; i < allPageTags.length; i++) { if (allPageTags[i].name == 'Gender') { if (allPageTags[i].checked == true) { obj.ee_DEPT_info[relation].GENDER = (allPageTags[i].value) } } }; } else { for (key in dic_dep) { if (document.getElementById(dic_dep[key]) != null) { if (document.getElementById(dic_dep[key]).value != "") { if (key in obj.ee_DEPT_info[relation]) { if (key == 'RELATION') { const selectElement = document.getElementById(dic_dep[key]); const selectedIndex = selectElement.selectedIndex; const selectedOption = selectElement.options[selectedIndex]; obj.ee_DEPT_info[relation][key] = obj.ee_DEPT_info[relation][key] + "|" + selectedOption.textContent; } else { obj.ee_DEPT_info[relation][key] = obj.ee_DEPT_info[relation][key] + "|" + document.getElementById(dic_dep[key]).value } } } } }; var allPageTags = document.getElementById('edit_data_modal').getElementsByTagName("input"); for (i = 0; i < allPageTags.length; i++) { if (allPageTags[i].name == 'Gender') { if (allPageTags[i].checked == true) { obj.ee_DEPT_info[relation].GENDER = obj.ee_DEPT_info[relation].GENDER + "|" + allPageTags[i].value } } }; }; } }; } }if (document.domain == "guardian.benselect.com") { dic = { "SSN": "ControlText_bodyContent_Tab_MainFrame_txtSSN", "ID": "bodyContent_Tab_MainFrame_txtEID", "DATE_OF_HIRE": "bodyContent_Tab_MainFrame_txtDateOfHire", "ELIG_DATE": "bodyContent_Tab_MainFrame_txtEligibilityDate", "TERM_DATE": "bodyContent_Tab_MainFrame_txtTerminationDate", "HOUR_PER_WEEK": "bodyContent_Tab_MainFrame_txtHoursPerWeek", "ANNUAL_SALARY": "bodyContent_Tab_MainFrame_txtSalaryValue", "FIRST_NAME": "bodyContent_Tab_MainFrame_txtFirstName", "MIDDLE_NAME": "bodyContent_Tab_MainFrame_txtMiddleInit", "LAST_NAME": "bodyContent_Tab_MainFrame_txtLastName", "DOB": "bodyContent_Tab_MainFrame_txtDOB", "ADD1": "bodyContent_Tab_MainFrame_AddressCtrl_addressCtrlLine1", "ADD2": "bodyContent_Tab_MainFrame_AddressCtrl_addressCtrlLine2", "ADDCITY": "bodyContent_Tab_MainFrame_AddressCtrl_addressCtrlCity", "ADDZIP": "bodyContent_Tab_MainFrame_AddressCtrl_addressCtrlZip", "HOMEPHONE": "bodyContent_Tab_MainFrame_txtHomePhone", "WORK_EMAIL": "bodyContent_Tab_MainFrame_txtEmail" }; for (key in dic) { if (document.getElementById(dic[key]) != null) { if (document.getElementById(dic[key]).value != "") { if (key in obj.ee_BASIC_info) { obj.ee_BASIC_info[key] = document.getElementById(dic[key]).value } } } }; if (document.getElementById("bodyContent_Tab_MainFrame_rbtGender_0") != null) { if (document.getElementById("bodyContent_Tab_MainFrame_rbtGender_0").getAttribute("checked") != null) { obj.ee_BASIC_info.GENDER = "M"; }; if (document.getElementById("bodyContent_Tab_MainFrame_rbtGender_1").getAttribute("checked") != null) { obj.ee_BASIC_info.GENDER = "F"; }; }; if (document.getElementById("bodyContent_Tab_MainFrame_grdDependent") != null) { var table = document.getElementById("bodyContent_Tab_MainFrame_grdDependent"); var rows = table.rows; for (var i = 1; i < rows.length; i += 1) { var Tr = rows[i]; ssn = Tr.cells[1].firstChild.getAttribute("data-original-title"); name = Tr.cells[2].textContent; dob = Tr.cells[3].textContent; gender = Tr.cells[4].textContent; relation = Tr.cells[5].textContent; student = Tr.cells[6].textContent; if (relation in obj.ee_DEPT_info) { if (obj.ee_DEPT_info[relation]["SSN"] == "") { obj.ee_DEPT_info[relation]["SSN"] = ssn; obj.ee_DEPT_info[relation]["DOB"] = dob; obj.ee_DEPT_info[relation]["FULL_NAME"] = name; obj.ee_DEPT_info[relation]["GENDER"] = gender; obj.ee_DEPT_info[relation]["IF_STUDENT"] = student; obj.ee_DEPT_info[relation]["RELATION"] = relation; } else { obj.ee_DEPT_info[relation]["SSN"] = obj.ee_DEPT_info[relation]["SSN"] + "|" + ssn; obj.ee_DEPT_info[relation]["DOB"] = obj.ee_DEPT_info[relation]["DOB"] + "|" + dob; obj.ee_DEPT_info[relation]["FULL_NAME"] = obj.ee_DEPT_info[relation]["FULL_NAME"] + "|" + name; obj.ee_DEPT_info[relation]["GENDER"] = obj.ee_DEPT_info[relation]["GENDER"] + "|" + gender; obj.ee_DEPT_info[relation]["IF_STUDENT"] = obj.ee_DEPT_info[relation]["IF_STUDENT"] + "|" + student; obj.ee_DEPT_info[relation]["RELATION"] = obj.ee_DEPT_info[relation]["RELATION"] + "|" + relation; }; }; }; }; }let newClipboardString = JSON.stringify(obj); navigator.clipboard.writeText(newClipboardString); }); }, 100); }; test();