/* Plugin Name: Advanced AJAX Page Loader Version: 2.7.3 Plugin URI: http://software.resplace.net/WordPress/AjaxPageLoader.php Description: Load pages within blog without reloading page, shows loading bar and updates the browsers URL so that the user can bookmark or share the url as if they had loaded a page normally. Also updates there history so they have a track of there browsing habbits on your blog! Author URI: http://dean.resplace.net Author: Dean Williams */ //Set this to true if your getting some javascript problems var AAPL_reloadDocumentReady = false; //Dont mess with these... var AAPL_isLoad = false; var AAPL_started = false; var AAPL_searchPath = null; var AAPL_ua = jQuery.browser; //The holy grail... jQuery(document).ready(function() { if (AAPL_warnings == true) { alert("DEBUG MODE! \nThanks for downloading AAPL - you are currently in DEBUG MODE, once you are confident AAPL is working as you require please disable DEBUG MODE from the AAPL options in wordpress."); } if (AAPL_warnings == true) { AAPL_jqVersion = jQuery().jquery; if (AAPL_jqVersion.substr(0,3) != "1.8" && AAPL_warnings == true) { alert("INFORMATION: \njQuery may be outdated! This plugin was made using 1.8, I can see version: " + AAPL_jqVersion); } } AAPL_loadPageInit(""); }); window.onpopstate = function(event) { //We now have a smart multi-ignore feature controlled by the admin panel if (AAPL_started === true && AAPL_check_ignore(document.location.toString()) == true) { AAPL_loadPage(document.location.toString(),1); } }; function AAPL_loadPageInit(scope){ jQuery(scope + "a").click(function(event){ //if its not an admin url, or doesnt contain # if (this.href.indexOf(AAPLhome) >= 0 && AAPL_check_ignore(this.href) == true){ // stop default behaviour event.preventDefault(); // remove click border this.blur(); // get caption: either title or name attribute var caption = this.title || this.name || ""; // get rel attribute for image groups var group = this.rel || false; //Load click code - pass reference. try { AAPL_click_code(this); } catch(err) { if (AAPL_warnings == true) { txt="ERROR: \nThere was an error with click_code.\n"; txt+="Error description: " + err.message; alert(txt); } } // display the box for the elements href AAPL_loadPage(this.href); } }); jQuery('.' + AAPL_search_class).each(function(index) { if (jQuery(this).attr("action")) { //Get the current action so we know where to submit to AAPL_searchPath = jQuery(this).attr("action"); //bind our code to search submit, now we can load everything through ajax :) //jQuery('#searchform').name = 'searchform'; jQuery(this).submit(function() { submitSearch(jQuery(this).serialize()); return false; }); } else { if (AAPL_warnings == true) { alert("WARNING: \nSearch form found but attribute 'action' missing!?!?! This may mean search form doesn't work with AAPL!"); } } }); if (jQuery('.' + AAPL_search_class).attr("action")) {} else { if (AAPL_warnings == true) { alert("WARNING: \nCould not bind to search form...\nCould not find