From 7dbe117bc55a9cda91ce7b480525a2b2a70b8229 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 23 Aug 2018 17:43:06 +0100 Subject: [PATCH] Add username (if set) to the title of draft tiddlers Makes things a bit easier to follow when working in multiuser environments. @inmysocks, @danielo515, @arlen22, @pmario, @drakor does this make sense for your use cases? --- core/modules/widgets/navigator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index c70cd820e..40c173352 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -324,9 +324,11 @@ Generate a title for the draft of a given tiddler */ NavigatorWidget.prototype.generateDraftTitle = function(title) { var c = 0, - draftTitle; + draftTitle, + username = this.wiki.getTiddlerText("$:/status/UserName"), + attribution = username ? " by " + username : ""; do { - draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'"; + draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'" + attribution; c++; } while(this.wiki.tiddlerExists(draftTitle)); return draftTitle;