Author Archives: Alexander O'Mara

wheellistener – Cross-browser wheel event listener

If you ever wanted to use scroll events in your web app, you’ve probably found what a mess it is, I know I did when I was developing this the theme used on this website. There are snippets out there to try to resolve legacy browser issues, but all of them are half-baked and missing basic functionality such as proper feature-detection and the ability to remove an event listener. All of these issues seems simple, but are actually quite complex to implement properly, and without memory leaks.

We can do better! That’s why I created this library.

Continue reading

WordPress Revisional Metabox Library Now Available

Revisional metaboxes in WordPress made easy.

Today, I present to you WordPress Revisional Metabox, a WordPress PHP library to make revisional metaboxes dead-simple, released as open-source on GitHub. This library is even easier to use than the usual procedural methods for registering custom metaboxes, so I have provided an option to disable revisions on a metabox in case revisions are not appropriate for all your metaboxes.

WordPress 2.6 introduced post revisions for the editor so that authors could save revisions of their content. While this feature has been great for storing revisions of the built-in post title, content, and excerpt fields, it was not very flexible for use by developers to store other data.

In WordPress 4.1, the necessary actions and filters were added to facilitate custom metabox revisions, so that developers can hook into this new functionality, but unfortunately the feature remains prohibitively difficult to use.

That is, unless you use this class to abstract away all the difficulties.

Now WordPress developers can use this amazing functionality for their own projects with ease, and improve the user experience for all.

jQuery ajaxreadystate plugin

Today I’ve released a new open source library, so I figured what better time to post a new entry in my blog.

My latest open source contribution to the world is jquery-ajaxreadystate, a jQuery plugin which adds a new AJAX function with readystatechange capabilities, available for download on GitHub, NPM, and Bower.

The jQuery AJAX implementation is somewhat limited in that it does not provide a way of responding to the readystatechange events that fire during the AJAX request. The jQuery.ajax API documentation actually states the following.

No onreadystatechange mechanism is provided, however, since done, fail, always, and statusCode cover all conceivable requirements.

While this statement is true for most use cases, what if you want to access the response headers or status code before the entire request completes, or access the response body as it streams?

Evidently jQuery does not provide this functionality due to browser compatibility issues, so this plugin adds this extra functionality for browsers that support these features (see compatibility notes below).

This plugin works by adding a new method jQuery.ajaxreadystate method, which acts as a wrapper for jQuery.ajax, extending the functionality and updating the jqXHR object to remove the limitations and update properties as the readyState changes.

AIRControl 1.1

I have published a small update to AIRControl which will hopefully address some scattered performance issues a few people have been reporting. I have made the following changes:

  • Limited the Windows extension to checking for new controllers to only once per second to improve performance.
  • Added debug output that can be enabled for runtime debugging.

I have also added a new example for how to use the new debug callback function.

AIRControl Released!

After much anticipation, and of-course, delays, AIRControl has been released! This Adobe AIR Native Extension replaces my old and decrepit JoyQuery extension, and brings new features including improved controller support, POV hat switch support, the ability to get the name of the controller, and Mac OS X support! Head over to the AIRControl page to get it! The download includes a few example and full AS docs which should be enough for experienced ActionScript AIR developers to start making great apps! I will be posting an AIRControl tutorial in the coming days to help new developers get started!

AIRControl, the Future of JoyQuery

One of the things this website gets a lot of traffic for is an Adobe AIR Native Extension I had made a few years back called JoyQuery (if you must have the old version, it is still available here). Since then I have been working in my spare time, which fluctuates in and out of existence, to create an updated version that is more powerful, more efficient, and has a more elegant API. This new version, with a new name AIRControl, will be completely open-source (except for the Adobe AIR code libraries from the AIR SDK I cannot legally distribute), and be compatible with both Windows and, for the first time, Mac OS X. The project is currently hosted on my AIRControl GitHub repository. I am nearly complete with this release. I have finalized the C++ code to interface with the game controllers, built the native libraries, and tested them; and they are running beautifully. Now I am currently in the process of writing the ActionScript side of the library, to expose all the wonder new features of the native libraries to your projects. With all of the hard parts finally out of the way, I expect this release to be finished no later than this weekend!

New Website Live!

After much time and development, my new website in all of its HTML5 glory is live! This is the site where I will be posting all of my work, both past and future. I am currently in the process of organizing and uploading my work, while simultaneously, managing work and forthcoming projects as well. Check back soon for more updates.