All Posts in The Programming Mechanism

March 28, 2007 - 26 comments

Safari CSS hack

Please note that this hack does not work in Safari 3. The updated hack is here.

While I’m not a fan of CSS hacks in general, there comes a time when nothing else will solve the problem. This was the situation this morning—the site looked perfect in every browser except Safari (due to a background repeat bug), and I needed a quick way to apply CSS rules to Safari alone. Here’s the hack:

Place the pound sign ( # ) after a semi-colon ( ; ), all styles within those brackets and the remainder of the stylesheet will be ignored in Safari.

Example: The following code will make any <p> assigned the callout class red with normal font-weight in Safari, but black and bold in the rest of the browsers.
p.callout { color:#FF0000; font-weight:normal; }
p.callout { color:#000000; font-weight:bold;# }

[demo]

Tested on Mac OS X version 10.4.9 with Safari version 2.0.4 (419.3) and Mozilla Firefox version 2.0.0.3. Tested on Windows XP SP 2 with Mozilla Firefox version 2.0.0.3, Opera 9.10, and Microsoft Internet Explorer 6 and 7. Hack from bballcity

Published by: jeffreybarke in The Programming Mechanism
Tags:

March 27, 2007 - 2 comments

New York Web Standards Meetup Group Presentation

These are the notes to my recent presentation on AJAX and forms to the New York Web Standards Meetup Group. These notes were purposefully left open and vague to facilitate discussion based on attendees’ interests—during the presentation a lot of good questions were asked. That dialogue is not represented here.

Hello, my name is Jeffrey Barke. I’m the Senior Developer and Information Architect for the US office of theMechanism and I plan on talking briefly about how to easily use AJAX to improve the usability of forms and admin/control panel interfaces.

Read more

Published by: jeffreybarke in The Programming Mechanism

March 16, 2007 - 2 comments

mini AJAX version 1.1.1

Updated mini AJAX yesterday after I discovered a function name conflict in Internet Explorer 7. This conflict only occurs if one is using mini AJAX in tandem with Prototype [which we do all the time]. For some unknown reason, this hadn’t been a problem for any of the other browsers [Safari, Firefox on Mac and Firefox, Opera on PC], but it caused the script to fail ignominiously in Internet Explorer 7.

So, if you downloaded mini AJAX from this site prior to 16 March 2007 and plan on using it with Prototype or script.aculo.us, please download the latest version here.

Published by: jeffreybarke in The Programming Mechanism

March 6, 2007 - 8 comments

mini AJAX

Mini AJAX is a “handy, lightweight” set of AJAX functions recently adopted by theMechanism. While Tim Morgan’s script is well-documented and easy to plug into an existing application, we did find it a bit limiting that it only returns string data (responseText). Since we’re typically accessing XML, it would be nice to have the option of using responseXML.

So, we modified mini AJAX by adding two new methods that do just that:

ajax.getxml(strUrl, strFunc)
strUrl—the URL to query (can contain arguments after a “?”)
strFunc—the function to call once the response is returned
This method uses a GET request to query the specified URL and return a response as an XML DOM object to the specified function.

ajax.postxml(strUrl, strFunc, strArgs)
strUrl—the URL to query
strFunc—the function to call once the response is returned
strArgs—a string containing arguments to be passed to the URL
This method uses a POST request to query the specified URL and return a response as an XML DOM object to the specified function.

20070315 update—Updated mini AJAX after I discovered a function name conflict in Internet Explorer 7. This conflict only occurs if one is using mini AJAX in tandem with Prototype [which we do all the time]. For some unknown reason, this hadn’t been a problem for any of the other browsers [Safari, Firefox on Mac and Firefox, Opera on PC], but it caused the script to fail ignominiously in Internet Explorer.

The updated version of mini AJAX can be found here.

Published by: jeffreybarke in The Programming Mechanism

February 19, 2007 - Comments Off on Locating Google Earth KML/KMZ files using Google search

Locating Google Earth KML/KMZ files using Google search

From AnyGeo, via Donna:

There's an easy way to search for all KML files available on the web: using Google Search, simply enter the following string to search for a KML file for Brooklyn:

filetype:kml brooklyn

or

filetype:kmz milwaukee

Note the vast number of results… you can refine your search or add even more detail if you'd like better results. Similarly, if you'd like to locate an AutoCAD DWF format file, try this search string:

filetype:dwf brooklyn

Published by: jeffreybarke in The Programming Mechanism

May 31, 2006 - Comments Off on Wishing there were more songs about monkeys, furry lobsters and IKEA?

Wishing there were more songs about monkeys, furry lobsters and IKEA?

Then I suggest that you check out Jonathan Coulton www.jonathancoulton.com. Brooklyn resident and former software writer, Coulton left the corporate world to pursue ummm...whatever it is he does...which includes writing songs for Mtv and producing independent CDs filled with tasty audio gems like "Skullcrusher Mountain" and "Code Monkey."

Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
With big warm fuzzy secret heart:
Code Monkey like you
Code Monkey like you a lot

While he is waiting for fame and fortune, you may want to take a listen - maybe download a song or two for your favorite code monkey. After all, "he like you alot."

Published by: sharonterry in The Programming Mechanism, The Thinking Mechanism

February 9, 2006 - Comments Off on The Accessibility Wars Begin

The Accessibility Wars Begin

theMechanism's been yapping about this for years, but it looks like the first significant blow has been dealt to corporations. Target has had legal action brought against them by the National Federation of the Blind due to accessibility issues with Target's website. This will be the first of many lawsuits brought against corporations over accessibility. See? There's a reason that we've been building sites to be Section 508 Compliant for years.

Published by: davefletcher in The Programming Mechanism
Tags: