Opening a MooTools Accordion section from a link.

Here are a couple prototype functions that extend the Mootools Accordion to open a section from a link with an anchor. eg..

http://www.liquidnexus.com/index.php#ANCHOR

In the mootools 1.1 days, it was a subclass, but something changed that was far too evil to deal with right now, so I consolidated it into two functions that you can use with the existing Accordion class.

Array.prototype.findIndex = function(value){
var ctr = "";
for (var i=0; i < this.length; i++) {
// use === to check for Matches. ie., identical (===), ;
if (this[i] == value) {
return i;
}
}
return ctr;
};

Accordion.prototype.displayAnchoredSection = function(wrapperElement){
var displaySection = 0;
var anchor = window.location.href.split('#')[1];
if(anchor){
var sections = $$(wrapperElement);
var items = new Array();
for (var i=0; i < sections.length; i++) {
items[i]=sections[i].getElementsByTagName(’a')[0].getAttribute(”name”);
};
displaySection = items.findIndex(anchor);
};
this.display(displaySection);
}

The first function is a prototype to return the index of an item in an array, the second function pulls the anchor from the location url, and tells the accordion to display that section. There are a few caveats to using this, as I just threw it together for my own personal use. First, you have to wrap each section of your accordion in wrapper class, and then in your domready event, create your accordion, and then tell it which section to open.

var accordion = new Accordion($$('\*toggler\*'), $$('\*content\*'));
accordion.displayAnchoredSection('\*wrapperClass\*');

I’m not feeling very articulate as I’m writing this, so if I’m talking in circles, you’ll have to excuse me. If you have any issues, just tweet me @bdelcamp on twitter, or email me.

Gathering up.

In a respose to David Lanhams tweet here , I put together a gathering script to bundle up your rogue files and put them all in one place to be lost in oblivion for all eternity, or until you organize them, whichever comes first… I recommend that you do NOT use Quicksilver to attach a trigger for this because QS’s application specific triggers are severely broken under Leopard, and BadThings™ can happen, so I suggest using Spark, or Butler or something else that has app specific triggers. Also included is a compiled application script to add to your finder toolbar if hotkeys arent’ your thing.


Have at it.

RRoD’d


No joke, it really sucks.

I AM NOT A CYLON!

More Broken-ness

Things will probably be horribly broken here and there as I transition to wordpress 2.5. I didn’t realize how out of date my theme and plugins were until I upgraded and the interwebz almost blew my house up.

Army of Two Codes I Give You?

I happen to have 3 0 extra Army of Two weapon codes from Gamestop if anyone is in need of any. Post a comment (try to be creative…), and leave your preferred method of contact (email or Live Gamertag) and I’ll get a few out to you.

Sorry, all gone.

Christmas Eve in Brooklyn

‘Twas the night before Christmas,Da whole house was mellow,Not a creature was stirrin’,I had a gun unda my pillow.
When up on da roof,I heard somethin’ pound,I sprung to da window,To scream, “Ay, keep it down!”
When what to my wanderin’ eyes should appear,But dat hairy elf Vinny,And eight friggin’ reindeer.
Wit’ a bad hackin’ cough,and the stencha burped beer,I knew in a moment,Yo, da Kringle wuz here!
Wit’ a slap to dere snouts,and a yank on dere manes,He cursed and he shouted ,And called dem by name.
Yo Tony, Yo Frankie,Yo Sally, Yo Vito,Ay Joey, Ay Paulie,Ay Pepe, Ay Guido!
As I drew out my gun,and hid by da bed,Down came his friggn’ boot,on da top a my head.
His eyes were all bloodshot,His b.o. wuz scary,His breath wuz like sewage,He had a mole dat wuz hairy.
He spit in my eye,And he twisted my head,He soon let me know,I should consider myself dead.
Den pointin’ a fat finga, right unda my nose,He let out some gas,And up the chimney he rose.
He sprang to his sleigh,Obscenities screamin’,And away dey all flew,Before he troo dem a beatin’.
But I heard him exclaim,or better yet grump,Merry Christmas to all, and Bite me, ya hump!
Wishing everyone a merry christmas and a healthy new year!

You Have 2 Cows…

Can’t remember where I got this from, but I just came across the file, and thought I would share… 

MONARCHY: You have two cows. The king takes both and hangs you. He then nurtures the cows until they’re fat and eats them while the poor peasants starve.

ANARCHY: You have two cows. Your neighbour claims you stole them from him. You then agree without government interaction that you each keep one cow.

Continue reading ‘You Have 2 Cows…’

Behold, the Power of Photoshop… Yikes.

Hey Bidder Bidder Bidder….

I’m thinking of selling my PSP if anyone is interested here’s a few specs:

  • Bought it first day it came out
  • Dark Alex 3.40 OE Firmware installed
  • 256MB & 2GB Memory Stick Duo
  • Tiger Woods PGA Tour UMD
  • Metal Gear AC!D UMD (No Case for that, sorry)
  • Spider Man 2 UMD Movie
  • Padded Carrying Case & Wrist Stratp
  • Immaculate condition

I’m hoping to get at least $175 for the lot. If you’re interested, drop me a line.