The Gallery is deprecated. No new Gallery components may be submitted, and modifying existing components is disabled. For more information please read the Gallery Deprecation blog post. This is a static snapshot of the Gallery for archive purposes.
See 2 more by this user. Created: 07/25/12
Last CDN Push: 05/10/13
Build Tag: gallery-2013.05.10-00-54
Project: YUI 3
License: YUI BSD
YUI Version: 3.5.1
Free for use.
An enhanced version of the YUI PJAX Utility that reverts to using HistoryHash and AJAX loading in non-HTML5 compliant browsers such as IE, uses the YUI Cache utility to speed up loading of page partials that have already been loaded, adds support for callback triggers before and after page loads (useful for rendering page load progress bars), adds support for designating a link CSS class to disable use of this widget on links assigned to this class, automatically adds the YUI3 PJAX class to all hrefs prior to initialization, and for sites that use URLs with file extensions allows you to specify which file extension link clicks should trigger this widget
See https://github.com/joeauty/NetMusician-PJAX-Plus-Widget/blob/master/README.md
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
YUI({
//Last Gallery Build of this module
gallery: 'gallery-2013.05.10-00-54'
}).use('gallery-nmpjaxplus', function(Y) {
var PjaxPlus = new Y.PjaxPlus({
findLinksIn:document.body, // look for links to init within this region
container:'#page', // YUI PJAX argument - see http://yuilibrary.com/yui/docs/pjax/
contentSelector:'#main', // YUI PJAX argument - see http://yuilibrary.com/yui/docs/pjax/
omitLinkClass:'noajax', // skip initing this widget on links assigned to this class
permittedFileExts:['php'], // in addition to REST-like URLs that do not have file extensions, init URLs with these extensions
startCallbackFunc:Y.bind(startPjaxCallback), // callback that is triggered before content is loaded
callbackFunc:Y.bind(pjaxCallback) // callback triggered after content has been loaded
});
PjaxPlus.initAjaxLinks(); // initialize PjaxPlus
function startPjaxCallback(payload) {
// this callback is triggered before page loads.
// You can set CSS classes that will enable progress bars to indicate that
// new content is being loaded. Here, the opacity is set on the content region
Y.one('#page').setStyle('opacity', 0.5);
}
function pjaxCallback(payload) {
// this callback is triggered once the new content has been loaded.
// You can do stuff such as setting classes on your body tag, or reiniting
// various other Javascript widgets and controls on the page, as necessary
var responseHTML = Y.Node.create(payload.responseText); // YUI node object of loaded content
Y.one('#page').setStyle('opacity', '');
//initJSContent();
}
});
All code on this site is licensed under the BSD License unless stated otherwise.