diff --git a/about/index.php b/about/index.php index a1314e6..bf239f5 100644 --- a/about/index.php +++ b/about/index.php @@ -27,7 +27,7 @@ XMPP: - reimar@reim.ar + reimar@reim.ar
diff --git a/assets/img/tree_dark.png b/assets/img/tree_dark.png index 86380e8..dd6ecb5 100644 Binary files a/assets/img/tree_dark.png and b/assets/img/tree_dark.png differ diff --git a/assets/img/tree_light.png b/assets/img/tree_light.png index ed1f2fb..93591d2 100644 Binary files a/assets/img/tree_light.png and b/assets/img/tree_light.png differ diff --git a/assets/script/.theme.js.swp b/assets/script/.theme.js.swp new file mode 100644 index 0000000..ba2ab21 Binary files /dev/null and b/assets/script/.theme.js.swp differ diff --git a/assets/script/compatibility.js b/assets/script/compatibility.js index e312b36..6216159 100644 --- a/assets/script/compatibility.js +++ b/assets/script/compatibility.js @@ -1,11 +1,40 @@ if (!document.getElementsByClassName) { document.getElementsByClassName = function(className) { - return document.querySelectorAll("." + className); + + if (document.querySelectorAll) + return document.querySelectorAll("." + className); + + var results = []; + for (var i = 0; i < document.all.length; i++) { + if (new RegExp("\\b" + className + "\\b").test(document.all[i].className)) + results.push(document.all[i]); + } + return results; + } +} + +if (!document.querySelector) { + var style = document.createStyleSheet(); + + // https://stackoverflow.com/a/53554212 + document.querySelector = function(query) { + style.addRule(query, "foo:bar"); + for (var i = 0; i < document.all.length; i++) { + if (document.all[i].currentStyle.foo === "bar") + return document.all[i]; + } + style.removeRule(0); } } if (!window.addEventListener) { - window.addEventListener = window.attachEvent; + window.addEventListener = function(event, callback) { + window.attachEvent("on" + event, callback); + } +} + +if (!document.head) { + document.head = document.getElementsByTagName("head")[0]; } function toArray(iter) { diff --git a/assets/script/theme.js b/assets/script/theme.js index ea53881..62ad928 100644 --- a/assets/script/theme.js +++ b/assets/script/theme.js @@ -83,7 +83,7 @@ window.addEventListener("load", function() { // Set trees var trees = document.getElementsByClassName("tree"); for (var i = 0; i < trees.length; i++) { - trees[i].src = "/assets/img/tree_" + theme + ".svg"; + trees[i].src = "/assets/img/tree_" + theme + (window.SVGElement ? ".svg" : ".png"); } if (!firstTime) { @@ -94,13 +94,13 @@ window.addEventListener("load", function() { jsTheme.href = "/assets/style/" + theme + "-mode.css"; document.head.appendChild(jsTheme); - if (linkOnloadSupported) { + if (window.linkOnloadSupported) { document.body.className += " loading"; jsTheme.onload = function () { document.body.className = document.body.className.replace(/\s*loading/g, ""); var themeStyles = document.getElementsByClassName("theme-style"); for (var i = 0; i < themeStyles.length; i++) { - document.querySelector("head").removeChild(themeStyles[i]); + document.head.removeChild(themeStyles[i]); } } } @@ -112,12 +112,14 @@ window.addEventListener("load", function() { // Functions to select/deselect a theme button function selectThemeButton(themeBtn) { - themeBtn.textContent += " ✓"; + if (themeBtn.textContent) themeBtn.textContent += " ✓"; + else themeBtn.innerText += " ✓"; themeBtn.className += "selected"; } function deselectThemeButton(themeBtn) { - themeBtn.textContent = themeBtn.textContent.replace(" ✓", ""); + if (themeBtn.textContent) themeBtn.textContent = themeBtn.textContent.replace(" ✓", ""); + else themeBtn.innerText = themeBtn.innerText.replace(" ✓", ""); themeBtn.className = themeBtn.className.replace("selected", ""); } diff --git a/assets/style/dark-mode.css b/assets/style/dark-mode.css index 784eb42..60b53ff 100644 --- a/assets/style/dark-mode.css +++ b/assets/style/dark-mode.css @@ -46,6 +46,7 @@ body { -o-box-shadow: 2px 2px 0 black; -moz-box-shadow: 2px 2px 0 black; -webkit-box-shadow: 2px 2px 0 black; + filter: progid:DXImageTransform.Microsoft.DropShadow(color=#FF000000, offX=2, offY=2); } .container::selection, .container *::selection { background-color: #EEE; diff --git a/assets/style/light-mode.css b/assets/style/light-mode.css index 696113b..25ff0ec 100644 --- a/assets/style/light-mode.css +++ b/assets/style/light-mode.css @@ -46,6 +46,7 @@ body { -o-box-shadow: 2px 2px 0 #BDBDBD; -moz-box-shadow: 2px 2px 0 #BDBDBD; -webkit-box-shadow: 2px 2px 0 #BDBDBD; + filter: progid:DXImageTransform.Microsoft.DropShadow(color=#FFBDBDBD, offX=2, offY=2); } .container::selection, .container *::selection { background-color: #212121; diff --git a/assets/style/main.css b/assets/style/main.css index 1be8181..8ac9a91 100644 --- a/assets/style/main.css +++ b/assets/style/main.css @@ -62,10 +62,12 @@ a:hover { padding: 5px 10px; cursor: pointer; margin: 1px; + *margin: 0; /* Fix spacing on IE7 */ border-bottom-width: 3px; border-bottom-style: solid; font-weight: bold; text-decoration: none; + display: inline-block; /* Fix drop shadow on IE8- */ transition: border-bottom-color 0.2s; -o-transition: border-bottom-color 0.2s; -moz-transition: border-bottom-color 0.2s; @@ -143,7 +145,9 @@ h1, h2 { .container { direction: ltr; /* IE polyfills */ - behavior: url("/assets/lib/css3pie/PIE.htc"); + /* behavior: url("/assets/lib/css3pie/PIE.htc"); */ + position: relative; /* Fix z-index on IE */ + *display: inline-block; /* Re-enable user select for text */ user-select: text; -ms-user-select: text; @@ -152,6 +156,9 @@ h1, h2 { -webkit-user-select: text; -webkit-touch-callout: default; } +.container > * { + position: relative; /* Don't apply drop shadow on children on IE8- */ +} /* Inline code */ .inline-code-text { diff --git a/inc/head.inc b/inc/head.inc index 11a37f4..61f80be 100644 --- a/inc/head.inc +++ b/inc/head.inc @@ -15,8 +15,16 @@ - - - - - + + + + + + + + diff --git a/inc/nav.inc b/inc/nav.inc index cdcb670..846a63c 100644 --- a/inc/nav.inc +++ b/inc/nav.inc @@ -13,8 +13,8 @@ $is_selected = $link[0] == $path || $link[0] == rtrim($path, '/'); echo $is_selected ? - "$link[1]\n" : - "$link[1]\n"; + "$link[1]" : + "$link[1]"; } ?>