Created
March 14, 2020 23:42
-
-
Save devzer01/28746cb89e31bf6387c3eafcb1db4a3c to your computer and use it in GitHub Desktop.
fix one problem and create many for no good reason code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content = document.createElement('div') | |
content.id = 'alert'; | |
content.style.width = '100%'; | |
content.innerHTML = 'tax translation helper is loaded'; | |
content.style.height = '100px'; | |
content.style.textAlign = 'center'; | |
content.style.display = 'none'; | |
var body = document.getElementsByTagName('body')[0]; | |
body.appendChild(content); | |
var s = document.createElement('script'); | |
s.innerHTML = "alert = function(text){ var c = document.getElementById('alert'); c.innerText = text; c.style.display = 'block'; }"; | |
body.appendChild(s); | |
setExitText('bExit', 'Exit') | |
setExitText('bChangeName', 'Change Name (above)') | |
setExitText('bChangeAdd', 'Change Address (above)') | |
setExitText('bNext', 'Next') | |
setExitText('bClear', 'Clear') | |
setEmpTaxIdLabel() | |
function setExitText (elm, text) { | |
var btnExit = document.getElementById(elm) | |
if (btnExit == null) return false; | |
var anchorExit = btnExit.parentElement | |
var tdElm = anchorExit.parentElement | |
var title = document.createElement('h2') | |
title.innerText = text | |
title.className = 'i18n' | |
tdElm.appendChild(title) | |
} | |
function setEmpTaxIdLabel () { | |
if (document.getElementById('f401_nidtin') != null && document.getElementById('401_13') != null) { | |
var emplouyerTaxId = document.getElementById('f401_nidtin'); | |
var employerTaxIdText = document.createElement("h4") | |
employerTaxIdText.innerText = "Employer Tax ID Number" | |
employerTaxIdText.className = 'i18n' | |
emplouyerTaxId.parentElement.appendChild(employerTaxIdText); | |
} else { | |
window.setTimeout(() => { | |
setEmpTaxIdLabel(); | |
}, 1000) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment