Some jQuery stuff

note: jKnotify has moved to GitHub

This little section of pages details a few jQuery plugins I've written which you may find useful/interesting or entirely pointless. One of the wonderful things about jQuery is that it's easier to write your own plugin than to write a procedural wrapper around the desired functionality, so much decoupled reusable code is born.

I have tried to keep each page as a full description, demo AND usage example. They are all supposed to be incredibly simple and single purpose so the best usage instructions are generally a couple of example calls. The actual scripting and demoing is hand written so you can look at the demo, open the page's source and look at the HEAD element to see what's making the magic happen. The descriptions' source is not hand-written HTML and is therefore dense and ugly, but just skip past that.

Development, bugs, etc

All plugins listed here can be downloaded on their own page. Alternatively, code is now stored in a public Mercurial repository.
 hg clone https://javascript-stuff.googlecode.com/hg/ javascript-stuff 
or browse over http: https://javascript-stuff.googlecode.com/hg/.

Bugs should be reported to the issue tracker or by email (markwatkinson gmail com)

Closure

Code is compiled/minified using the Google Closure Compiler. If you wish to include these in a Closure build routine for yourself, you'll probably want to tell Closure about all these cool new functions you can call. Therefore I also provide `extern' files (--externs FILE) for each project which will stop Closure from complaining when you trying to call methods it doesn't know about. These are currently present only in the Mercurial repository. Please report bugs in the externs as well.

Full view

you're going to need JavaScript to see these work

$.includify+

A simple dynamic inclusion script for jQuery. It's essentially a wrapper around $.getScript, but allows a more convenient syntax for including multiple files which depend on each other, where sequential calls would expose race conditions. It also protects against duplicate includes.

Delayed Event Firing+

Often when dealing with user input, you don't want an event handler to fire immediately after the input changes, but instead after it has stopped changing. That's what this plugin does.

JSON Encoder and Decoder +

A JSON encoder and decoder which is fairly robust and error tolerant. It is safe: the decoder is implemented using a simple recursive descent parser so it does not risk arbitrary code execution (like eval does). It also won't complain if you use single quotes for string delimiters or various other javascripty but JSON incompatible practices. This does not rely on jQuery.

luminousify+

Luminousify is the client-side part of an AJAX interface for the Luminous syntax highlighter (which is written in PHP). It may or may not be easier to provide syntax highlighting via AJAX than directly with PHP depending on exactly how your pages are set up. This is what's powering the syntax highlighting on this set of pages.

Password Strength Notifier+

A password strength notifier. It is unique among jQuery plugins in that it tries to estimate entropy (the password's equivalence to n bits of random data) and uses some statistical techniques to achieve this, which makes it much less generous than many similar notifiers.

Roundify+

Gives images rounded borders in browsers that support border-radius (and variants)

Sortify+

Table sorting

Tabify+

A very flexible tabbed element plugin which makes few assumptions about layout and does not structurally link the headings and tab content, so you can arrange them how you like. The elements to be tabbed must already exist in the DOM, so the graceful fallback is to render them exactly as they are!

Tooltip+

A simple and small tooltip plugin

Visual Password Hash+

A way to display to the user a visual representation of their password which they can recognise as they type it, without compromising security (much). Uses the HTML5 canvas element so it looks nice if you've got an HTML5 browser.