\
\
\
This site is designed to work on any web browser from any era and is also available in Gopherspace [WWW Proxy]. I also maintain an archive of ancient web browsers.";
var d = new Date();
var day = d.getDay();
var days = new Array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday");
var dayName = days[day];
document.getElementById('etc').innerHTML += '
Land Travel
\
Thinking of traveling today? Be sure to keep the rijal al-ghayb behind you. Tread wisely! \

\
From Gerhard Herklots\' translation of a ca. 1832 manuscript by Ja\'far Sharif.';
}
}
function initialize() {
var default_theme = 'plain';
var alt_theme = 'retro';
document.body.removeAttribute("style");
// replace CV link with PDF link on modern browsers
if(document.getElementById('cv') != null) {
document.getElementById('cv').href = 'cv.pdf';
}
if(document.getElementById('doodle') != null) {
document.getElementById('doodle').parentNode.removeChild(document.getElementById('doodle'));
}
var elements = document.body.getElementsByTagName('font');
for (var i = 0; i < elements.length; i = i+1) {
elements[i].outerHTML = elements[i].innerHTML;
}
var elements = document.body.getElementsByTagName('a');
for (var i = 0; i < elements.length; i = i+1) {
if(elements[i].href.indexOf('flanigan.us') == -1) {
elements[i].target = "_blank";
}
}
initializeJSCompat();
// set theme based in incoming referrer / passed theme from URL params
var urlParams = (new URL(window.location)).searchParams;
var theme = urlParams.get('theme');
if(theme != default_theme && theme != alt_theme && theme != "linemode") {
if(document.referrer != "" && document.referrer.indexOf(location.protocol + "//" + location.host) == 0) {
urlParams = (new URL(document.referrer)).searchParams;
theme = urlParams.get('theme');
}
if(theme == alt_theme) {
console.log("here!");
var currentUrl = new URL(window.location);
currentUrl.searchParams.set("theme", alt_theme);
var nextTitle = document.title;
var nextState = " additionalInformation: 'Updated the URL with JS' ";
window.history.replaceState(nextState, nextTitle, currentUrl);
/* SET THE DEFAULT HERE */
} else { theme = default_theme; }
}
// Fill in homepage sections on modern browsers
if(document.body.id == "home" && theme != "linemode"){
writeSection("research");
writeSection("teaching");
writeSection("site_notes");
if(document.getElementById("about_link") != null){
document.getElementById("about_link").setAttribute('href', '#about');
}
if(document.getElementById("research_link") != null){
document.getElementById("research_link").setAttribute('href', '#research');
}
if(document.getElementById("teaching_link") != null){
document.getElementById("teaching_link").setAttribute('href', '#teaching');
}
if(document.getElementById("job") != null){
document.getElementById("job").innerHTML = "";
}
}
// Special tasks for the homepage
if(document.body.id == "home") {
// writeButtons();
}
if (document.getElementById('research') != null) {
var elements = document.getElementById('research').querySelectorAll('H3 > UL');
for (var i = 0; i < elements.length; i+1) {
var e = elements[i].querySelectorAll('UL > LI');
for (var j = 0; j < e.length; j+1) {
e[j].outerHTML = e[j].innerHTML;
}
elements[i].outerHTML = elements[i].innerHTML;
}
}
if(theme == alt_theme) {
setTheme(alt_theme);
}
else if (theme == "linemode") {
linemode();
}
else {
setTheme(default_theme);
}
// hide email from bots
if(document.getElementById('email') != null) {
var domain = 'lmu.de'; var user = 'e.flanigan'; var email = user + '@' + domain;
document.getElementById('email').href = 'mailto:' + email;
if(document.getElementById('email').innerHTML.toLowerCase() != 'mail') {
document.getElementById('email').innerHTML = email;
}
}
// add explanatory alert box to top of retro-themed page
if(theme == 'retro' && document.body.id == 'home') {
retroAlert();
}
}
function toggleStyle() {
var theme = document.getElementById('theme');
var currentUrl = new URL(window.location);
var nextTitle = document.title;
var nextState = " additionalInformation: 'Updated the URL with JS' ";
if (theme.getAttribute('href') == '/~tweedy/css/retro.css') { // If set to retro, then...
setTheme('plain');
} else if (theme.getAttribute('href') == '/~tweedy/css/plain.css') { // If set to modern, then...
setTheme('retro');
if(document.body.id == 'home') {
retroAlert();
}
}
}
function writeSection(id) {
if(document.getElementById(id) != null){
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET", id + ".html", false);
xhttp.responseType = document;
xhttp.send();
var dom = new DOMParser();
var doc = dom.parseFromString(xhttp.responseText, "text/html");
if(id == "research") {
if(doc.getElementById("TOC") != null){doc.getElementById('TOC').remove();}
//var inputs = doc.getElementsByTagName('details');
//for(var i = 0; i < inputs.length; i++) {
// inputs[i].open = false;
//}
//if(doc.getElementsByTagName('summary') != null){
// papers = doc.getElementsByTagName('summary');
// for (var i = 0; i < papers.length; i+1) {
// //console.log(papers[i].innerHTML);
// papers[i].innerHTML = papers[i].innerHTML.replaceAll('>"','>');
// papers[i].innerHTML = papers[i].innerHTML.replaceAll('>,"','>,');
// }
//}
}
var target = doc.getElementsByTagName("section")[0].innerHTML;
document.getElementById(id).innerHTML = target;
}
}
function writeLink(type, rel, href, media, id) {
var link = document.createElement('link');
link.type = type;
link.rel = rel;
link.href = href;
if(typeof media != "undefined") {link.media = media;}
if(typeof id != "undefined") {link.id = id;}
document.getElementsByTagName('head')[0].appendChild(link);
}
function writePreload(href, as) {
var preloadLink = document.createElement("link");
preloadLink.href = href;
preloadLink.rel = "preload";
preloadLink.as = as;
document.head.appendChild(preloadLink);
}
function writeBody(bgcolor) {
if(typeof bgcolor != "undefined") {bg = ' BGCOLOR="'+bgcolor+'"';}
output = "";
document.write(output);
}
function writeButtons() {
var btn = document.createElement('A');
btn.className = 'btn';
btn.setAttribute('id', 'hypercard');
btn.setAttribute('href', '/hypercard.html');
btn.setAttribute('target', '_blank');
document.body.appendChild(btn);
var btn = document.createElement('A');
btn.className = 'btn';
btn.setAttribute('id', 'linemode');
btn.setAttribute('href', '/index.html?theme=linemode');
btn.setAttribute('target', '_blank');
document.body.appendChild(btn);
var btn = document.createElement('A');
btn.className = 'btn';
btn.setAttribute('id', 'www');
btn.setAttribute('href', '/index.html?theme=retro');
btn.setAttribute('target', '_blank');
document.body.appendChild(btn);
var btn = document.createElement('A');
btn.className = 'btn';
btn.setAttribute('id', 'gopher');
btn.setAttribute('href', '/1/~tweedy');
btn.setAttribute('target', '_blank');
document.body.appendChild(btn);
var btn = document.createElement('A');
btn.className = 'btn';
btn.setAttribute('id', 'inet');
btn.setAttribute('href', '/internetworking.html');
btn.setAttribute('target', '_blank');
document.body.appendChild(btn);
}
function setTheme(themeChoice) {
var theme = document.getElementById('theme');
var currentUrl = new URL(window.location);
var nextTitle = document.title;
var nextState = " additionalInformation: 'Updated the URL with JS' ";
if(themeChoice == 'plain') {
theme.setAttribute('href', '/~tweedy/css/plain.css');
if (currentUrl.searchParams.get("theme")) {
currentUrl.searchParams.set("theme", "plain");
}
if (currentUrl.searchParams.get("theme", "plain")) {
currentUrl.search = '';
}
window.history.replaceState(nextState, nextTitle, currentUrl);
}
if(themeChoice == 'retro') {
theme.setAttribute('href', '/~tweedy/css/retro.css');
currentUrl.searchParams.set("theme", "retro");
window.history.replaceState(nextState, nextTitle, currentUrl);
if(document.getElementById('cv') != null) {document.getElementById('cv').href="cv.html";}
}
}
function retroAlert() {
document.body.innerHTML = '
[X] "This project is experimental and of course comes without any warranty whatsoever. However, it could start a revolution in information access." --Tim Berners-Lee,
announcing the World Wide Web The stylesheet used here is a modern implementation of the stylesheet used in WorldWideWeb / Nexus, the first web browser, written by the inventor of the World Wide Web, Tim Berners-Lee. In other words, you\'re seeing this page much as it would have appeared circa 1991 ☺︎
' + document.body.innerHTML;
}
function linemode() {
var links = document.querySelectorAll('link[rel="stylesheet"]');
for (var i = 0; i < links.length; i++) {
var link = links[i];
link.disabled = true; // For IE
link.parentNode.removeChild(link); // For other browsers
};
writeLink("text/css", "stylesheet", "/~tweedy/css/linemode.css", "screen", "theme");
if(document.getElementById('cv') != null) {document.getElementById('cv').href="cv.html";}
var e = document.getElementsByClassName("btn");
while(e.length > 0) {
e[0].remove();
}
e = document.getElementsByTagName("a");
for(i=0;i < e.length; i++) {
if(e[i].href != '') {
if(e[i].href.indexOf("flanigan.us") > -1 && e[i].href.substring(0, 4) == "http") {
e[i].href+="?theme=linemode";
}
}
}
document.body.innerHTML += '
';
if(document.body.id == "home") {
document.body.insertAdjacentHTML('afterbegin', '
');
}
var imported1 = document.createElement('script');
var imported2 = document.createElement('script');
var imported3 = document.createElement('script');
imported1.src = '/~tweedy/js/blocker.js';
document.head.appendChild(imported1);
imported2.src = '/~tweedy/js/keyboardSounds.js';
document.head.appendChild(imported2);
imported3.src = '/~tweedy/js/commandline.js';
document.head.appendChild(imported3);
}