Skip to content

Commit 7467794

Browse files
committed
More preparations for extension/website merge. Extra algs enabled.
1 parent ddc0e67 commit 7467794

File tree

15 files changed

+360
-330
lines changed

15 files changed

+360
-330
lines changed

Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module.exports = grunt => {
2424
'node_modules/bootstrap/dist/css/bootstrap.min.css',
2525
'node_modules/codemirror/lib/codemirror.css',
2626
'node_modules/codemirror/addon/lint/lint.css',
27-
'css/budicon.css'
27+
'css/budicon.css',
28+
'css/google-roboto-mono.css'
2829
],
2930
dest: 'dist/website/css/'
3031
}]

css/google-roboto-mono.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* cyrillic-ext */
2+
@font-face {
3+
font-family: 'Roboto Mono';
4+
font-style: normal;
5+
font-weight: 400;
6+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYzTOQ_MqJVwkKsUn0wKzc2I.woff2) format('woff2');
7+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
8+
}
9+
/* cyrillic */
10+
@font-face {
11+
font-family: 'Roboto Mono';
12+
font-style: normal;
13+
font-weight: 400;
14+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYzUj_cnvWIuuBMVgbX098Mw.woff2) format('woff2');
15+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
16+
}
17+
/* greek-ext */
18+
@font-face {
19+
font-family: 'Roboto Mono';
20+
font-style: normal;
21+
font-weight: 400;
22+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY0bcKLIaa1LC45dFaAfauRA.woff2) format('woff2');
23+
unicode-range: U+1F00-1FFF;
24+
}
25+
/* greek */
26+
@font-face {
27+
font-family: 'Roboto Mono';
28+
font-style: normal;
29+
font-weight: 400;
30+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY2o_sUJ8uO4YLWRInS22T3Y.woff2) format('woff2');
31+
unicode-range: U+0370-03FF;
32+
}
33+
/* vietnamese */
34+
@font-face {
35+
font-family: 'Roboto Mono';
36+
font-style: normal;
37+
font-weight: 400;
38+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY76up8jxqWt8HVA3mDhkV_0.woff2) format('woff2');
39+
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
40+
}
41+
/* latin-ext */
42+
@font-face {
43+
font-family: 'Roboto Mono';
44+
font-style: normal;
45+
font-weight: 400;
46+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpYyYE0-AqJ3nfInTTiDXDjU4.woff2) format('woff2');
47+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
48+
}
49+
/* latin */
50+
@font-face {
51+
font-family: 'Roboto Mono';
52+
font-style: normal;
53+
font-weight: 400;
54+
src: local('Roboto Mono'), local('RobotoMono-Regular'), url(http://fonts.gstatic.com/s/robotomono/v5/hMqPNLsu_dywMa4C_DEpY44P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
55+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
56+
}

src/website/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ function loadToken() {
5656
}
5757
}
5858

59+
function pickEbookOrExtensionBanner() {
60+
var extensionSection = document.getElementsByClassName("update-site")[0];
61+
var ebookSection = document.getElementsByClassName("jtw-ebook-banner")[0];
62+
if (Math.random() >= .5) {
63+
extensionSection.style.display = 'block';
64+
} else {
65+
ebookSection.style.display = 'block';
66+
}
67+
}
68+
5969
// Initialization
6070
setupNavbar();
6171
setupExtensionButton();
@@ -66,3 +76,4 @@ loadToken();
6676
parseLocationQuery();
6777
setupHighlighting();
6878
setupJwtCounter();
79+
pickEbookOrExtensionBanner();

views/extension/index.pug

Whitespace-only changes.

views/extension/layout.pug

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
doctype html
2+
html(lang='en')
3+
head
4+
include ../title.pug
5+
include ../stylesheets.pug
6+
include ../icons.pug
7+
8+
body
9+
block content
10+

views/icons.pug

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
link(rel='apple-touch-icon', sizes='57x57', href='/img/favicon/apple-icon-57x57.png')
2+
link(rel='apple-touch-icon', sizes='60x60', href='/img/favicon/apple-icon-60x60.png')
3+
link(rel='apple-touch-icon', sizes='72x72', href='/img/favicon/apple-icon-72x72.png')
4+
link(rel='apple-touch-icon', sizes='76x76', href='/img/favicon/apple-icon-76x76.png')
5+
link(rel='apple-touch-icon', sizes='114x114', href='/img/favicon/apple-icon-114x114.png')
6+
link(rel='apple-touch-icon', sizes='120x120', href='/img/favicon/apple-icon-120x120.png')
7+
link(rel='apple-touch-icon', sizes='144x144', href='/img/favicon/apple-icon-144x144.png')
8+
link(rel='apple-touch-icon', sizes='152x152', href='/img/favicon/apple-icon-152x152.png')
9+
link(rel='apple-touch-icon', sizes='180x180', href='/img/favicon/apple-icon-180x180.png')
10+
link(rel='icon', type='image/png', sizes='192x192', href='/img/favicon/android-icon-192x192.png')
11+
link(rel='icon', type='image/png', sizes='32x32', href='/img/favicon/favicon-32x32.png')
12+
link(rel='icon', type='image/png', sizes='96x96', href='/img/favicon/favicon-96x96.png')
13+
link(rel='icon', type='image/png', sizes='16x16', href='/img/favicon/favicon-16x16.png')
14+
link(rel='manifest', href='/img/favicon/manifest.json')
15+
meta(name='msapplication-TileColor', content='#000000')
16+
meta(name='msapplication-TileImage', content='/img/favicon/ms-icon-144x144.png')
17+
meta(name='theme-color', content='#000000')

