Revisiting rebeccamurphey.com
In the summer of 2006, I decided to put together a small web site to show the work I'd been doing, in hopes of landing a full-fledged web job. It didn't take long before I had an offer from webslingerz, where I've been for the last year and a half. I've updated my resume a few times since then, and added a couple of items to my portfolio, but the more I learned about HTML, CSS and Javascript, the less stomach I had for going back to see whether what I'd done in the code still made sense. I knew that I'd leaned heavily on text stored in Javascript arrays, out of sight of search engines; I also knew that, in hindsight, my level of Javascript proficiency at the time was probably laughable, and there would be lots to rethink. Well. Today I took a deep breath and went back to my portfolio site to see the damage my 2006 self had done. And oh what a mess. My HTML was riddled with excessive classes and divs and less-than-semantic markup. I, too, had used gems like
$('document').ready(function() {
$.toc('#panels h2,#panels h3').
attr('id','toc').
insertAfter('#header');
$('#toc li a').each(function() {
var $a = $(this);
var href = $a.attr('href');
href = href.replace('#','');
var $anchor = $('#panels a.anchor[name="' + href + '"]');
if ($anchor.parent().is('div.panel')) {
var subpanel = false;
var $panel = $anchor.parents('div.panel');
} else {
var subpanel = true;
var $panel = $anchor.parent();
}
$a.click(function() {
if (subpanel) {
$panel.siblings().hide();
$panel.fadeIn();
var $panelParent = $panel.parents('div.panel');
$panelParent.siblings().hide();
$panelParent.show();
} else {
$panel.siblings().hide();
$panel.find('li').show();
$panel.fadeIn();
}
});
});
$('#panels a.anchor').remove();
var url = document.location.toString();
if (url.match('#')) {
var urlAnchor = url.split('#')[1];
var $a = $('#toc a[href="#' + urlAnchor + '"]');
$a.click();
}
});