1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

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?
This commit is contained in:
Jermolene 2018-08-23 17:43:06 +01:00
parent 72e2238dc9
commit 7dbe117bc5

View File

@ -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;