mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-15 14:32:53 +00:00
Add --get-api-key-link
This commit is contained in:
parent
8f8087f8ae
commit
ed68f1bcf9
6 changed files with 25 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue