mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-28 16:23:15 +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:
parent
72e2238dc9
commit
7dbe117bc5
|
@ -324,9 +324,11 @@ Generate a title for the draft of a given tiddler
|
||||||
*/
|
*/
|
||||||
NavigatorWidget.prototype.generateDraftTitle = function(title) {
|
NavigatorWidget.prototype.generateDraftTitle = function(title) {
|
||||||
var c = 0,
|
var c = 0,
|
||||||
draftTitle;
|
draftTitle,
|
||||||
|
username = this.wiki.getTiddlerText("$:/status/UserName"),
|
||||||
|
attribution = username ? " by " + username : "";
|
||||||
do {
|
do {
|
||||||
draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'";
|
draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'" + attribution;
|
||||||
c++;
|
c++;
|
||||||
} while(this.wiki.tiddlerExists(draftTitle));
|
} while(this.wiki.tiddlerExists(draftTitle));
|
||||||
return draftTitle;
|
return draftTitle;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user