@@ -52,14 +52,14 @@ define( [
$base = $head.children( "base" ),

//tuck away the original document URL minus any fragment.
documentUrl = path.parseLocation(),
documentUrl = path.documentUrl,

//if the document has an embedded base tag, documentBase is set to its
//initial value. If a base tag does not exist, then we default to the documentUrl.
documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
documentBase = path.documentBase,

//cache the comparison once.
documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash ),
documentBaseDiffers = path.documentBaseDiffers,

getScreenHeight = $.mobile.getScreenHeight;

@@ -82,6 +82,13 @@ define( [

} : undefined;


//return the original document url
$.mobile.getDocumentUrl = path.getDocumentUrl;

//return the original document base url
$.mobile.getDocumentBase = path.getDocumentBase;

/* internal utility functions */

// NOTE Issue #4950 Android phonegap doesn't navigate back properly
@@ -294,16 +301,6 @@ define( [
//enable cross-domain page support
$.mobile.allowCrossDomainPages = false;

//return the original document url
$.mobile.getDocumentUrl = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href;
};

//return the original document base url
$.mobile.getDocumentBase = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href;
};

$.mobile._bindPageRemove = function() {
var page = $( this );

@@ -379,12 +379,12 @@ define([
path.documentBaseDiffers = (path.documentUrl.hrefNoHash !== path.documentBase.hrefNoHash);

//return the original document url
path.getDocumentUrl = $.mobile.getDocumentUrl = function( asParsedObject ) {
path.getDocumentUrl = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, path.documentUrl ) : path.documentUrl.href;
};

//return the original document base url
path.getDocumentUrl = $.mobile.getDocumentBase = function( asParsedObject ) {
path.getDocumentBase = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, path.documentBase ) : path.documentBase.href;
};

@@ -55,6 +55,14 @@
}
},

setPageTransition: function() {
if( location.search.indexOf( "transition=none" ) >= 0 ) {
$( document ).bind( 'mobileinit', function() {
$.mobile.defaultPageTransition = "none";
});
}
},

redirect: function( filename, paramPairs ) {
var search, pairs = [];

@@ -168,12 +168,10 @@ $.testHelper.setPushState();
$.navigate.navigator.squash("#foo/bar");
loc = path.parseLocation();
equal( loc.pathname, url.directory + "foo/bar", "foo/bar has been squashed onto the url" );
equal( loc.search, url.search, "the search is preserved" );

$.navigate.navigator.squash("bar/baz");
loc = path.parseLocation();
equal( loc.pathname, url.directory + "foo/bar/baz", "foo/bar has been squashed onto the url" );
equal( loc.search, url.search, "the search is preserved" );

$.navigate.navigator.squash("#foo");
loc = path.parseLocation();
@@ -8,13 +8,9 @@

module('jquery.mobile.navigation.js - base tag', {
setup: function(){
if ( location.hash ) {
stop();
$(document).one("pagechange", function() {
start();
} );
location.hash = "";
}
$.navigate.history.stack = [];
$.navigate.history.activeIndex = 0;
$.testHelper.navReset( home );
}
});

@@ -26,15 +26,14 @@
$.testHelper.detailedEventCascade( seq );
}
]);
}
else {
} else {
// You can tweak the timeout below to make the tests run faster, but if
// you do, make sure it greatly exceeds the timeout used for the pushState
// slumber - i.e., the brief time immediately following an adjustment made
// by the pushState plugin during which, if the location were to require
// an adjustment by the pushState plugin, it will not get such an
// adjustment because the pushState plugin ignores such requests.
setTimeout( function() { $.testHelper.detailedEventCascade( seq ); }, 1000 );
setTimeout( function() { $.testHelper.detailedEventCascade( seq ); }, 200 );
}
}

@@ -290,5 +290,7 @@

equal( squash("#/foo/bar/?foo=bar&baz=bak", "http://example.com/"), "http://example.com/foo/bar/?foo=bar&baz=bak", "ui-state keys attached to simple string hashes are preserved" );

equal( squash("#foo", "http://example.com/?foo=bar&baz=bak"), "http://example.com/?foo=bar&baz=bak#foo", "ui-state keys attached to simple string hashes are preserved" );

});
})(jQuery);