refactor: move all javascript style setting into variables
This commit is contained in:
parent
c0f0def03f
commit
8579ae0ff3
28
public/404.html
generated
28
public/404.html
generated
@ -22,19 +22,27 @@
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/arrays
generated
28
public/arrays
generated
@ -199,19 +199,27 @@ when printed with <code>fmt.Println</code>.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/atomic-counters
generated
28
public/atomic-counters
generated
@ -237,19 +237,27 @@ state.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/base64-encoding
generated
28
public/base64-encoding
generated
@ -193,19 +193,27 @@ but they both decode to the original string as desired.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/channel-buffering
generated
28
public/channel-buffering
generated
@ -155,19 +155,27 @@ concurrent receive.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/channel-directions
generated
28
public/channel-directions
generated
@ -147,19 +147,27 @@ receive on this channel.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/channel-synchronization
generated
28
public/channel-synchronization
generated
@ -186,19 +186,27 @@ started.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/channels
generated
28
public/channels
generated
@ -171,19 +171,27 @@ message without having to use any other synchronization.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/closing-channels
generated
28
public/closing-channels
generated
@ -197,19 +197,27 @@ example: <code>range</code> over channels.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/closures
generated
28
public/closures
generated
@ -192,19 +192,27 @@ recursion.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/command-line-arguments
generated
28
public/command-line-arguments
generated
@ -172,19 +172,27 @@ with flags.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/command-line-flags
generated
28
public/command-line-flags
generated
@ -308,19 +308,27 @@ and show the help text again.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/command-line-subcommands
generated
28
public/command-line-subcommands
generated
@ -262,19 +262,27 @@ way to parameterize programs.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/constants
generated
28
public/constants
generated
@ -185,19 +185,27 @@ assignment or function call. For example, here
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/context
generated
28
public/context
generated
@ -207,19 +207,27 @@ cancellation.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/defer
generated
28
public/defer
generated
@ -211,19 +211,27 @@ after being written.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/directories
generated
28
public/directories
generated
@ -349,19 +349,27 @@ recursively by <code>filepath.Walk</code>.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/embed-directive
generated
28
public/embed-directive
generated
@ -212,19 +212,27 @@ this example can only be run on your local machine.)</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/environment-variables
generated
28
public/environment-variables
generated
@ -188,19 +188,27 @@ program picks that value up.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/epoch
generated
28
public/epoch
generated
@ -172,19 +172,27 @@ parsing and formatting.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/errors
generated
28
public/errors
generated
@ -298,19 +298,27 @@ on the Go blog for more on error handling.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/execing-processes
generated
28
public/execing-processes
generated
@ -206,19 +206,27 @@ processes covers most use cases for <code>fork</code>.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/exit
generated
28
public/exit
generated
@ -172,19 +172,27 @@ the status in the terminal.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/file-paths
generated
28
public/file-paths
generated
@ -251,19 +251,27 @@ be made relative to base.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/for
generated
28
public/for
generated
@ -197,19 +197,27 @@ structures.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/functions
generated
28
public/functions
generated
@ -194,19 +194,27 @@ multiple return values, which we’ll look at next.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/generics
generated
28
public/generics
generated
@ -249,19 +249,27 @@ automatically.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/goroutines
generated
28
public/goroutines
generated
@ -210,19 +210,27 @@ concurrent Go programs: channels.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/hello-world
generated
28
public/hello-world
generated
@ -137,19 +137,27 @@ learn more about the language.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/http-client
generated
28
public/http-client
generated
@ -171,19 +171,27 @@ settings.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/http-server
generated
28
public/http-server
generated
@ -212,19 +212,27 @@ router we’ve just set up.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/if-else
generated
28
public/if-else
generated
@ -186,19 +186,27 @@ for basic conditions.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/index.html
generated
28
public/index.html
generated
@ -201,19 +201,27 @@
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/interfaces
generated
28
public/interfaces
generated
@ -238,19 +238,27 @@ these structs as arguments to <code>measure</code>.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/json
generated
28
public/json
generated
@ -414,19 +414,27 @@ for more.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/line-filters
generated
28
public/line-filters
generated
@ -205,19 +205,27 @@ lowercase lines.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/maps
generated
28
public/maps
generated
@ -235,19 +235,27 @@ printed with <code>fmt.Println</code>.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/methods
generated
28
public/methods
generated
@ -198,19 +198,27 @@ naming related sets of methods: interfaces.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/multiple-return-values
generated
28
public/multiple-return-values
generated
@ -168,19 +168,27 @@ feature of Go functions; we’ll look at this next.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/mutexes
generated
28
public/mutexes
generated
@ -252,19 +252,27 @@ management task using only goroutines and channels.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/non-blocking-channel-operations
generated
28
public/non-blocking-channel-operations
generated
@ -178,19 +178,27 @@ on both <code>messages</code> and <code>signals</code>.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/number-parsing
generated
28
public/number-parsing
generated
@ -216,19 +216,27 @@ bits.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/panic
generated
28
public/panic
generated
@ -187,19 +187,27 @@ to use error-indicating return values wherever possible.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/pointers
generated
28
public/pointers
generated
@ -195,19 +195,27 @@ the memory address for that variable.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/random-numbers
generated
28
public/random-numbers
generated
@ -237,19 +237,27 @@ that Go can provide.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/range
generated
28
public/range
generated
@ -204,19 +204,27 @@ details.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/range-over-channels
generated
28
public/range-over-channels
generated
@ -156,19 +156,27 @@ values be received.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/rate-limiting
generated
28
public/rate-limiting
generated
@ -263,19 +263,27 @@ then serve the remaining 2 with ~200ms delays each.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/reading-files
generated
28
public/reading-files
generated
@ -288,19 +288,27 @@ be scheduled immediately after <code>Open</code>ing with
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/recover
generated
28
public/recover
generated
@ -197,19 +197,27 @@ panic and resumes in the deferred closure.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/recursion
generated
28
public/recursion
generated
@ -183,19 +183,27 @@ knows which function to call with <code>fib</code> here.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/regular-expressions
generated
28
public/regular-expressions
generated
@ -345,19 +345,27 @@ the <a href="https://pkg.go.dev/regexp"><code>regexp</code></a> package docs.</p
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/select
generated
28
public/select
generated
@ -185,19 +185,27 @@ concurrently.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/sha256-hashes
generated
28
public/sha256-hashes
generated
@ -201,19 +201,27 @@ you should carefully research
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/signals
generated
28
public/signals
generated
@ -215,19 +215,27 @@ causing the program to print <code>interrupt</code> and then exit.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
42
public/site.js
generated
42
public/site.js
generated
@ -15,45 +15,3 @@ var clipboard = new Clipboard('.copy', {
|
||||
return codeLines.filter(function(cL) { return cL != '' }).join("\n").replace(/\n$/, '');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Code for theme switching
|
||||
*/
|
||||
|
||||
|
||||
// var themeButton = document.getElementById('theme-button');
|
||||
// var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
|
||||
// function activateDarkTheme(){
|
||||
// body.style.color = "#ffffffeb"
|
||||
// body.style.backgroundColor = "#1a202c"
|
||||
// localStorage.setItem('theme', 'dark')
|
||||
// }
|
||||
|
||||
// function activateLightTheme(){
|
||||
// body.style.color = "#252519"
|
||||
// body.style.backgroundColor = "white"
|
||||
// localStorage.setItem('theme', 'light')
|
||||
// }
|
||||
|
||||
// if (localStorage.getItem('theme') === 'light') {
|
||||
// activateLightTheme()
|
||||
// } else if (localStorage.getItem('theme') === 'dark'){
|
||||
// activateDarkTheme()
|
||||
// }
|
||||
|
||||
// themeButton.onclick = function(){
|
||||
// if (localStorage.getItem('theme') === 'dark'){
|
||||
// activateLightTheme()
|
||||
// } else if (localStorage.getItem('theme') === 'light'){
|
||||
// activateDarkTheme()
|
||||
// } else {
|
||||
// if (body.style.color === "white"){
|
||||
// activateDarkTheme()
|
||||
// } else {
|
||||
// activateLightTheme()
|
||||
// }
|
||||
// }
|
||||
// }
|
28
public/slices
generated
28
public/slices
generated
@ -311,19 +311,27 @@ Go’s other key builtin data structure: maps.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/sorting
generated
28
public/sorting
generated
@ -163,19 +163,27 @@ slices and <code>true</code> as the result of our <code>AreSorted</code> test.</
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/sorting-by-functions
generated
28
public/sorting-by-functions
generated
@ -181,19 +181,27 @@ functions.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/spawning-processes
generated
28
public/spawning-processes
generated
@ -285,19 +285,27 @@ an error message and non-zero return code.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/stateful-goroutines
generated
28
public/stateful-goroutines
generated
@ -315,19 +315,27 @@ program.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/string-formatting
generated
28
public/string-formatting
generated
@ -458,19 +458,27 @@ and returns a string without printing it anywhere.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/string-functions
generated
28
public/string-functions
generated
@ -165,19 +165,27 @@ package docs.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/strings-and-runes
generated
28
public/strings-and-runes
generated
@ -285,19 +285,27 @@ can compare a <code>rune</code> value to a rune literal directly.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/struct-embedding
generated
28
public/struct-embedding
generated
@ -249,19 +249,27 @@ we see that a <code>container</code> now implements the
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/structs
generated
28
public/structs
generated
@ -268,19 +268,27 @@ pointers are automatically dereferenced.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/switch
generated
28
public/switch
generated
@ -205,19 +205,27 @@ type corresponding to its clause.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/temporary-files-and-directories
generated
28
public/temporary-files-and-directories
generated
@ -241,19 +241,27 @@ prefixing them with our temporary directory.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/testing-and-benchmarking
generated
28
public/testing-and-benchmarking
generated
@ -287,19 +287,27 @@ benchmark function names with a regexp.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/text-templates
generated
28
public/text-templates
generated
@ -276,19 +276,27 @@ the range block <code>{{.}}</code> is set to the current item of the iteration.<
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/tickers
generated
28
public/tickers
generated
@ -173,19 +173,27 @@ before we stop it.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/time
generated
28
public/time
generated
@ -272,19 +272,27 @@ the Unix epoch.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/time-formatting-parsing
generated
28
public/time-formatting-parsing
generated
@ -206,19 +206,27 @@ explaining the parsing problem.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/timeouts
generated
28
public/timeouts
generated
@ -184,19 +184,27 @@ out and the second succeeding.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/timers
generated
28
public/timers
generated
@ -187,19 +187,27 @@ a chance to fire.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/url-parsing
generated
28
public/url-parsing
generated
@ -238,19 +238,27 @@ pieces that we extracted.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/values
generated
28
public/values
generated
@ -154,19 +154,27 @@ basic examples.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/variables
generated
28
public/variables
generated
@ -186,19 +186,27 @@ This syntax is only available inside functions.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/variadic-functions
generated
28
public/variadic-functions
generated
@ -188,19 +188,27 @@ to form closures, which we’ll look at next.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/waitgroups
generated
28
public/waitgroups
generated
@ -254,19 +254,27 @@ is likely to be different for each invocation.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/worker-pools
generated
28
public/worker-pools
generated
@ -225,19 +225,27 @@ there are 3 workers operating concurrently.</p>
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/writing-files
generated
28
public/writing-files
generated
@ -288,19 +288,27 @@ we’ve just seen to the <code>stdin</code> and <code>stdout</code> streams.
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
28
public/xml
generated
28
public/xml
generated
@ -279,19 +279,27 @@ to nest all <code>plant</code>s under <code><parent><child>...</code
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
@ -11,19 +11,27 @@
|
||||
var themeButton = document.getElementById('theme-button');
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
|
||||
var lightText = "#ffffffeb";
|
||||
var darkText = "#252519";
|
||||
var lightBackground = "white";
|
||||
var darkBackground = "#1a202c";
|
||||
var lightCodeBackground = "#f0f0f0";
|
||||
var darkCodeBackground = "#333333";
|
||||
|
||||
|
||||
function activateTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.style.color = "#ffffffeb";
|
||||
body.style.backgroundColor = "#1a202c";
|
||||
styleAllTags('a', 'color', '#ffffffeb')
|
||||
styleAllTags('td.code', 'background', '#333333')
|
||||
styleAllTags('td.code.empty', 'background', '#1a202c')
|
||||
body.style.color = lightText;
|
||||
body.style.backgroundColor = darkBackground;
|
||||
styleAllTags('a', 'color', lightText)
|
||||
styleAllTags('td.code', 'background', darkCodeBackground);
|
||||
styleAllTags('td.code.empty', 'background', darkBackground)
|
||||
} else {
|
||||
body.style.color = "#252519";
|
||||
body.style.backgroundColor = "white";
|
||||
styleAllTags('a', 'color', '#252519')
|
||||
styleAllTags('td.code', 'background', '#f0f0f0')
|
||||
styleAllTags('td.code.empty', 'background', 'white')
|
||||
body.style.color = darkText;
|
||||
body.style.backgroundColor = lightBackground;
|
||||
styleAllTags('a', 'color', darkText)
|
||||
styleAllTags('td.code', 'background', lightCodeBackground)
|
||||
styleAllTags('td.code.empty', 'background', lightBackground)
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user