lib/gollum/frontend/public/gollum/javascript/gollum.js in gollum-2.1.4 vs lib/gollum/frontend/public/gollum/javascript/gollum.js in gollum-2.1.6
- old
+ new
@@ -2,11 +2,11 @@
$(document).ready(function() {
$('#delete-link').click( function(e) {
var ok = confirm($(this).data('confirm'));
if ( ok ) {
var loc = window.location;
- loc = baseUrl + '/delete' + loc.pathname
+ loc = baseUrl + '/delete' + loc.pathname.replace(baseUrl,'');
window.location = loc;
}
// Don't navigate on cancel.
e.preventDefault();
} );
@@ -139,11 +139,11 @@
jQuery.ajax( {
type: 'POST',
url: baseUrl + '/edit/' + oldName,
data: { path: path, rename: newName, page: oldName, message: msg },
success: function() {
- window.location = baseUrl + encodeURIComponent(newName);
+ window.location = baseUrl + '/' + encodeURIComponent(newName);
}
});
}
});
});
@@ -152,33 +152,25 @@
if ($('#minibutton-new-page').length) {
$('#minibutton-new-page').removeClass('jaws');
$('#minibutton-new-page').click(function(e) {
e.preventDefault();
- var path = location.pathname;
- // ensure there's more than one slash in pathname.
- if (path.split('/').length > 2) {
- path = path.substr(0, path.lastIndexOf('/') + 1);
- } else {
- path = '';
- }
-
$.GollumDialog.init({
title: 'Create New Page',
fields: [
{
id: 'name',
name: 'Page Name',
type: 'text',
- defaultValue: path || ''
+ defaultValue: ''
}
],
OK: function( res ) {
var name = 'New Page';
if ( res['name'] ) {
name = res['name'];
}
- window.location = baseUrl + encodeURIComponent(name);
+ window.location = baseUrl + '/' + encodeURIComponent(name);
}
});
});
}