As a long-time player of PC FPS (First Person Shooter) games, I got really excited when Battlefield 3 was announced. I’ve played most of the Battlefield games since the original (Battlefield 1942) and I couldn’t wait to get my hands on the latest game in the series.
I’m not going to spend any time talking about the game, other than that it’s amazing. It’s not perfect, but games seldom are the week they’re released. Either way, I love it.
The thing is, EA did something a little different this time around. Instead of attempting to create an entire social experience in-game—Remember Tribes 2? Ouch—they contracted ESN to create a web-based server brower / social network called Battlelog.
While Battlelog is a fantastic idea, it has a few issues. I can’t address the fact that ESN has included jQuery 1.4.2, jQuery 1.4.4 and YUI 2.5.2 in their concatenated scripts. Nobody can fix that but them. Note: shame on them.
What I can do (and have done) is attempt to address some of the minor annoying issues surrounding refreshing and joining servers.
I’m a hard-core bookmarklet junkie. I love adding non-standard functionality to my browsers, so I’ve created a few bookmarklets, which are posted here. I’ve also created a jQuery bookmarklet generator, which you can use to create your own bookmarklets, should they require jQuery.
This AppleScript allows you to very easy copy the path of any open Finder window to the clipboard. Also, in any application’s Open or Save dialog, you can open a “Go to the folder” dialog into which a folder path can be entered. Coincidence?! Instead of typing in that path manually, just run this AppleScript to choose from the paths of all the open Finder windows!
This code provides a simple wrapper for the console's logging methods, and was created to allow a very easy-to-use, cross-browser logging solution, without requiring excessive or unwieldy object detection. If a console object is not detected, all logged messages will be stored internally until a logging callback is added. If a console object is detected, but doesn't have any of the
error logging methods,
log will be used in their place. For convenience, some of the less common console methods will be passed through to the console object if they are detected, otherwise they will simply fail gracefully.
Why go through the tedium of creating both a closure AND a
Note: Includes sample blazingly-fast 0.3kb QSA css selector library with full unit test suite, to help you get started!
This project is a work in progress!
Project details coming soon, for now check out the GitHub page!
jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history. In addition, jQuery BBQ provides a full .deparam() method, along with both hash state management, and fragment / query string parse and merge utility methods.
This plugin and the jQuery urlInternal plugin supersede the URL Utils plugin.
This would probably actually be better called “Run some arbitrary code that requires jQuery, loading a minimum required version of jQuery first (but only if necessary), affecting the host page as little as possible Bookmarklet Generator” but that wasn’t nearly as catchy as “jQuery Bookmarklet Generator” so I’m going to stick with that.
This boilerplate code is useful for bookmarklets that need jQuery to execute their payload, in situations where you don’t know if jQuery or a specific minimum required version of jQuery will already exist in the page. If you just want to load jQuery itself into a page, check out the Learning jQuery “jQuerify” bookmarklet.
Like my iff plugin, this small jQuery plugin gives you the ability to perform conditional logic without breaking the chain, but in addition to
if, allows for any number of
else if tests and callbacks, as well as a final
jQuery doTimeout takes the work out of delayed code execution, including interval and timeout management, polling loops and debouncing. In addition, it’s fully jQuery chainable!
With jQuery equalizeBottoms you can “equalize” the bottoms of multiple elements, making columns heights even, even when CSS refuses to help.
Great news! This plugin won day eight of Media Temple’s 14 Days of jQuery contest. How it beat jQuery Star Wipe, I’ll never know.. but if you’re dying to see what the hype is all about, read on! (note: hype not actual)
jQuery getObject allows you to get and set properties of an object via dot-delimited name string. Inspired by the Dojo methods of the same names.
This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser HTML5 window.onhashchange event.
While this functionality was initially tied to the jQuery BBQ plugin, the event.special window.onhashchange functionality has now been broken out into a separate plugin for users who want just the basic event & back button support, without all the extra awesomeness that BBQ provides.
.filter(), in that it allows you to conditionally process a subset of selected elements, but instead of allowing you to preserve or remove individual elements, it operates on the entire set of elements.
jQuery Long Url uses the longurlplease.com short URL lengthening API to expand short URLs from at least 80 services, including bit.ly, is.gd, tinyurl.com and more!
This page contains a collection of minor jQuery plugins which are too small, too simple, or just not exciting enough to require individual pages. More will be added as I find the time… and the code!
jQuery outside events: Why trigger an event on something, when you can trigger it on everything else?
With jQuery outside events you can bind to an event that will be triggered only when a specific “originating” event occurs outside the element in question. For example, you can click outside, double-click outside, mouse-over outside, focus outside (and over ten more default “outside” events). Also, if an outside event hasn’t been provided by default, you can easily define your own.
Note that this was previously known as the “jQuery clickoutside” plugin.. but, hey—it’s pretty amazing what a an awesome idea and few more lines of code can do!
jQuery postMessage enables simple and easy window.postMessage communication in browsers that support it (FF3, Safari 4, IE8), while falling back to a document.location.hash communication method for all other browsers (IE6, IE7, Opera).
jQuery replaceText will replace text in specified elements. Note that only text content will be modified, leaving all tags and attributes untouched.
With jQuery resize event, you can now bind resize event handlers to elements other than window, for super-awesome-resizing-greatness!
With jQuery Star Wipe you can enable the single best transition ever created, the star wipe, in any recent WebKit browser!
jQuery throttle / debounce allows you to rate-limit your functions in multiple useful ways. Passing a delay and callback to
$.throttle returns a new function that will execute no more than once every
delay milliseconds. Passing a delay and callback to
$.debounce returns a new function that will execute only once, coalescing multiple sequential calls into a single execution at either the very beginning or end.
jQuery Untils provides three very simple, but very useful methods: nextUntil, prevUntil, and parentsUntil. These methods are based on their nextAll, prevAll, and parents counterparts, except that they allow you to stop when a certain selector is reached. Elements are returned in “traversal order”.
This very basic jQuery plugin does exactly what you’d think: the selected elements are unwrapped, removing their parent element, which effectively “promotes” them (and their siblings).
This plugin has been superseded by both the jQuery BBQ plugin and the jQuery urlInternal plugins. Be sure to check those out, because they’re newer and way cooler! And also because this plugin is no longer getting any updates or support!
jQuery urlInternal allows you to easily test internal-, external-, or fragment-ness for any relative or absolute URL. Includes element filtering methods and pseudo-selectors.
This plugin and the jQuery BBQ plugin supersede the URL Utils plugin.
While many articles have been written explaining how multiple versions of Firefox can run concurrently by launching Firefox with version-specific profiles via command-line argument, this very simple AppleScript aims to greatly streamline the process. Basically, once configured, you never again have to choose which profile goes with which version of Firefox. Just run the launcher and it handles everything!
This AppleScript does exactly what it says, which is allow you to view source from Safari in TextMate. Since it uses a temporary file to store the page source, TextMate won’t ask if you’d like to save when you close the window. And since it tries to guess the correct filename extension to use, the correct syntax highlighter should be chosen automatically.
Simplified is a WebKit message style for the popular OS X Linkinus IRC application. While developed independently of the Linkinus app, great effort was spent working with the app development team to not only tailor Simplified to it, but to also enhance the app style API for Simplified and other message styles. As a result, the Simplified source is modular and well-organized, and style authors are encouraged to use Simplified as a framework for building their own styles.