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:
parent
66c7d9e711
commit
55f0a2ceaf
@ -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">
|
||||||
|
@ -36,15 +36,22 @@ function saveCookies() {
|
|||||||
|
|
||||||
|
|
||||||
function insertAPIKeyFromCookie() {
|
function insertAPIKeyFromCookie() {
|
||||||
getCookies();
|
element = document.getElementById("apikey")
|
||||||
key = cookies["apikey"];
|
if (element != null && element != undefined) {
|
||||||
if (key != null && key != undefined) {
|
getCookies();
|
||||||
document.getElementById("apikey").value = key;
|
key = cookies["apikey"];
|
||||||
checkAPIkey();
|
if (key != null && key != undefined) {
|
||||||
|
element.value = key;
|
||||||
|
checkAPIkey();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load",insertAPIKeyFromCookie);
|
||||||
|
|
||||||
|
|
||||||
function saveAPIkey() {
|
function saveAPIkey() {
|
||||||
key = APIkey();
|
key = APIkey();
|
||||||
setCookie("apikey",key);
|
setCookie("apikey",key);
|
||||||
|
@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<body onload="insertAPIKeyFromCookie()">
|
<body>
|
||||||
|
|
||||||
<table class="top_info">
|
<table class="top_info">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -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">
|
||||||
|
Loading…
Reference in New Issue
Block a user