Switched form handler over to processing absolute urls.

This commit is contained in:
Kin Blas 2011-06-04 01:22:16 -07:00
parent ba502f0aff
commit f9dd767528

View file

@ -519,7 +519,7 @@
// The absolute version of the URL passed into the function. This
// version of the URL may contain dialog/subpage params in it.
absUrl = path.stripHash( url ), // XXX_jblas: path.makeAbsolute( url ),
absUrl = path.makeUrlAbsolute( url );
// The absolute version of the URL minus any dialog/subpage params.
// In otherwords the real URL of the page to be loaded.
@ -544,7 +544,7 @@
settings.data = $.param( settings.data );
}
// XXX_jblas: We should be checking to see if the url already has a query in it.
absUrl += absUrl + "?" + settings.data;
absUrl += "?" + settings.data;
settings.data = undefined;
fileUrl = path.getFilePath( absUrl );
}
@ -896,7 +896,7 @@
}
var type = $this.attr( "method" ),
url = path.clean( $this.attr( "action" ) ),
url = path.makeUrlAbsolute( $this.attr( "action" ), getClosestBaseUrl($this) );
target = $this.attr( "target" );
//external submits use regular HTTP
@ -904,13 +904,8 @@
return;
}
//if it's a relative href, prefix href with base url
if( path.isRelative( url ) ) {
url = path.makeAbsolute( url );
}
$.mobile.changePage(
url.length && url || path.get(),
url,
{
type: type.length && type.toLowerCase() || "get",
data: $this.serialize(),
@ -937,15 +932,14 @@
function getClosestBaseUrl( ele )
{
// Find the closest page and extract out its url.
var url = $( ele ).closest( ".ui-page" ).jqmData( "url" );
var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
base = documentBase.hrefNoHash;
// If the data-url is an id instead of a path, default to using
// the documentBase.
if ( url && !path.isPath( url ) ) {
url = documentBase;
url = base;
}
return path.makeUrlAbsolute( ( url && !path.isPath( url ) ) ? url : documentBase, documentBase);
return path.makeUrlAbsolute( url || base, base);
}
//add active state on vclick