fix some issues with path names

This commit is contained in:
Matthew Scragg 2015-12-09 17:41:15 -06:00
parent 7d9cc29223
commit 93df0e081a
4 changed files with 13 additions and 6 deletions

View file

@ -89,13 +89,13 @@ var aced = new Aced({
info: Commit.info,
submit: function(content) {
var data = {
name: $page_name.val(),
name: $page_name.val().replace(/^\/*/g, "").replace(/\/+/g, "/"),
message: $page_message.val(),
content: content
};
// If renaming an existing page, use the old page name for the URL to PUT to
var subPath = (PAGE_NAME) ? PAGE_NAME : data['name']
var subPath = (PAGE_NAME) ? PAGE_NAME : data['name'];
var path = Config['RELATIVE_PATH'] + '/' + subPath;
var newPath = Config['RELATIVE_PATH'] + '/' + data['name'];