ajax_scaffold_plugin 3.2.2 → 3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/public/javascripts/ajax_scaffold.js +41 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -123,4 +123,44 @@ var AjaxScaffold = {
|
|
123
123
|
Element.removeClassName(element, "desc");
|
124
124
|
});
|
125
125
|
}
|
126
|
-
}
|
126
|
+
}
|
127
|
+
|
128
|
+
Ajax.Request.prototype = Object.extend(new Ajax.Request(), {
|
129
|
+
setRequestHeaders: function() {
|
130
|
+
var headers = {
|
131
|
+
'X-Requested-With': 'XMLHttpRequest',
|
132
|
+
'X-Prototype-Version': Prototype.Version,
|
133
|
+
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
|
134
|
+
};
|
135
|
+
|
136
|
+
if (this.method == 'post') {
|
137
|
+
headers['Content-type'] = this.options.contentType +
|
138
|
+
(this.options.encoding ? '; charset=' + this.options.encoding : '');
|
139
|
+
|
140
|
+
/* Force "Connection: close" for older Mozilla browsers to work
|
141
|
+
* around a bug where XMLHttpRequest sends an incorrect
|
142
|
+
* Content-length header. See Mozilla Bugzilla #246651.
|
143
|
+
*/
|
144
|
+
if (this.transport.overrideMimeType &&
|
145
|
+
(navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
|
146
|
+
headers['Connection'] = 'close';
|
147
|
+
}
|
148
|
+
|
149
|
+
// user-defined headers
|
150
|
+
if (typeof this.options.requestHeaders == 'object') {
|
151
|
+
var extras = this.options.requestHeaders;
|
152
|
+
|
153
|
+
if (typeof extras.push == 'function')
|
154
|
+
for (var i = 0, length = extras.length; i < length; i += 2)
|
155
|
+
headers[extras[i]] = extras[i+1];
|
156
|
+
else
|
157
|
+
$H(extras).each(function(pair) { headers[pair.key] = pair.value });
|
158
|
+
}
|
159
|
+
|
160
|
+
for( var name in headers ) {
|
161
|
+
if( typeof( headers[name] ) != 'function' ) {
|
162
|
+
this.transport.setRequestHeader(name, headers[name]);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
});
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ajax_scaffold_plugin
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 3.2.
|
7
|
-
date:
|
6
|
+
version: 3.2.3
|
7
|
+
date: 2007-01-23 00:00:00 +00:00
|
8
8
|
summary: Ajax Scaffold plugin is a rails plugin for ajaxified scaffolds
|
9
9
|
require_paths:
|
10
10
|
- lib
|