29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
|
|
/**
|
|
* Opens a specific URL based on the provided environment and language.
|
|
* Prompts the user to enter the environment and language in the format 'prod|ste,en|fr'.
|
|
* If the input is valid, it opens the corresponding URL in a new tab.
|
|
* If the input is invalid, it logs an error message to the console.
|
|
*
|
|
* Requires the use of utils/bookmarkletMaker.js to generate the bookmarklet.
|
|
*/
|
|
const answer = prompt("Please enter the env and language in the format 'prod|ste,en|fr':");
|
|
const [env, language] = answer.split(/,|\s/);
|
|
switch (env) {
|
|
case "prod":
|
|
if (language === "fr") {
|
|
window.open("https://www1.royalbank.com/french/netaction/sgnf.html", "_blank").focus();
|
|
} else {
|
|
window.open("https://www1.royalbank.com/english/netaction/sgne.html", "_blank").focus();
|
|
}
|
|
break;
|
|
case "ste":
|
|
if (language === "fr") {
|
|
window.open("https://www1.steroyalbank.com/french/netaction/sgnf.html", "_blank").focus();
|
|
} else {
|
|
window.open("https://www1.steroyalbank.com/english/netaction/sgne.html", "_blank").focus();
|
|
}
|
|
break;
|
|
default:
|
|
console.log("Invalid input");
|
|
} |