Fix path
This commit is contained in:
@@ -342,10 +342,15 @@ var applyTimeout = function () {
|
||||
~-1 == false; !~-1 == true;
|
||||
*/
|
||||
if ( !~location.host.indexOf('github.com') ) {
|
||||
// ensure leading / is removed from path and that it ends with /
|
||||
var path = unescape($.key( 'path' )).replace(/^\/+/, '');
|
||||
if ( path.charAt( path.length - 1 ) !== '/' ) {
|
||||
path += '/';
|
||||
}
|
||||
|
||||
jQuery.ajax( {
|
||||
type: 'GET',
|
||||
// ensure leading / is removed from path
|
||||
url: baseUrl + '/data/' + $.key( 'path' ).replace(/^\/+/, '') + $.key( 'page' ),
|
||||
url: baseUrl + '/data/' + path + $.key( 'page' ),
|
||||
success: function( data ) {
|
||||
editorSession.setValue( data );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user