views/stylesheets.pug

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
link(rel="stylesheet", type="text/css", href="/css/google-roboto-mono.css")
2+
link(rel="stylesheet", href="/css/bootstrap.min.css")
3+
link(rel='stylesheet', href='/css/codemirror.css', type='text/css', media='all')
4+
link(rel='stylesheet', href='/css/lint.css', type='text/css', media='all')
5+
link(rel="stylesheet", href='/css/budicon.css', type="text/css", media="all")
6+
link(rel='stylesheet', href='/css/app.css', type='text/css', media='all')

views/title.pug

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
block meta
2+
title JSON Web Tokens - jwt.io
3+
meta(charset='utf-8')
4+
meta(http-equiv='X-UA-Compatible', content='IE=edge')
5+
meta(name='viewport', content='width=device-width, minimum-scale=1.0, maximum-scale=1.0')
6+
meta(name='author', content='auth0.com')
7+
meta(name='description', content='JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is digitally signed using JSON Web Signature (JWS).')

views/token-editor.pug

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
section#debugger-io.debugger-jwt
2+
.container
3+
//- a(name='debugger')
4+
h1 Debugger
5+
6+
.jwt-playground
7+
.selections
8+
.algorithm
9+
span Algorithm
10+
.jwt-select
11+
select#algorithm-select
12+
option(name='algorithm',value='HS256', selected='') HS256
13+
option(name='algorithm',value='HS384') HS384
14+
option(name='algorithm',value='HS512') HS512
15+
option(name='algorithm',value='RS256') RS256
16+
option(name='algorithm',value='RS384') RS384
17+
option(name='algorithm',value='RS512') RS512
18+
option(name='algorithm',value='ES256') ES256
19+
option(name='algorithm',value='ES384') ES384
20+
//- Unsupported by jsrsasign
21+
option(name='algorithm',value='ES512') ES512
22+
option(name='algorithm',value='PS256') PS256
23+
option(name='algorithm',value='PS384') PS384
24+
option(name='algorithm',value='PS512') PS512
25+
26+
.algorithm-code
27+
.tab-nav
28+
.tab-link.current
29+
a(href='#encoded-jwt') Encoded
30+
small paste a token here
31+
.tab-link
32+
a(href='#decoded-jwt') Decoded
33+
small edit the payload and secret
34+
35+
.tab-content
36+
#encoded-jwt.box-content.current
37+
.input.js-input
38+
#decoded-jwt.box-content
39+
.output
40+
.jwt-explained.jwt-header
41+
p.text-line HEADER:
42+
span ALGORITHM & TOKEN TYPE
43+
.js-header
44+
45+
.jwt-explained.jwt-payload
46+
p.text-line PAYLOAD:
47+
span DATA
48+
.js-payload
49+
#js-payload-tooltip placeholder
50+
51+
.jwt-explained.jwt-signature
52+
p.text-line VERIFY SIGNATURE
53+
pre.pre-encode.HS256.
54+
<span id="hmacsha-text">HMACSHA256</span>(
55+
base64UrlEncode(header) + "." +
56+
base64UrlEncode(payload),
57+
<input type="text" name="secret" value="secret">
58+
)<span class="is-base64-encoded-label"> <input id="is-base64-encoded" type="checkbox" name="is-base64-encoded"><label for="is-base64-encoded">secret base64 encoded</label></span>
59+
pre.pre-encode.RS256.
60+
<span id="rsasha-text">RSASHA256</span>(
61+
base64UrlEncode(header) + "." +
62+
base64UrlEncode(payload),
63+
<textarea rows="4" name="public-key" placeholder="Public Key or Certificate. Enter it in plain text only if you want to verify a token"></textarea>,
64+
<textarea rows="5" name="private-key" placeholder="Private Key. Enter the it in plain text only if you want to generate a new token. The key never leaves your browser."></textarea>
65+
)
66+
67+
.validation-status.js-signature

views/website/assets.pug

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
section.sources
2+
.container
3+
.columns
4+
.column.badges
5+
h2 Badges
6+
.hold
7+
a(href='http://jwt.io/assets/badge.svg', target='_blank')
8+
img(src='assets/badge.svg')
9+
.text-hold
10+
a(href='http://jwt.io/assets/badge.svg', target='_blank')
11+
i.icon-budicon-722
12+
p http://jwt.io/assets/badge.svg
13+
.hold
14+
a(href='http://jwt.io/assets/badge-compatible.svg', target='_blank')
15+
img(src='assets/badge-compatible.svg')
16+
.text-hold
17+
a(href='http://jwt.io/assets/badge-compatible.svg', target='_blank')
18+
i.icon-budicon-722
19+
p http://jwt.io/assets/badge-compatible.svg
20+
.column.logotype
21+
h2 Logotype
22+
.hold
23+
a(href='http://jwt.io/assets/icon.svg', target='_blank')
24+
img(src='assets/icon.svg')
25+
.text-hold
26+
a(href='http://jwt.io/assets/icon.svg', target='_blank')
27+
i.icon-budicon-722
28+
p http://jwt.io/assets/icon.svg
29+
.hold
30+
a(href='http://jwt.io/assets/logo.svg', target='_blank')
31+
img(src='assets/logo.svg')
32+
.text-hold
33+
a(href='http://jwt.io/assets/logo.svg', target='_blank')
34+
i.icon-budicon-722
35+
p http://jwt.io/assets/logo.svg
36+
.column.tshirt
37+
h2 Store
38+
img(src='img/pic_tshirt.png')
39+
a.buy(href='http://swag.auth0.com/', target='_blank') Buy T-Shirt
40+

0 commit comments

Comments
 (0)