diff --git a/workflow/engine/xmlform/login/forgotPasswordpm3.xml b/workflow/engine/xmlform/login/forgotPasswordpm3.xml index 336f7173d..3f15da86a 100755 --- a/workflow/engine/xmlform/login/forgotPasswordpm3.xml +++ b/workflow/engine/xmlform/login/forgotPasswordpm3.xml @@ -29,11 +29,38 @@ function getElementsByClassNameIE8(node, classname) { }; window.onload= function(){ + var inputUser,inputEmail; if(document.getElementById('form[USR_USERNAME]').placeholder == undefined && document.getElementById('form[BSUBMIT]').classList == undefined){ document.getElementById('form[USR_USERNAME]').value = _('ID_USER'); document.getElementById('form[USR_EMAIL]').value = _('ID_EMAIL'); document.getElementById('form[BSUBMIT]').className = "button-login-success"; document.getElementById('form[BCANCEL]').className = "button-login-cancel"; + inputUser = document.getElementById('form[USR_USERNAME]'); + inputEmail = document.getElementById('form[USR_EMAIL]'); + + inputUser.attachEvent("onclick", function (){ + if(_('ID_USER') == inputUser.value){ + inputUser.value=""; + } + }); + inputUser.attachEvent("onblur", function (){ + if(inputUser.value == ""){ + inputUser.value=_('ID_USER'); + } + }); + + inputEmail.attachEvent("onclick", function (){ + if(_('ID_EMAIL') == inputEmail.value){ + inputEmail.value=""; + } + }); + inputEmail.attachEvent("onblur", function (){ + if(inputEmail.value == ""){ + inputEmail.value=_('ID_EMAIL'); + } + }); + + }else{ document.getElementById('form[USR_USERNAME]').placeholder = _('ID_USER'); document.getElementById('form[USR_EMAIL]').placeholder = _('ID_EMAIL'); diff --git a/workflow/engine/xmlform/login/loginpm3.xml b/workflow/engine/xmlform/login/loginpm3.xml index d897798fb..ca2d780d0 100755 --- a/workflow/engine/xmlform/login/loginpm3.xml +++ b/workflow/engine/xmlform/login/loginpm3.xml @@ -36,10 +36,39 @@ function getElementsByClassNameIE8(node, classname) { }; window.onload= function(){ + var inputUser, + inputPass; if(document.getElementById('form[USR_USERNAME]').placeholder == undefined && document.getElementById('form[BSUBMIT]').classList == undefined){ document.getElementById('form[USR_USERNAME]').value = _('ID_USER'); document.getElementById('form[USR_PASSWORD_MASK]').value = _('ID_PASSWORD'); - document.getElementById('form[BSUBMIT]').className = "button-login-success"; + document.getElementById('form[BSUBMIT]').className = "button-login-success"; + inputUser = document.getElementById('form[USR_USERNAME]'); + inputPass = document.getElementById('form[USR_PASSWORD_MASK]'); + + inputUser.attachEvent("onclick", function (){ + if(_('ID_USER') == inputUser.value){ + inputUser.value=""; + } + }); + inputUser.attachEvent("onblur", function (){ + if(inputUser.value == ""){ + inputUser.value=_('ID_USER'); + } + }); + + inputPass.attachEvent("onclick", function (){ + if(_('ID_PASSWORD') == inputPass.value){ + inputPass.value=""; + } + }); + + inputPass.attachEvent("onblur", function (){ + if(inputPass.value == ""){ + inputPass.value = _('ID_PASSWORD'); + } + }); + + }else{ document.getElementById('form[USR_USERNAME]').placeholder = _('ID_USER'); document.getElementById('form[USR_PASSWORD_MASK]').placeholder = _('ID_PASSWORD'); diff --git a/workflow/engine/xmlform/login/sysLoginNoWSpm3.xml b/workflow/engine/xmlform/login/sysLoginNoWSpm3.xml index 433aad79e..f13b9fe5e 100755 --- a/workflow/engine/xmlform/login/sysLoginNoWSpm3.xml +++ b/workflow/engine/xmlform/login/sysLoginNoWSpm3.xml @@ -33,18 +33,68 @@ function getElementsByClassNameIE8(node, classname) { return a; }; +function createEvent(elem, event, fn) { + if (elem.addEventListener) { + elem.addEventListener(event, fn, false); + } else { + elem.attachEvent("on" + event, fn); + } +}; + window.onload= function(){ + var inputUser, + inputWs, + inputPass; if(document.getElementById('form[USR_USERNAME]').placeholder === undefined && document.getElementById('form[BSUBMIT]').classList == undefined){ document.getElementById('form[USR_USERNAME]').value = _('ID_USER'); document.getElementById('form[USR_PASSWORD_MASK]').value = _('ID_PASSWORD'); document.getElementById('form[USER_ENV]').value = _('ID_WORKSPACE'); document.getElementById('form[BSUBMIT]').className = "button-login-success"; + inputUser = document.getElementById('form[USR_USERNAME]'); + inputPass = document.getElementById('form[USR_PASSWORD_MASK]'); + inputWs = document.getElementById('form[USER_ENV]'); + + inputUser.attachEvent("onclick", function (){ + if(_('ID_USER') == inputUser.value){ + inputUser.value=""; + } + }); + inputUser.attachEvent("onblur", function (){ + if(inputUser.value == ""){ + inputUser.value=_('ID_USER'); + } + }); + + inputPass.attachEvent("onclick", function (){ + if(_('ID_PASSWORD') == inputPass.value){ + inputPass.value=""; + } + }); + + inputPass.attachEvent("onblur", function (){ + if(inputPass.value == ""){ + inputPass.value = _('ID_PASSWORD'); + } + }); + + inputWs.attachEvent("onclick", function (){ + if(_('ID_WORKSPACE') == inputWs.value){ + inputWs.value=""; + } + }); + + inputWs.attachEvent("onblur", function (){ + if(inputWs.value == ""){ + inputWs.value = _('ID_WORKSPACE'); + } + }); + }else{ document.getElementById('form[USR_USERNAME]').placeholder = _('ID_USER'); document.getElementById('form[USR_PASSWORD_MASK]').placeholder = _('ID_PASSWORD'); document.getElementById('form[USER_ENV]').placeholder = _('ID_WORKSPACE'); document.getElementById('form[BSUBMIT]').classList.remove('module_app_button___gray'); - document.getElementById('form[BSUBMIT]').classList.add('button-login-success'); + document.getElementById('form[BSUBMIT]').classList.add('button-login-success'); } };