/* ** history for ajax/javascript history ** 0.4 easier to configure cache control iframe POST handler ** 0.3 history events now setup in queue to ensure all entries reside in the history stack ** 0.2 no more FORM GET submission, straight location.href instead + hold time for iframe load ** 0.1 hidden frame + not bookmarkable + stores data for state change + allows reinstating data on forw/back hit ** authored by Jim Palmer - released under MIT license ** collage of ideas from Taku Sano, Mikage Sawatari, david bloom and Klaus Hartl */ (function($) { /* ** pre-initialize the history functionality - once you include this plugin this will be instantiated as a singleton onLoad ** IMPORTANT - replace the 'cache.php' with the appropriate cache handler URL string ** this is what the iframe submits its POSTS to and is required for this plugin to work */ $(document).ready( function () { $.history( 'cache.php' ); } ); // core history plugin functionality - handles singleton instantiation and individual calls $.history = function ( store ) { // (initialize) create the hidden iframe if not on the root window.document.body if ( $(".__historyFrame").length == 0 ) { // set the history cursor to (-1) - this will be populated with current unix timestamp or 0 for the first screen $.history.cursor = $.history.intervalId = 0; // initialize the stack of history stored entries $.history.stack = {}; // initialize the stack of loading hold flags $.history._loading = {}; // initialize the queue for loading history fragments in sequence $.history._queue = []; // append to the root window.document.body without the src - uses class for toggleClass debugging - display:none doesn't work $("body").append('