From 4a63899722df614a681b253a21d8a05660d31e90 Mon Sep 17 00:00:00 2001 From: Sunny Ripert Date: Mon, 2 Jul 2012 15:03:01 +0200 Subject: [PATCH] Livepreview JavaScript fix for base_url --- .../public/gollum/livepreview/js/livepreview/livepreview.js | 4 ++-- lib/gollum/frontend/views/layout.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/livepreview/livepreview.js b/lib/gollum/frontend/public/gollum/livepreview/js/livepreview/livepreview.js index 00ffcae5..c473d6c8 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/js/livepreview/livepreview.js +++ b/lib/gollum/frontend/public/gollum/livepreview/js/livepreview/livepreview.js @@ -107,7 +107,7 @@ $.save = function( commitMessage ) { if ( create ) { jQuery.ajax( { type: POST, - url: '/create', + url: baseUrl + '/create', data: { path: pathName, page: pageName, format: markdown, content: txt, message: commitMessage || msg }, success: function() { win.location = newLocation; @@ -116,7 +116,7 @@ $.save = function( commitMessage ) { } else { jQuery.ajax( { type: POST, - url: '/edit/' + pageName, + url: baseUrl + '/edit/' + pageName, data: { path: pathName, page: pageName, format: markdown, content: txt, message: commitMessage || msg }, success: function() { win.location = newLocation; diff --git a/lib/gollum/frontend/views/layout.rb b/lib/gollum/frontend/views/layout.rb index 65638176..959cda3c 100644 --- a/lib/gollum/frontend/views/layout.rb +++ b/lib/gollum/frontend/views/layout.rb @@ -19,6 +19,10 @@ module Precious def has_path !@path.nil? end + + def base_url + @base_url + end end end end