function getUrlParam(name) { var result = new RegExp(name + "=([^&]*)", "i").exec(document.URL); return result && unescape(result[1]) || ""; } function getUserNameParameter() { var usernameParameter = document.getElementById('username').value; if (usernameParameter && !containsSpace(usernameParameter)) { usernameParameter = "?userName=" + usernameParameter; } else { usernameParameter = ""; } return usernameParameter; } function containsSpace(userName) { if (userName.indexOf(" ") >= 0) { return true; } else { return false; } } function emailAddressCheck(url, emailPattern) { var usernameParameter = document.getElementById('username').value; if (emailPattern.test(usernameParameter)) { location.replace(url+'&state='+usernameParameter); return (true) } } function openResetDialog(url, viewName, minHeight, translations) { var buttons = [ { id: "resetButton", text: translations.submitText, click: function () { $("#resetForm").find('input[type=submit]').submit() $("#resetButton").attr("disabled", true) $("#resetUserName").focus() } }, { id: "resetCancel", text: translations.cancelText, click: function () { $(this).dialog("close"); $(resetPasswordDialog).focus(); } }, { id: "resetClose", text: translations.closeText, style: "display: none;", click: function () { $(this).dialog("close"); $(resetPasswordDialog).focus(); } } ] var resetDialog = $('#' + viewName); resetDialog.html(''); resetDialog.load(url, function (response, status, xhr) { if (response.indexOf("") != -1) { document.location.reload(true); } }).dialog({ modal: true, width: 500, height: 'auto', minHeight: minHeight, resizable: false, position: 'center', title: translations.titleText, autoOpen: false, buttons: buttons, open: function () { // $('.ui-dialog :button').blur(); // $("#resetUserName").focus(); resetDialog.load(url, function (response, status, xhr) { if (response.indexOf("") == -1) { // $("#password-reset-email").first().focus(); $("#ui-dialog-title-passwordResetDialog").attr("tabindex","0"); $("#ui-dialog-title-passwordResetDialog").first().focus(); $("span[class='ui-dialog-title']").contents().unwrap().wrap('

'); $('.ui-dialog-titlebar').find('h3').first().addClass('h3_custom_dialog ui-dialog-title tb_icon_close').attr('id','ui-dialog-title-passwordResetDialog'); $('.tb_icon_close').next('a').on('click', function(){ $('#resetPasswordDialog').focus(); }); $(document).on('keyup', function(event) { if(event.key == "Escape") { $('#resetPasswordDialog').focus(); } }); $("label").attr("for","resetUserName"); $("div[class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable']").attr('aria-modal','true'); $("#resetUserName").attr('aria-describedby','resetUserNameError'); $("div[class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable']").attr('aria-describedby','password-reset-email'); remo } }) } }); resetDialog.dialog('open') return false; } function openChangePasswordDialog(url, viewName, minHeight, translations) { var buttons = [ { id: "changePasswordConfirm", text: translations.submitText, style: "display: none;", click: function () { $("#changePasswordForm").find('input[type=submit]').submit() $("#changePasswordConfirm").attr("disabled", true) } }, { id: "changePasswordCancel", text: translations.cancelText, style: "display: none;", click: function () { $(this).dialog("close"); } }, { id: "changePasswordClose", text: translations.closeText, click: function () { $(this).dialog("close"); } } ] var dialog = $('#' + viewName); dialog.html(''); dialog.load(url, function (response, status, xhr) { if (response.indexOf("") != -1) { document.location.reload(true); } }).dialog({ modal: true, width: 500, height: 'auto', minHeight: minHeight, resizable: false, position: 'center', title: translations.titleText, autoOpen: false, buttons: buttons, open: function () { $('.ui-dialog :button').blur(); }, close: function () { window.location.href = "login.html" } }); dialog.dialog('open') return false; } ;