I got up ok, not too
tired, and worked. I made a
Javascript to
strip the entered
phone number of all
non-digit characters and a leading
1, then insert a
dash after three and six characters. If the number was longer than ten characters, everything after the tenth is made into an
extension. Example:
Entered: 1.773.958.9482extension365
Formatted: 773-958-9482 ext.365
Source:
function phonefix(field, num) {
// formats phone numbers, as long as they don't deviate too much from standards
regexp = /\D/g; // regexp to strip all non-digits
regexp1 = /^1/; // regexp to strip a leading '1'
num = num.replace(regexp1, ""); // strip the 1
num = num.replace(regexp, "");// strip the non-digits
newnum = num.substring(0, 3) + "-";
// newnum is constructed of old number + "-"s
newnum += num.substring(3, 6) + "-";
newnum += num.substring(6, 10);
if (num.length > 10)
newnum += " ext." + num.substring(10, 15);
field.value = newnum; // send value to field
}
I was surprised it worked so well, then
implemented into every page on the site. I fixed up some
defaults (there were fields that needed to be
Chicago by default because hey, it's in Chicago) and some weird
PHP that was
shittily outsourced, then changed some
arrays, then altered some
MySql tables. I was all
hardcore.
Instead of leaving
the office today and seeing
that big bright thing that floats around and makes things hot, I ate my
leftover oyoka don from
yesterday. It
ruled. The
chicken was a bit dark, and a little not good.
I did little else today.
I noded my ass off. Spent almost half my votes before the
everydevel bastards made things
tinkered and the votes
reset. So I guess it was good because I got a huge
chunk more votes, but
dammit, isn't
90 already enough? I mean
fuck.
Ironically, after noding
devoted downvoter, which is about this fan I have, I seemed to have another fan.
TheNastyCanasty and me are all buddies now because he's not an
asshole after all (hehe. See
my ideal bathroom), and he really likes
my shit. He's going to try to help me
get my fucking modem to work in Linux (no it's not a fucking
winmodem). Maybe then...junktext. I guess. I can get to work on some real
programming at home. Not have to
rely so much on work for learning.
Windows is shit for programming. Need
Linux. Well, I guess
technically just a
Unix, because the site I'm working on at work now is on a
Solaris box. Ah, whatever.
Today listened to
Mocean Worker and ordered
Mixed Emotional Features (told you I would. I don't just
steal the shit) from
half.com. Excited still for
A Soldier's Story to come. Also listened to
Pantera,
Bomb20,
Falco (it's on the
hold music MP3 server at work!), and
Grooverider.
Hell yeah.
So yeah. Finally got my room mostly
nice and
clean. Now I'm going to
hook up TV,
VCR, and
stereo right proper. I had a nice night. Very
relaxing.
Good day.