#ImWithHer

About Single-Issue Voting…

Oh, 2016. Are you over yet?

This election is a doozy. This past month, I have had more conversations about 2 certain individuals than I ever wanted to have in my entire life.

Thanks to my outspoken nature on the subject of abortion, I have been repeatedly accused of being a “Single-Issue Voter“. And in this election – more than any other I’ve experienced so far – that implication incites the most unbelievable rage in the accuser.

Which Issue

In truth, everyone has their “one issue;” the issue that matters to them more than anything else. Some people say it’s the threat of nuclear war or WWIII. For others it’s poverty, the death penalty, terrorism, the environment, or immigration.

Mine is abortion, and here’s why:
Read More

Why I will not vote for Obama



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

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

[cc lang=’javascript’ ]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’
});
};[/cc]

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

[cc lang=’css’ ].alert
{
font-size: 1.3em;
padding: 1em;
text-align: center;
white-space: nowrap;
width: auto;
word-wrap: normal;
}[/cc]

Usage

Now, calling:

[cc lang=’javascript’ ]alert(‘This is a test of the new alert!’);[/cc]

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:

[cc lang=’javascript’ ]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’
});
};[/cc]

Then use like so:

[cc lang=’javascript’ ]// New Alert
alert(‘This is a new alert!’);

// Old Alert:
alert(‘This is an old, boring alert.’, true);
// Or:
old_alert(‘This is an old, boring alert.’);[/cc]

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!