From 8929ac33b9f73d0a8cb5d3476682f8c3d2423830 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Tue, 24 May 2011 16:08:30 -0400 Subject: [PATCH] Removed the ajaxLinksEnabled and ajaxFormsEnabled settings. These were deprecated in a4 and scheduled for removal. Automated link and form ajax handling can still be globally disabled via the ajaxEnabled option. --- docs/api/globalconfig.html | 6 ------ docs/forms/forms-sample.html | 2 +- js/jquery.mobile.core.js | 8 -------- js/jquery.mobile.navigation.js | 6 +----- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/docs/api/globalconfig.html b/docs/api/globalconfig.html index 8b7f94ff..a8e88b90 100755 --- a/docs/api/globalconfig.html +++ b/docs/api/globalconfig.html @@ -95,12 +95,6 @@ $(document).bind("mobileinit", function(){
ajaxEnabled (boolean, default: true):
jQuery Mobile will automatically handle link clicks and form submissions through Ajax, when possible. If false, url hash listening will be disabled as well, and urls will load as regular http requests.
-
ajaxLinksEnabled (deprecated boolean, default: true):
-
jQuery Mobile will automatically handle link clicks through Ajax, when possible.
- -
ajaxFormsEnabled (deprecated boolean, default: true):
-
jQuery Mobile will automatically handle form submissions through Ajax, when possible.
-
hashListeningEnabled (boolean, default: true):
jQuery Mobile will automatically listen and handle changes to the location.hash. Disabling this will prevent jQuery Mobile from handling hash changes, which allows you to handle them yourself, or simply to use simple deep-links within a document that scroll to a particular ID.
diff --git a/docs/forms/forms-sample.html b/docs/forms/forms-sample.html index 61b70a77..dbf11466 100755 --- a/docs/forms/forms-sample.html +++ b/docs/forms/forms-sample.html @@ -27,7 +27,7 @@

Non-Ajax handling

-

To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn of Ajax form handling completely via the ajaxFormsEnabled global config option.

+

To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn of Ajax form handling completely via the ajaxEnabled global config option.

Simple Ajax form example

This page demonstrates automated ajax handling of form submissions. The form below is configured to send regular a get request to forms-sample-response.php. On submit, jQuery Mobile will make sure that the Url specified is able to be retrieved via Ajax, and handle it appropriately. Keep in mind that just like ordinary HTTP form submissions, jQuery Mobile allows get result pages to be bookmarked by updating the Url hash when the response returns successfully. Also like ordinary form submissions, post requests do not contain query parameters in the hash, so they are not bookmarkable.

diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index 74f3ad4d..f1b75274 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -36,14 +36,6 @@ //automatically load and show pages based on location.hash hashListeningEnabled: true, - // TODO: deprecated - remove at 1.0 - //automatically handle link clicks through Ajax, when possible - ajaxLinksEnabled: true, - - // TODO: deprecated - remove at 1.0 - //automatically handle form submissions through Ajax, when possible - ajaxFormsEnabled: true, - //set default page transition - 'none' for no transitions defaultPageTransition: "slide", diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index ee4d0e73..50a63f84 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -735,8 +735,6 @@ $( "form" ).live('submit', function( event ) { var $this = $( this ); if( !$.mobile.ajaxEnabled || - //TODO: deprecated - remove at 1.0 - !$.mobile.ajaxFormsEnabled || $this.is( ":jqmData(ajax='false')" ) ) { return; } @@ -853,9 +851,7 @@ $activeClickedLink = $link.closest( ".ui-btn" ); - if( isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled || - // TODO: deprecated - remove at 1.0 - !$.mobile.ajaxLinksEnabled ) { + if( isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled ) { //remove active link class if external (then it won't be there if you come back) window.setTimeout( function() { removeActiveLinkClass( true ); }, 200 );