1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Factored out API key insertion

This commit is contained in:
Krateng 2019-06-24 15:02:38 +02:00
parent 66c7d9e711
commit 55f0a2ceaf
4 changed files with 15 additions and 8 deletions

View File

@ -7,7 +7,7 @@
<script src="javascript/cookies.js"></script> <script src="javascript/cookies.js"></script>
</head> </head>
<body onload="insertAPIKeyFromCookie()"> <body>
<table class="top_info"> <table class="top_info">
<tr> <tr>
<td class="image"> <td class="image">

View File

@ -36,15 +36,22 @@ function saveCookies() {
function insertAPIKeyFromCookie() { function insertAPIKeyFromCookie() {
element = document.getElementById("apikey")
if (element != null && element != undefined) {
getCookies(); getCookies();
key = cookies["apikey"]; key = cookies["apikey"];
if (key != null && key != undefined) { if (key != null && key != undefined) {
document.getElementById("apikey").value = key; element.value = key;
checkAPIkey(); checkAPIkey();
} }
}
} }
window.addEventListener("load",insertAPIKeyFromCookie);
function saveAPIkey() { function saveAPIkey() {
key = APIkey(); key = APIkey();
setCookie("apikey",key); setCookie("apikey",key);

View File

@ -154,7 +154,7 @@
<body onload="insertAPIKeyFromCookie()"> <body>
<table class="top_info"> <table class="top_info">
<tr> <tr>

View File

@ -58,7 +58,7 @@
</head> </head>
<body onload="replace();insertAPIKeyFromCookie()"> <body onload="replace()">
<table class="top_info"> <table class="top_info">
<tr> <tr>
<td class="image"> <td class="image">