Fossil SCM
Removed some dead code. Experimentally enabled jQuery ajax back-end to test a problem on my 3DS.
Commit
ebb0c04749499c3ea37d6a20a09b4880243a4258
Parent
571f3aca5bdb527…
1 file changed
+11
-9
+11
-9
| --- ajax/js/whajaj.js | ||
| +++ ajax/js/whajaj.js | ||
| @@ -914,27 +914,22 @@ | ||
| 914 | 914 | }, |
| 915 | 915 | success: function(data) |
| 916 | 916 | { |
| 917 | 917 | WhAjaj.Connector.sendHelper.onSendSuccess.apply( whself, [request, data, args] ); |
| 918 | 918 | }, |
| 919 | - /* Set dataType=text instead of json for deeply archaic reasons which | |
| 920 | - might no longer apply. | |
| 919 | + /* Set dataType=text instead of json to keep jQuery from doing our carefully | |
| 920 | + written response handling for us. | |
| 921 | 921 | */ |
| 922 | 922 | dataType: 'text' |
| 923 | 923 | }; |
| 924 | 924 | if( undefined !== args.timeout ) |
| 925 | 925 | { |
| 926 | 926 | ajopt.timeout = args.timeout; |
| 927 | 927 | } |
| 928 | 928 | try |
| 929 | 929 | { |
| 930 | - var xhr = jQuery.ajax(ajopt); | |
| 931 | - if( xhr && ('undefined'!==(typeof window)) && ('firebug' in window) && ('watchXHR' in window.firebug) ) | |
| 932 | - { /* plug in to firebug lite's XHR monitor... */ | |
| 933 | - window.firebug.watchXHR( xhr ); | |
| 934 | - } | |
| 935 | - return xhr; | |
| 930 | + return jQuery.ajax(ajopt); | |
| 936 | 931 | } |
| 937 | 932 | catch(e) |
| 938 | 933 | { |
| 939 | 934 | args.errorMessage = e.toString(); |
| 940 | 935 | WhAjaj.Connector.sendHelper.onSendError.apply( whself, [request, args] ); |
| @@ -1204,8 +1199,15 @@ | ||
| 1204 | 1199 | sendImpl() holds a concrete back-end connection implementation. It |
| 1205 | 1200 | can be replaced with a custom implementation if one follows the rules |
| 1206 | 1201 | described throughout this API. See WhAjaj.Connector.sendImpls for |
| 1207 | 1202 | the concrete implementations included with this API. |
| 1208 | 1203 | */ |
| 1209 | -WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.XMLHttpRequest; | |
| 1204 | +//WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.XMLHttpRequest; | |
| 1210 | 1205 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.rhino; |
| 1211 | 1206 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.jQuery; |
| 1207 | + | |
| 1208 | +if( 'undefined' !== typeof jQuery ){ | |
| 1209 | + WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.jQuery; | |
| 1210 | +} | |
| 1211 | +else { | |
| 1212 | + WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.XMLHttpRequest; | |
| 1213 | +} | |
| 1212 | 1214 |
| --- ajax/js/whajaj.js | |
| +++ ajax/js/whajaj.js | |
| @@ -914,27 +914,22 @@ | |
| 914 | }, |
| 915 | success: function(data) |
| 916 | { |
| 917 | WhAjaj.Connector.sendHelper.onSendSuccess.apply( whself, [request, data, args] ); |
| 918 | }, |
| 919 | /* Set dataType=text instead of json for deeply archaic reasons which |
| 920 | might no longer apply. |
| 921 | */ |
| 922 | dataType: 'text' |
| 923 | }; |
| 924 | if( undefined !== args.timeout ) |
| 925 | { |
| 926 | ajopt.timeout = args.timeout; |
| 927 | } |
| 928 | try |
| 929 | { |
| 930 | var xhr = jQuery.ajax(ajopt); |
| 931 | if( xhr && ('undefined'!==(typeof window)) && ('firebug' in window) && ('watchXHR' in window.firebug) ) |
| 932 | { /* plug in to firebug lite's XHR monitor... */ |
| 933 | window.firebug.watchXHR( xhr ); |
| 934 | } |
| 935 | return xhr; |
| 936 | } |
| 937 | catch(e) |
| 938 | { |
| 939 | args.errorMessage = e.toString(); |
| 940 | WhAjaj.Connector.sendHelper.onSendError.apply( whself, [request, args] ); |
| @@ -1204,8 +1199,15 @@ | |
| 1204 | sendImpl() holds a concrete back-end connection implementation. It |
| 1205 | can be replaced with a custom implementation if one follows the rules |
| 1206 | described throughout this API. See WhAjaj.Connector.sendImpls for |
| 1207 | the concrete implementations included with this API. |
| 1208 | */ |
| 1209 | WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.XMLHttpRequest; |
| 1210 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.rhino; |
| 1211 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.jQuery; |
| 1212 |
| --- ajax/js/whajaj.js | |
| +++ ajax/js/whajaj.js | |
| @@ -914,27 +914,22 @@ | |
| 914 | }, |
| 915 | success: function(data) |
| 916 | { |
| 917 | WhAjaj.Connector.sendHelper.onSendSuccess.apply( whself, [request, data, args] ); |
| 918 | }, |
| 919 | /* Set dataType=text instead of json to keep jQuery from doing our carefully |
| 920 | written response handling for us. |
| 921 | */ |
| 922 | dataType: 'text' |
| 923 | }; |
| 924 | if( undefined !== args.timeout ) |
| 925 | { |
| 926 | ajopt.timeout = args.timeout; |
| 927 | } |
| 928 | try |
| 929 | { |
| 930 | return jQuery.ajax(ajopt); |
| 931 | } |
| 932 | catch(e) |
| 933 | { |
| 934 | args.errorMessage = e.toString(); |
| 935 | WhAjaj.Connector.sendHelper.onSendError.apply( whself, [request, args] ); |
| @@ -1204,8 +1199,15 @@ | |
| 1199 | sendImpl() holds a concrete back-end connection implementation. It |
| 1200 | can be replaced with a custom implementation if one follows the rules |
| 1201 | described throughout this API. See WhAjaj.Connector.sendImpls for |
| 1202 | the concrete implementations included with this API. |
| 1203 | */ |
| 1204 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.XMLHttpRequest; |
| 1205 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.rhino; |
| 1206 | //WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.jQuery; |
| 1207 | |
| 1208 | if( 'undefined' !== typeof jQuery ){ |
| 1209 | WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.jQuery; |
| 1210 | } |
| 1211 | else { |
| 1212 | WhAjaj.Connector.prototype.sendImpl = WhAjaj.Connector.sendImpls.XMLHttpRequest; |
| 1213 | } |
| 1214 |