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