diff --git a/assets/index.js b/assets/index.js index d65c1d5..bb43448 100644 --- a/assets/index.js +++ b/assets/index.js @@ -244,9 +244,14 @@ function checkIfStock() { } } -function setUrl(pid, region) { - var region = adidasRegions[region].countryCode; - var parameters = '?pid=' + pid + '®ion=' + region; +function setUrl(pid, region, clientId) { + var region = adidasRegions[region]; + var parameters = '?pid=' + pid + '®ion=' + region.countryCode; + + if (clientId != region.clientIds[0]) { + parameters += '&clientid=' + clientId; + } + window.history.pushState('query', pid, parameters); } @@ -262,6 +267,7 @@ function loadUrl() { var pid = gup('pid', location.href); var region = gup('region', location.href); + var clientid = gup('clientid', location.href); if (pid != null && region != null) { var adiRegion; @@ -269,13 +275,19 @@ function loadUrl() { if (adidasRegions[r].countryCode == region) { adiRegion = r; $('#stockRegion').val(r); - $('#clientId').val(adidasRegions[r].clientIds[0]); + if (clientid == null) { + $('#clientId').val(adidasRegions[r].clientIds[0]); + } break; } } $('#productId').val(pid); } + + if (clientid != null) { + $('#clientId').val(clientid); + } } $(function () { @@ -289,7 +301,7 @@ $(function () { $('form.st').submit(function (e) { e.preventDefault(); - setUrl($('#productId').val(), $('#stockRegion').val()); + setUrl($('#productId').val(), $('#stockRegion').val(), $('#clientId').val()); ga('send', 'event', { 'eventCategory': 'Stock', 'eventAction': 'Searched', diff --git a/assets/style.css b/assets/style.css index 2a02e73..b13e955 100644 --- a/assets/style.css +++ b/assets/style.css @@ -98,6 +98,12 @@ span.show { padding: 16px; } +.partner { + margin-top: 24px; + width: 100%; + height: auto; +} + @media all and (max-width: 500px) { .stock-block { width: 31%; diff --git a/index.html b/index.html index 487ba5e..a22585d 100644 --- a/index.html +++ b/index.html @@ -122,6 +122,20 @@

YZY.IO + +
+ part + + + + +