Rails 2.3.11, S5 Editing bug.

Upgrade to Rails 2.3.11.
Fix a bug where the SVG-Edit button would not appear
when editing S5 slideshows.
This commit is contained in:
Jacques Distler 2011-02-18 23:36:23 -06:00
parent 3843fa608d
commit 844ce0ed40
51 changed files with 444 additions and 299 deletions

View file

@ -5,3 +5,25 @@ function toggleView(id)
(document.getElementById(id).style.display == 'block') ? document.getElementById(id).style.display='none' : document.getElementById(id).style.display='block';
}
/*
* Registers a callback which copies the csrf token into the
* X-CSRF-Token header with each ajax request. Necessary to
* work with rails applications which have fixed
* CVE-2011-0447
*/
Ajax.Responders.register({
onCreate: function(request) {
var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
if (csrf_meta_tag) {
var header = 'X-CSRF-Token',
token = csrf_meta_tag.readAttribute('content');
if (!request.options.requestHeaders) {
request.options.requestHeaders = {};
}
request.options.requestHeaders[header] = token;
}
}
});