" )
.appendTo( $body )
.load( url + ' [data-role="page"]', function() {
// TODO: test this (avoids querying the dom for new element):
-// var newPage = $( this ).find( ".ui-page" ).eq( 0 )
+// var newPage = jQuery( this ).find( ".ui-page" ).eq( 0 )
// .attr( "id", url );
-// $( this ).replaceWith( newPage );
+// jQuery( this ).replaceWith( newPage );
// setPageRole( newPage );
// mobilize( newPage );
-// changePage( $( ".ui-page-active" ), newPage, transition, back );
- $( this ).replaceWith(
- $( this ).find( '[data-role="page"]' ).eq( 0 ).attr( "id", url ) );
- var newPage = $( "[id='" + url + "']" );
+// changePage( jQuery( ".ui-page-active" ), newPage, transition, back );
+ jQuery( this ).replaceWith(
+ jQuery( this ).find( '[data-role="page"]' ).eq( 0 ).attr( "id", url ) );
+ var newPage = jQuery( "[id='" + url + "']" );
setPageRole( newPage );
mobilize( newPage );
- changePage( $( ".ui-page-active" ), newPage, transition, back );
+ changePage( jQuery( ".ui-page-active" ), newPage, transition, back );
});
}
} else {
// either we've backed up to the root page url
// or it's the first page load with no hash present
- var currentPage = $( ".ui-page-active" );
+ var currentPage = jQuery( ".ui-page-active" );
if ( currentPage.length && !startPage.is( ".ui-page-active" ) ) {
changePage( currentPage, startPage, transition, back );
} else {
startPage.addClass( activePageClass );
manageGlobalNav(startPage);
- $.fixedToolbars.show();
+ jQuery.fixedToolbars.show();
pageLoading( true );
}
}
@@ -211,9 +211,9 @@
//potential (probably incomplete) fallback to workaround lack of animation callbacks.
//should this be extended into a full special event?
// note: Expects CSS animations use transitionDuration (350ms)
- $.fn.animationComplete = function(callback){
- if($.support.WebKitAnimationEvent){
- return $(this).one('webkitAnimationEnd', callback); //check out transitionEnd (opera per Paul's request)
+ jQuery.fn.animationComplete = function(callback){
+ if(jQuery.support.WebKitAnimationEvent){
+ return jQuery(this).one('webkitAnimationEnd', callback); //check out transitionEnd (opera per Paul's request)
}
else{
setTimeout(callback, transitionDuration);
@@ -261,7 +261,7 @@
//rewrite "home" links to mimic the back button (pre-js, these links are usually "home" links)
var backBtn = $el.find('.ui-header a.ui-back');
if(!backBtn.length){
- backBtn = $('
').appendTo($el.find('.ui-header')).buttonMarkup();
+ backBtn = jQuery('
').appendTo($el.find('.ui-header')).buttonMarkup();
}
backBtn
.click(function(){
@@ -277,7 +277,7 @@
});
};
- $.extend($, {
+ jQuery.extend({
mobilize: mobilize,
pageLoading: pageLoading,
changePage: changePage,
@@ -285,10 +285,10 @@
});
//dom-ready
- $(function(){
+ jQuery(function(){
//set up active page - mobilize it!
- startPage = $('[data-role="page"]:first');
+ startPage = jQuery('[data-role="page"]:first');
//make sure it has an ID - for finding it later
if(!startPage.attr('id')){
@@ -296,13 +296,13 @@
}
//mobilize all pages present
- mobilize($('[data-role="page"]'));
+ mobilize(jQuery('[data-role="page"]'));
//trigger a new hashchange, hash or not
$window.trigger( "hashchange" );
//update orientation
- $html.addClass( $.event.special.orientationchange.orientation( $window ) );
+ $html.addClass( jQuery.event.special.orientationchange.orientation( $window ) );
//swipe right always triggers a back
$body.bind('swiperight.jqm',function(){
@@ -311,8 +311,8 @@
});
//some debug stuff for the events pages
- $('body').bind('scrollstart scrollstop swipe swipeleft swiperight tap taphold turn',function(e){
- $('#eventlogger').prepend('
Event fired: '+ e.type +'
');
+ jQuery('body').bind('scrollstart scrollstop swipe swipeleft swiperight tap taphold turn',function(e){
+ jQuery('#eventlogger').prepend('
Event fired: '+ e.type +'
');
});
});
})( jQuery, this );