Add --get-api-key-link

This commit is contained in:
Piero Toffanin 2022-06-21 15:17:42 -04:00
parent 8f8087f8ae
commit ed68f1bcf9
6 changed files with 25 additions and 3 deletions

View file

@ -436,7 +436,9 @@ function getTextWidth(text) {
function setApiKey(){
var prevKey = localStorage.getItem("api_key") || "";
var newKey = "";
newKey = window.prompt("Type in your API Key. If you need an API key, contact the server operator.", prevKey);
var instructions = "contact the server operator.";
if (window.getApiKeyLink) instructions = "press the \"Get API Key\" link."
newKey = window.prompt("Type in your API Key. If you need an API key, " + instructions, prevKey);
if (newKey === null) newKey = "";
localStorage.setItem("api_key", newKey);