Skip to content

Commit

Permalink
[GENERAL] - Update default css and add cookie loading into the nike t…
Browse files Browse the repository at this point in the history
…emplate
  • Loading branch information
rtunazzz committed Aug 19, 2021
1 parent 274d932 commit 5931678
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/cdn/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ textarea {
font-weight: bold;
}

a {
text-decoration: none underline;
}

a:visited {
text-decoration: none;
text-decoration: none underline;
color: white;
}

Expand Down
17 changes: 17 additions & 0 deletions web/templates/nike-setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ <h1>Nike Link Setup</h1>
</div>
</div>
<script>
function getCookieValue(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(";").shift();
}

var locale = getCookieValue("nike_locale");
if (locale) {
var allLocales = document.getElementById("locales");
var localeIndex = Array.from(allLocales).findIndex(
(el) => el.value == locale
);
if (localeIndex) {
allLocales.options[localeIndex].selected = true;
}
}

function setCookies() {
var tokenField = document.getElementById("nike-authentication");
var token = tokenField.value?.replaceAll('"', "");
Expand Down

0 comments on commit 5931678

Please sign in to comment.