From 7ae4acbdb03fc4c762edab628959cbe646d85305 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Thu, 30 Aug 2012 11:03:11 -0300 Subject: [PATCH] Fix #497 #492 Data url now includes path. --- .../frontend/public/gollum/livepreview/js/livepreview.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js b/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js index e420b9e9..4fe66266 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +++ b/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js @@ -100,7 +100,7 @@ $.save = function( commitMessage ) { var newLocation = baseUrl; function clean( str ) { - return str.replace(/^\/+/g, '/'); + return str.replace(/^\/+/, '/'); } // 'a%2Fb' => a/b @@ -344,7 +344,8 @@ var applyTimeout = function () { if ( !~location.host.indexOf('github.com') ) { jQuery.ajax( { type: 'GET', - url: baseUrl + '/data/' + $.key( 'page' ), + // ensure leading / is removed from path + url: baseUrl + '/data/' + $.key( 'path' ).replace(/^\/+/, '') + $.key( 'page' ), success: function( data ) { editorSession.setValue( data ); }