Is This the Typical Obama Supporter?

October 30th, 2012
privacy
1 comment



So I think my last post about Obama must have been a good one.

Some thoughtful individual was so motivated by it that he/she exerted the energy to peruse my site for a contact form, fill it out, and send me the following constructive criticism:

Aww... shucks. I have a Secret Admirer.

Bit of trivia: this is my first ever "hate email," and I'm honored.

Jokes aside, is this indicative of the typical Obama-supporter? My Secret Admirer notwithstanding, I've received nothing but positive feedback about that post so far.

Why is the only dissenting point of view expressed in such a vitriolic manner? Why can my Secret Admirer say nothing of substance? Why must he/she throw around 3rd-grade playground insults?

I backed up my argument with sources (41 news links and 6 videos). My Secret Admirer didn't even have an argument. Is there nothing that can be said to explain the absolutely abysmal record of their beloved candidate? I really want to know.

If anyone has anything to add to what I've said, I always welcome a discussion, whether you agree with me or not.

So, Secret Admirer, if you're out there, reading this, please come talk to me. Show me how I'm stupid rather than just telling me I am. I don't want to feel bad anymore. Show me the way.

contact

Why I will not vote for Obama

October 30th, 2012guidelines 1 comment



I will not vote for Barack Obama for President of the United States, and here's why.

Fair warning: This is going to be a long one. I've begun with a short summary. If you'd like to know the details behind each claim, read on.

Short version

  1. He is the most pro-abortion president in history, arguing even for the killing of born children*.
  2. He has thrown out the 1st Amendment by directly attacking the freedom of religion.
  3. He is the most financially irresponsible president in history.


Long version


Read more...

Override alert() With jQuery UI Dialog

July 25th, 2012home 12 comments

This is a quick trick I wanted to share.

Have you ever wanted to customize the appearance of alerts to fit the theme of your website? If you're using jQuery UI, it's almost stupid how easy it is.

Check it out:

Just add this to the top of your javascript

1
2
3
4
5
6
7
8
9
10
11
12
13
window.alert = function(message){
    $(document.createElement('div'))
        .attr({title: 'Alert', 'class': 'alert'})
        .html(message)
        .dialog({
            buttons: {OK: function(){$(this).dialog('close');}},
            close: function(){$(this).remove();},
            draggable: true,
            modal: true,
            resizable: false,
            width: 'auto'
        });
};

And add a little bit of CSS to make it look nicer

1
2
3
4
5
6
7
8
9
.alert
{
    font-size: 1.3em;
    padding: 1em;
    text-align: center;
    white-space: nowrap;
    width: auto;
    word-wrap: normal;
}

Usage

Now, calling:

1
alert('This is a test of the <strong>new</strong> alert!');

Gives you:

(With the jQuery UI Smoothness theme)

Notice, you can use HTML in your alerts now.

Caveats

Since the old alert was an actual modal window, and this new one is simply mimicking it from inside the main document, there are a few differences in behavior that are worth noting.

  • The new alert will not raise a window event like the old alert did. If your window is not in focus, the user will have no idea anything has happened.
  • The new alert does not block javascript execution like the old alert did. With the old alert, as soon as it's triggered, all javascript stops and waits for the user to close the alert box.
  • Because the new alert is non-blocking, you can have multiple alerts open at the same time. In the case of multiple alerts, the user will see them in reverse chronological order, which can be confusing.

Fallback

If you simply have to have your window-event-raising, javascript-execution-blocking, one-at-a-time, boring alerts, then you could also provide a fallback like so:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
window.old_alert = window.alert;
window.alert = function(message, fallback){
    if(fallback)
    {
        old_alert(message);
        return;
    }
    $(document.createElement('div'))
        .attr({title: 'Alert', 'class': 'alert'})
        .html(message)
        .dialog({
            buttons: {OK: function(){$(this).dialog('close');}},
            close: function(){$(this).remove();},
            draggable: true,
            modal: true,
            resizable: false,
            width: 'auto'
        });
};

Then use like so:

1
2
3
4
5
6
7
// New Alert
alert('This is a <strong>new</strong> alert!');

// Old Alert:
alert('This is an old, boring alert.', true);
// Or:
old_alert('This is an old, boring alert.');

Conclusion

As long as the caveats aren't a problem for you (hint: they shouldn't be in a well-designed web application) or the fallback works for you, enjoy your snazzy new alerts!