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:
@@ -36,15 +36,22 @@ function saveCookies() {
|
||||
|
||||
|
||||
function insertAPIKeyFromCookie() {
|
||||
getCookies();
|
||||
key = cookies["apikey"];
|
||||
if (key != null && key != undefined) {
|
||||
document.getElementById("apikey").value = key;
|
||||
checkAPIkey();
|
||||
element = document.getElementById("apikey")
|
||||
if (element != null && element != undefined) {
|
||||
getCookies();
|
||||
key = cookies["apikey"];
|
||||
if (key != null && key != undefined) {
|
||||
element.value = key;
|
||||
checkAPIkey();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
window.addEventListener("load",insertAPIKeyFromCookie);
|
||||
|
||||
|
||||
function saveAPIkey() {
|
||||
key = APIkey();
|
||||
setCookie("apikey",key);
|
||||
|
||||
Reference in New Issue
Block a user