public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Update prototype.js to [5985], fixes content-type issue with simulated 
HTTP methods

git-svn-id: 
http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5987 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
madrobby (author)
Thu Jan 18 12:27:17 -0800 2007
commit  03e763ffc823531ea5a5a3be7134318f85370139
tree    42253245d544a0d3c0bded36cb13a78da38a563e
parent  3ec808eadb8f754798c485add6f83a9739212195
...
833
834
835
836
 
 
837
838
 
839
840
841
 
 
842
843
844
845
846
847
848
 
849
850
851
852
853
854
 
855
856
857
...
860
861
862
863
 
864
865
866
...
887
888
889
890
 
891
892
893
...
833
834
835
 
836
837
838
 
839
840
 
 
841
842
843
844
845
846
847
848
 
849
850
851
852
853
854
 
855
856
857
858
...
861
862
863
 
864
865
866
867
...
888
889
890
 
891
892
893
894
0
@@ -833,25 +833,26 @@
0
 
0
   request: function(url) {
0
     this.url = url;
0
- var params = this.options.parameters, method = this.options.method;
0
+ this.method = this.options.method;
0
+ var params = this.options.parameters;
0
 
0
- if (!['get', 'post'].include(method)) {
0
+ if (!['get', 'post'].include(this.method)) {
0
       // simulate other verbs over post
0
- params['_method'] = method;
0
- method = 'post';
0
+ params['_method'] = this.method;
0
+ this.method = 'post';
0
     }
0
 
0
     params = Hash.toQueryString(params);
0
     if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='
0
 
0
     // when GET, append parameters to URL
0
- if (method == 'get' && params)
0
+ if (this.method == 'get' && params)
0
       this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params;
0
 
0
     try {
0
       Ajax.Responders.dispatch('onCreate', this, this.transport);
0
 
0
- this.transport.open(method.toUpperCase(), this.url,
0
+ this.transport.open(this.method.toUpperCase(), this.url,
0
         this.options.asynchronous);
0
 
0
       if (this.options.asynchronous)
0
@@ -860,7 +861,7 @@
0
       this.transport.onreadystatechange = this.onStateChange.bind(this);
0
       this.setRequestHeaders();
0
 
0
- var body = method == 'post' ? (this.options.postBody || params) : null;
0
+ var body = this.method == 'post' ? (this.options.postBody || params) : null;
0
 
0
       this.transport.send(body);
0
 
0
@@ -887,7 +888,7 @@
0
       'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
0
     };
0
 
0
- if (this.options.method == 'post') {
0
+ if (this.s.method == 'post') {
0
       headers['Content-type'] = this.options.contentType +
0
         (this.options.encoding ? '; charset=' + this.options.encoding : '');
0
 
...
833
834
835
836
 
 
837
838
 
839
840
841
 
 
842
843
844
845
846
847
848
 
849
850
851
852
853
854
 
855
856
857
...
860
861
862
863
 
864
865
866
...
887
888
889
890
 
891
892
893
...
833
834
835
 
836
837
838
 
839
840
 
 
841
842
843
844
845
846
847
848
 
849
850
851
852
853
854
 
855
856
857
858
...
861
862
863
 
864
865
866
867
...
888
889
890
 
891
892
893
894
0
@@ -833,25 +833,26 @@
0
 
0
   request: function(url) {
0
     this.url = url;
0
- var params = this.options.parameters, method = this.options.method;
0
+ this.method = this.options.method;
0
+ var params = this.options.parameters;
0
 
0
- if (!['get', 'post'].include(method)) {
0
+ if (!['get', 'post'].include(this.method)) {
0
       // simulate other verbs over post
0
- params['_method'] = method;
0
- method = 'post';
0
+ params['_method'] = this.method;
0
+ this.method = 'post';
0
     }
0
 
0
     params = Hash.toQueryString(params);
0
     if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='
0
 
0
     // when GET, append parameters to URL
0
- if (method == 'get' && params)
0
+ if (this.method == 'get' && params)
0
       this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params;
0
 
0
     try {
0
       Ajax.Responders.dispatch('onCreate', this, this.transport);
0
 
0
- this.transport.open(method.toUpperCase(), this.url,
0
+ this.transport.open(this.method.toUpperCase(), this.url,
0
         this.options.asynchronous);
0
 
0
       if (this.options.asynchronous)
0
@@ -860,7 +861,7 @@
0
       this.transport.onreadystatechange = this.onStateChange.bind(this);
0
       this.setRequestHeaders();
0
 
0
- var body = method == 'post' ? (this.options.postBody || params) : null;
0
+ var body = this.method == 'post' ? (this.options.postBody || params) : null;
0
 
0
       this.transport.send(body);
0
 
0
@@ -887,7 +888,7 @@
0
       'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
0
     };
0
 
0
- if (this.options.method == 'post') {
0
+ if (this.s.method == 'post') {
0
       headers['Content-type'] = this.options.contentType +
0
         (this.options.encoding ? '; charset=' + this.options.encoding : '');
0
 

Comments

    No one has commented yet.