30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
javascript:(function(){
|
|
var name = "Statement";
|
|
var n = document.querySelector('select.member_number option:checked');
|
|
var c = document.querySelector('.jcf-select-text');
|
|
var t = (n ? n.innerText : (c ? c.innerText : "")) || "";
|
|
t = t.toUpperCase();
|
|
if(t.includes("VALLEY")) name = "Valley";
|
|
else if(t.includes("SHC")) name = "SHC";
|
|
else if(t.includes("ASCOTT")) name = "Ascott";
|
|
else if(t.includes("BSBS")||t.includes("HTP")) name = "BSBS";
|
|
|
|
var btn = document.querySelector('#show_sso');
|
|
var div = document.querySelector('.open_common_sso');
|
|
var fr = document.querySelector('#common_sso_iframe iframe');
|
|
|
|
var url = null;
|
|
if(btn && btn.getAttribute('url')) url = btn.getAttribute('url');
|
|
else if(div && div.getAttribute('sso_url')) url = div.getAttribute('sso_url');
|
|
else if(fr && fr.src) url = fr.src;
|
|
|
|
if(!url){
|
|
alert("Could not find the statement button. Please select an account first.");
|
|
return;
|
|
}
|
|
|
|
if(url.startsWith("/")) url = window.location.origin + url;
|
|
|
|
window.open(url + "#Account=" + name, '_blank');
|
|
})();
|