Skip to content

Instantly share code, notes, and snippets.

@jbmusso
Last active June 24, 2019 11:56
Show Gist options
  • Save jbmusso/a70035fb9eb3e4aa9bd041ff538e4050 to your computer and use it in GitHub Desktop.
Save jbmusso/a70035fb9eb3e4aa9bd041ff538e4050 to your computer and use it in GitHub Desktop.
//OnPageInit(); //For some reason the OnLoad does not execute with Arcot Cards.
//Checks to see if "Chip Password" is in the authentication method list
//or is the default authentication method
function ChipCardInAuthList() {
var retValue = false;
var objAuthType = document.forms[0].authSelect;
if (objAuthType != null) {
var optLength = objAuthType.length;
var idx;
for (idx = 0; idx < optLength; idx++) {
var objValue = objAuthType.options[idx].value;
if (objValue == "Chip Password") {
retValue = true;
break;
}
}
} else {
var objValue = document.forms[0].authDefaultSelect.value;
//The only method is "Chip Password"
if (objValue == "Chip Password") {
retValue = true;
}
}
debugAlert("ChipCardInAuthList is " + retValue + ".");
return retValue;
}
//ChipCardSelected() - returns true if either "Chip Password"
//is selected in the auth select dropdown or if "Chip Password"
//is the default ( only ) auth method for this card.
function ChipCardSelected() {
var retValue = false;
var objAuthType = document.forms[0].authSelect;
if (objAuthType != null) {
var nOptIndex = objAuthType.selectedIndex;
var objValue = objAuthType.options[nOptIndex].value;
if (objValue == "Chip Password") {
retValue = true;
}
} else {
var objValue = document.forms[0].authDefaultSelect.value;
//The only method is "Chip Password"
if (objValue == "Chip Password") {
retValue = true;
}
}
debugAlert("ChipCardSelected is " + retValue + ".");
return retValue;
}
//Checks to see if we are using Chip Card and if we have
//the Visa Password or another auth method available
function CanFallBack() {
var retValue;
if (
document.forms[0].AuthFallBack.value != "" &&
document.forms[0].AuthFallBack.value != null
) {
debugAlert("Can Fallback");
retValue = true;
} else {
debugAlert("Cannot Fallback");
retValue = false;
}
return retValue;
}
function AuthSelectExists() {
var retValue;
if (document.forms[0].authSelect == null) {
retValue = false;
} else {
retValue = true;
}
return retValue;
}
function SecurityWindow() {
var win = window.open(
document.passwdForm.Locale.value + "security.htm",
"Security",
"height=300,width=360,dependent=yes,scrollbars=yes,resizable=no,screenX=100,screenY=100,left=100,top=100"
);
}
function HelpWindow() {
var helpHtml;
if (ChipCardSelected()) {
helpHtml = document.passwdForm.Locale.value + "chiphelp.htm";
win = window.open(
helpHtml,
"Help",
"height=390,width=400,dependent=yes,scrollbars=yes,resizable=no,screenX=100,screenY=100,left=100,top=100"
);
win.focus();
} else {
helpHtml = document.passwdForm.Locale.value + "help.htm";
win = window.open(
helpHtml,
"Help",
"width=390,height=400,dependent=yes,scrollbars=yes,resizable=no,screenX=100,screenY=100,left=100,top=100"
);
win.focus();
}
}
function IsNetscapeOnSolaris() {
var agent = window.navigator.userAgent;
if (agent.indexOf("Mozilla") != -1 && agent.indexOf("compatible") == -1) {
if (agent.indexOf("SunOS") != -1) return true;
else return false;
} else {
return false;
}
}
function OnCancelHandler2(object) {
if (navigator.appName == "Netscape") {
object.href = "#";
}
//var objCardHolder = document.optInForm.cardHolderSelect;
//if ( objCardHolder != null ) {
// var chIndex = objCardHolder.selectedIndex;
// document.optInForm.cardHolder.value = objCardHolder.options[chIndex].text;
//}
//document.optInForm.authType.value = document.forms[0].authDefaultSelect.value;
document.optInForm.cancelHit.value = "%#*@NO_PASSWORD_@*#%";
if (IsNetscapeOnSolaris()) {
setTimeout("document.optInForm.submit()", 500);
} else {
document.optInForm.submit();
}
}
function OnCancelHandler(object) {
alert("in on cancel handler");
if (navigator.appName == "Netscape") {
object.href = "#";
}
var objCardHolder = document.passwdForm.cardHolderSelect;
if (objCardHolder != null) {
var chIndex = objCardHolder.selectedIndex;
document.passwdForm.cardHolder.value = objCardHolder.options[chIndex].text;
}
document.passwdForm.authType.value =
document.forms[0].authDefaultSelect.value;
document.passwdForm.cancelHit.value = "%#*@NO_PASSWORD_@*#%";
if (IsNetscapeOnSolaris()) {
setTimeout("document.passwdForm.submit()", 500);
} else {
document.passwdForm.submit();
}
}
function OnSubmitHandler() {
//alert("in submit handler");
//alert("Pin = " + document.passwdForm.pin.value);
OnClickHandler();
return false;
}
function OnMultiSubmitHandler() {
//document.passwdForm.pin.value = '888 888 888';
//alert("you");
OnClickHandler();
return false;
}
function SetSubmit() {
document.passwdForm.submitted.value = 1;
}
function ResetSubmit() {
document.passwdForm.submitted.value = 0;
}
function ClearPin() {
document.passwdForm.pin.value = "";
document.passwdForm.pin.focus();
}
//OnPageInit(); //For some reason the OnLoad does not execute with Arcot Cards.
//Checks to see if "Chip Password" is in the authentication method list
//or is the default authentication method
function ChipCardInAuthList() {
var retValue = false;
var objAuthType = document.forms[0].authSelect;
if (objAuthType != null) {
var optLength = objAuthType.length;
var idx;
for (idx = 0; idx < optLength; idx++) {
var objValue = objAuthType.options[idx].value;
if (objValue == "Chip Password") {
retValue = true;
break;
}
}
} else {
var objValue = document.forms[0].authDefaultSelect.value;
//The only method is "Chip Password"
if (objValue == "Chip Password") {
retValue = true;
}
}
debugAlert("ChipCardInAuthList is " + retValue + ".");
return retValue;
}
//ChipCardSelected() - returns true if either "Chip Password"
//is selected in the auth select dropdown or if "Chip Password"
//is the default ( only ) auth method for this card.
function ChipCardSelected() {
var retValue = false;
var objAuthType = document.forms[0].authSelect;
if (objAuthType != null) {
var nOptIndex = objAuthType.selectedIndex;
var objValue = objAuthType.options[nOptIndex].value;
if (objValue == "Chip Password") {
retValue = true;
}
} else {
var objValue = document.forms[0].authDefaultSelect.value;
//The only method is "Chip Password"
if (objValue == "Chip Password") {
retValue = true;
}
}
debugAlert("ChipCardSelected is " + retValue + ".");
return retValue;
}
//Checks to see if we are using Chip Card and if we have
//the Visa Password or another auth method available
function CanFallBack() {
var retValue;
if (
document.forms[0].AuthFallBack.value != "" &&
document.forms[0].AuthFallBack.value != null
) {
debugAlert("Can Fallback");
retValue = true;
} else {
debugAlert("Cannot Fallback");
retValue = false;
}
return retValue;
}
function AuthSelectExists() {
var retValue;
if (document.forms[0].authSelect == null) {
retValue = false;
} else {
retValue = true;
}
return retValue;
}
function SecurityWindow() {
var win = window.open(
document.passwdForm.Locale.value + "security.htm",
"Security",
"height=300,width=360,dependent=yes,scrollbars=yes,resizable=no,screenX=100,screenY=100,left=100,top=100"
);
}
function HelpWindow() {
var helpHtml;
if (ChipCardSelected()) {
helpHtml = document.passwdForm.Locale.value + "chiphelp.htm";
win = window.open(
helpHtml,
"Help",
"height=390,width=400,dependent=yes,scrollbars=yes,resizable=no,screenX=100,screenY=100,left=100,top=100"
);
win.focus();
} else {
helpHtml = document.passwdForm.Locale.value + "help.htm";
win = window.open(
helpHtml,
"Help",
"width=390,height=400,dependent=yes,scrollbars=yes,resizable=no,screenX=100,screenY=100,left=100,top=100"
);
win.focus();
}
}
function IsNetscapeOnSolaris() {
var agent = window.navigator.userAgent;
if (agent.indexOf("Mozilla") != -1 && agent.indexOf("compatible") == -1) {
if (agent.indexOf("SunOS") != -1) return true;
else return false;
} else {
return false;
}
}
function OnCancelHandler(object) {
if (navigator.appName == "Netscape") {
object.href = "#";
}
var objCardHolder = document.passwdForm.cardHolderSelect;
if (objCardHolder != null) {
var chIndex = objCardHolder.selectedIndex;
document.passwdForm.cardHolder.value = objCardHolder.options[chIndex].text;
}
document.passwdForm.authType.value =
document.forms[0].authDefaultSelect.value;
document.passwdForm.cancelHit.value = "%#*@NO_PASSWORD_@*#%";
if (IsNetscapeOnSolaris()) {
setTimeout("document.passwdForm.submit()", 500);
} else {
document.passwdForm.submit();
}
}
function OnSubmitHandler() {
//alert("in submit handler");
OnClickHandler();
return false;
}
function OnMultiSubmitHandler() {
//document.passwdForm.pin.value = '888 888 888';
OnClickHandler();
return false;
}
function SetSubmit() {
document.passwdForm.submitted.value = 1;
}
function ResetSubmit() {
document.passwdForm.submitted.value = 0;
}
function ClearPin() {
document.passwdForm.pin.value = "";
document.passwdForm.pin.focus();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment