refactor: move all javascript style setting into variables

This commit is contained in:
Osinachi Chukwujama 2022-12-24 20:01:48 +01:00
parent c0f0def03f
commit 8579ae0ff3
84 changed files with 1494 additions and 872 deletions

28
public/404.html generated
View File

@ -22,19 +22,27 @@
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/arrays generated
View File

@ -199,19 +199,27 @@ when printed with <code>fmt.Println</code>.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/atomic-counters generated
View File

@ -237,19 +237,27 @@ state.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/base64-encoding generated
View File

@ -193,19 +193,27 @@ but they both decode to the original string as desired.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -155,19 +155,27 @@ concurrent receive.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -147,19 +147,27 @@ receive on this channel.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -186,19 +186,27 @@ started.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/channels generated
View File

@ -171,19 +171,27 @@ message without having to use any other synchronization.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -197,19 +197,27 @@ example: <code>range</code> over channels.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/closures generated
View File

@ -192,19 +192,27 @@ recursion.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -172,19 +172,27 @@ with flags.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -308,19 +308,27 @@ and show the help text again.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -262,19 +262,27 @@ way to parameterize programs.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/constants generated
View File

@ -185,19 +185,27 @@ assignment or function call. For example, here
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/context generated
View File

@ -207,19 +207,27 @@ cancellation.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/defer generated
View File

@ -211,19 +211,27 @@ after being written.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/directories generated
View File

@ -349,19 +349,27 @@ recursively by <code>filepath.Walk</code>.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/embed-directive generated
View File

@ -212,19 +212,27 @@ this example can only be run on your local machine.)</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -188,19 +188,27 @@ program picks that value up.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/epoch generated
View File

@ -172,19 +172,27 @@ parsing and formatting.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/errors generated
View File

@ -298,19 +298,27 @@ on the Go blog for more on error handling.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -206,19 +206,27 @@ processes covers most use cases for <code>fork</code>.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/exit generated
View File

@ -172,19 +172,27 @@ the status in the terminal.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/file-paths generated
View File

@ -251,19 +251,27 @@ be made relative to base.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/for generated
View File

@ -197,19 +197,27 @@ structures.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/functions generated
View File

@ -194,19 +194,27 @@ multiple return values, which we&rsquo;ll look at next.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/generics generated
View File

@ -249,19 +249,27 @@ automatically.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/goroutines generated
View File

@ -210,19 +210,27 @@ concurrent Go programs: channels.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/hello-world generated
View File

@ -137,19 +137,27 @@ learn more about the language.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/http-client generated
View File

@ -171,19 +171,27 @@ settings.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/http-server generated
View File

@ -212,19 +212,27 @@ router we&rsquo;ve just set up.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/if-else generated
View File

@ -186,19 +186,27 @@ for basic conditions.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/index.html generated
View File

@ -201,19 +201,27 @@
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/interfaces generated
View File

@ -238,19 +238,27 @@ these structs as arguments to <code>measure</code>.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/json generated
View File

@ -414,19 +414,27 @@ for more.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/line-filters generated
View File

@ -205,19 +205,27 @@ lowercase lines.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/maps generated
View File

@ -235,19 +235,27 @@ printed with <code>fmt.Println</code>.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/methods generated
View File

@ -198,19 +198,27 @@ naming related sets of methods: interfaces.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -168,19 +168,27 @@ feature of Go functions; we&rsquo;ll look at this next.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/mutexes generated
View File

@ -252,19 +252,27 @@ management task using only goroutines and channels.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -178,19 +178,27 @@ on both <code>messages</code> and <code>signals</code>.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/number-parsing generated
View File

@ -216,19 +216,27 @@ bits.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/panic generated
View File

@ -187,19 +187,27 @@ to use error-indicating return values wherever possible.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/pointers generated
View File

@ -195,19 +195,27 @@ the memory address for that variable.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/random-numbers generated
View File

@ -237,19 +237,27 @@ that Go can provide.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/range generated
View File

@ -204,19 +204,27 @@ details.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -156,19 +156,27 @@ values be received.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/rate-limiting generated
View File

@ -263,19 +263,27 @@ then serve the remaining 2 with ~200ms delays each.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/reading-files generated
View File

@ -288,19 +288,27 @@ be scheduled immediately after <code>Open</code>ing with
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/recover generated
View File

