I’ve made quite a few changes to my pluggable version of slurl.com, most of which centred around replacing the hash-slurl.js plugin with hash-fu.js. Below is a summary of the changes made today.
The Map
- Removed some CSS code left over from the original work done for Hack a Day 2009.
- Replaced hash-slurl.js with hash-fu.js.
- Removed the Gears plugin since that’s being phased out, with developers being encouraged to use HTML5 goodness.
UI Top Bar
mapapi.js
No feature alterations here, just some fixes for a couple bugs that cropped up during the course of today’s updates, one of which was in the error handler and the other was to fix how axes with co-ordinates set to 0 were handled.
hash-fu.js
hash-fu.js isn’t too dissimilar to hash-slurl.js, in the respect that they both monitor document.location.hash for changes, then attempt to act upon those changes.
Where hash-slurl.js tried to cram the processing for such changes into the same file, hash-fu.js prefers to leave such logic to other plugins. Where hash-slurl.js uses an if-else structure with hard-coded feature support, hash-fu.js uses a for structure with callbacks. Additionally, it supports multiple commands being fired in the same fragment via a fake query string e.g. example.com/#?foo=bar&slurl/Ahern/.