Skip to content

Commit 62566e2

Browse files
authored
Merge pull request jsonwebtoken#215 from jsonwebtoken/banner-rotate
Improved banner performance
2 parents 260bada + d5c5a1f commit 62566e2

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

js/app.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -719,18 +719,6 @@ $('.stars').each(function(idx, element){
719719
}
720720
});
721721

722-
function rotateBanner() {
723-
var extensionSection = $(".update-site");
724-
var ebookSection = $(".jtw-ebook-banner");
725-
if (Math.random() >= .5) {
726-
extensionSection.show();
727-
} else {
728-
ebookSection.show();
729-
}
730-
};
731-
732-
rotateBanner();
733-
734722
function setInstalledText() {
735723
var button = $('#extension-button');
736724
if(button && button.hasClass('is-installed')) {

views/index.jade

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,17 @@ block content
6161
span
6262
strong Get the JWT Handbook for free!
6363
|Spread the word and download it now.
64-
a.btn.btn-download-ebook(href='https://auth0.com/e-books/jwt-handbook', target='_blank') Download Ebook
64+
a.btn.btn-download-ebook(href='https://auth0.com/e-books/jwt-handbook?utm_source=jwtio&utm_medium=sc&utm_campaign=rotating_banner', target='_blank') Download Ebook
65+
66+
script.
67+
var extensionSection = document.getElementsByClassName("update-site")[0];
68+
var ebookSection = document.getElementsByClassName("jtw-ebook-banner")[0];
69+
if (Math.random() >= .5) {
70+
extensionSection.style.display = 'block';
71+
} else {
72+
ebookSection.style.display = 'block';
73+
}
74+
6575
section#debugger-io.debugger-jwt
6676
.container
6777
//- a(name='debugger')
@@ -264,4 +274,4 @@ block content
264274
.column.tshirt
265275
h2 Store
266276
img(src='img/pic_tshirt.png')
267-
a.buy(href='http://swag.auth0.com/', target='_blank') Buy T-Shirt
277+
a.buy(href='http://swag.auth0.com/', target='_blank') Buy T-Shirt

0 commit comments

Comments
 (0)