@ -197,19 +197,27 @@ panic and resumes in the deferred closure.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/recursion generated
View File

@ -183,19 +183,27 @@ knows which function to call with <code>fib</code> here.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -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 themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/select generated
View File

@ -185,19 +185,27 @@ concurrently.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/sha256-hashes generated
View File

@ -201,19 +201,27 @@ you should carefully research
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/signals generated
View File

@ -215,19 +215,27 @@ causing the program to print <code>interrupt</code> and then exit.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

42
public/site.js generated
View File

@ -15,45 +15,3 @@ var clipboard = new Clipboard('.copy', {
return codeLines.filter(function(cL) { return cL != '' }).join("\n").replace(/\n$/, ''); 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
View File

@ -311,19 +311,27 @@ Go&rsquo;s other key builtin data structure: maps.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/sorting generated
View File

@ -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 themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -181,19 +181,27 @@ functions.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -285,19 +285,27 @@ an error message and non-zero return code.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -315,19 +315,27 @@ program.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -458,19 +458,27 @@ and returns a string without printing it anywhere.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -165,19 +165,27 @@ package docs.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -285,19 +285,27 @@ can compare a <code>rune</code> value to a rune literal directly.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -249,19 +249,27 @@ we see that a <code>container</code> now implements the
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/structs generated
View File

@ -268,19 +268,27 @@ pointers are automatically dereferenced.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/switch generated
View File

@ -205,19 +205,27 @@ type corresponding to its clause.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -241,19 +241,27 @@ prefixing them with our temporary directory.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -287,19 +287,27 @@ benchmark function names with a regexp.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/text-templates generated
View File

@ -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 themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/tickers generated
View File

@ -173,19 +173,27 @@ before we stop it.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/time generated
View File

@ -272,19 +272,27 @@ the Unix epoch.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -206,19 +206,27 @@ explaining the parsing problem.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/timeouts generated
View File

@ -184,19 +184,27 @@ out and the second succeeding.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/timers generated
View File

@ -187,19 +187,27 @@ a chance to fire.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/url-parsing generated
View File

@ -238,19 +238,27 @@ pieces that we extracted.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/values generated
View File

@ -154,19 +154,27 @@ basic examples.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/variables generated
View File

@ -186,19 +186,27 @@ This syntax is only available inside functions.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -188,19 +188,27 @@ to form closures, which we&rsquo;ll look at next.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/waitgroups generated
View File

@ -254,19 +254,27 @@ is likely to be different for each invocation.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/worker-pools generated
View File

@ -225,19 +225,27 @@ there are 3 workers operating concurrently.</p>
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/writing-files generated
View File

@ -288,19 +288,27 @@ we&rsquo;ve just seen to the <code>stdin</code> and <code>stdout</code> streams.
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

28
public/xml generated
View File

@ -279,19 +279,27 @@ to nest all <code>plant</code>s under <code>&lt;parent&gt;&lt;child&gt;...</code
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }

View File

@ -11,19 +11,27 @@
var themeButton = document.getElementById('theme-button'); var themeButton = document.getElementById('theme-button');
var body = document.getElementsByTagName('body')[0]; 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) { function activateTheme(theme) {
if (theme === 'dark') { if (theme === 'dark') {
body.style.color = "#ffffffeb"; body.style.color = lightText;
body.style.backgroundColor = "#1a202c"; body.style.backgroundColor = darkBackground;
styleAllTags('a', 'color', '#ffffffeb') styleAllTags('a', 'color', lightText)
styleAllTags('td.code', 'background', '#333333') styleAllTags('td.code', 'background', darkCodeBackground);
styleAllTags('td.code.empty', 'background', '#1a202c') styleAllTags('td.code.empty', 'background', darkBackground)
} else { } else {
body.style.color = "#252519"; body.style.color = darkText;
body.style.backgroundColor = "white"; body.style.backgroundColor = lightBackground;
styleAllTags('a', 'color', '#252519') styleAllTags('a', 'color', darkText)
styleAllTags('td.code', 'background', '#f0f0f0') styleAllTags('td.code', 'background', lightCodeBackground)
styleAllTags('td.code.empty', 'background', 'white') styleAllTags('td.code.empty', 'background', lightBackground)
} }
localStorage.setItem('theme', theme); localStorage.setItem('theme', theme);
} }