saving with the inline editor toolbar did not work (fixed)

This commit is contained in:
did 2011-06-16 05:07:28 -07:00
parent afe07d4976
commit 0878a39858
3 changed files with 11 additions and 4 deletions

View File

@ -65,7 +65,7 @@ GEM
bson (1.3.1)
bson_ext (1.3.1)
builder (2.1.2)
bushido (0.0.21)
bushido (0.0.25)
highline (>= 1.6.1)
json (>= 1.4.6)
rest-client (>= 1.6.1)
@ -139,7 +139,7 @@ GEM
heroku (1.19.1)
activesupport (>= 2.1.0)
launchy (~> 0.3.2)
rest-client (>= 1.4.0, < 1.7.0)
rest-client (< 1.7.0, >= 1.4.0)
highline (1.6.2)
httparty (0.7.8)
crack (= 0.1.8)
@ -257,7 +257,7 @@ GEM
treetop (1.4.9)
polyglot (>= 0.3.1)
trollop (1.16.2)
tzinfo (0.3.27)
tzinfo (0.3.28)
unicorn (3.7.0)
kgio (~> 2.3)
rack

View File

@ -38,4 +38,4 @@ Locomotive::Application.configure do
# 'BUSHIDO_CLAIMED' => 'true',
# 'BUSHIDO_METRICS_TOKEN' => 'foobar'
# }
end
end

View File

@ -84,6 +84,9 @@ var InlineEditorToolbar = {
/* ___ internal methods ___ */
_buildHTML: function() {
var csrf_token = $('meta[name=csrf-token]').attr('content'),
csrf_param = $('meta[name=csrf-param]').attr('content');
var labels = this._translations[this.locale];
var showPageUrl = $('meta[name=page-url]').attr('content');
@ -94,6 +97,10 @@ var InlineEditorToolbar = {
<input class='auto' id='editable-id' type='hidden' name='_id' value='' />\
<input class='auto' id='editable-content' type='hidden' name='_content' value='' />";
if (csrf_param != null && csrf_token != null) {
formContentHTML += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
}
$('body').prepend("<div id='page-toolbar'>\
<ul>\
<li class='drawer'><a href='#'><span>&nbsp;</span></a></li>\