Skip to content

Commit

Permalink
#388 if no file extension is added from the users name; default one f…
Browse files Browse the repository at this point in the history
…rom the exemplar
  • Loading branch information
jstrachan committed Jul 12, 2013
1 parent 38c4192 commit a544e6d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/view.ts
Expand Up @@ -125,6 +125,14 @@ module Wiki {
var exemplar = template.exemplar;
var name = $scope.newDocumentName || exemplar;

if (name.indexOf('.') < 0) {
// lets add the file extension from the exemplar
var idx = exemplar.lastIndexOf(".");
if (idx > 0) {
name += exemplar.substring(idx);
}
}

var commitMessage = "Created " + template.label;
var exemplarUri = url("/app/wiki/exemplar/" + exemplar);

Expand Down

0 comments on commit a544e6d

Please sign in to comment.