Data Sorting
With the goal of creating a flexibly sortable data set for tabular display, I started working on what I'm currently calling (but will likely rename) a superSort() object. I've posted an example of a table created using the function along with two default JSON files (optionally pulled in using an ajax.js file mentioned elsewhere in this tools page). I'll try to elaborate on the object, its methods, and the sample code in the future, but for now, feel free to read the source code and freely use as you like. (Credit within your code is appreciated.)
Graceful Degradation
JavaScript is useful, but there are occasionally times when you'd like to make use of it on a site that requires functionality for users with it turned off, too (for example, for increased accessibility, or due to public sector guidelines). In these cases, it's important to consider how to allow your applications to "gracefully degrade", so that the lack of JavaScript only reduces the usability by a certain extent, rather than making the application altogether unusable. This set of simple scripts demonstrates one way in which this technique might be used to solve a common problem.
Google Maps
This page displays a sample Google Map along with some instructions for integrating something similar into your own site. It links to some sample files that you can modify, as well as some more advanced ones containing functions that you may want to leave alone until you're more comfortable working at a deeper level. It will allow you to display a map within a DIV, add a marker to the map (the sample function performs this action using Ajax/JSON functions from the library above), and look up coordinates for an address (in a file linked from the instructions).
Simile Timeline
This library provides some functions for creating a basic timeline with one or more bands, static or dynamic data, and optional highlighted segments and/or hot zones.
Moving Objects
This collection includes functions for grabbing, dragging and dropping elements, as well as getting absolute X/Y positions. It is necessary if using the User Interface library below.
Try dragging me!
Reordering Items
On a related note (re: moving things around), the 'ordering' script set, which requires some functions from 'moving.js' and 'main.js' above, allows you to make items in sets on your page visually reorderable, and pass custom functions to call while dragging and/or after dropping (so you can do what you need with the information after the item is reordered). This is useful for reordering pretty much anything that is represented on the page among other things in an ordered set: lists of people, a to-do list, thumbnails of images to display in an album, etc. The link above will take you to a demo page with more information on implementing those scripts.
User Interface (in progress)
This library, a work in progress, will facilitate Ajax-driven user interface. Right now it just includes a pop-up form function that opens and closes a box over your page... useful for inputting quick data or displaying more information about something on the page without going to a new one or popping up a new browser window. (Requires the Moving library above.)
Pop-up Date Selection Calendar
This is nothing new and creative, but if you're looking for a JavaScript-driven pop-up date selection calendar with some flexible integration for populating a text/hidden field or some drop-downs with the date you select, you can use this script and modify the do_ClickDay function in calendar.js.
Fading Effect
The functions provided include a fade-out function that accepts an optional function to run upon complete disappearance (for example, replacing the content with other content) before fading back into view. Useful for rotating images, news stories and other content transitions. If JavaScript is enabled, you should be seeing an example of it below:
Snippet A
Ajax Functions
This library includes functions for grabbing output from a web page by passing in the method (post or get), URL to retrieve from, and a string of parameters (whatever would normally follow the '?' in a GET string);
General Functions
This library includes functions for parsing JSON, managing cookies and arrays, and other general functions that I've found useful over the years. Many of these are required for other libraries in this collection, and should be included with any libraries above.
When using this library, you'll want to replace the 'SiteDomain' variable value with your own web site's root URL.
