Messing around a bit I think this could be done best by hijacking the
"Story.prototype.saveTiddler" function, and using an if statement.
If readabletitle = "";
readabletitle = newTitle;
But I'm really not sure how to go about adding such an if statement or if
that's the right place.
Given that I can't seem to get anything to stick.
I tired simply adding:
tiddlerElem.setAttribute("readabletitle",newTitle);
To see if that would work since as far as I can tell that should always
just overwrite the readabletitle field with the newTitle but that doesn't
seem to be the case.
in firebug I can see that it adds the attribute but it doesn't populate
the field nor save to the Tw file on save.
On Wednesday, March 20, 2013 6:08:47 PM UTC-7, Arc Acorn wrote:
>
> I don't seem to have learned enough JS to really figure out where I should
> be looking to do this so I figured I'd ask. :D
>
> !What I'm doing and Where I'm at:
> Effectively I have replaced the normal machine title with a readable title
> in view mode.
>
> In my editTemplate I added:
> <div class='editor readableTitleeditor' macro='edit readabletitle'></div>
>
> viewTemplate I added:
> <div class='readableTitle' macro='view readabletitle'></div>
> and used CSS to show the normal title as a sudo-tool-tip when hovering
> hovering over the readable title.
>
> !!Why?
> So that I can use a single TiddlyWIki for multiple projects that I would
> like to keep track of and search at the same time and be able to overlap
> names by having the normal title + a readable title.
> Example:
> | Readable Title | Machine Title |
> | Character Database | ChracterDatabaseBook1 |
> | Character Database | ChracterDatabaseBook2 |
> | Character Database | ChracterDatabaseBook3 |
> | Chapter 1 | C1Book1 |
> | Chapter 2 | C2Book1 |
> | Chapter 3 | C3Book1 |
> | Chapter 1 | C1Book2 |
> | Chapter 2 | C2Book2 |
> | Chapter 3 | C3Book2 |
> | Chapter 1 | C1Book3 |
> | Chapter 2 | C2Book3 |
> | Chapter 3 | C3Book3 |
> ...etc
> ----
>
> Now that you know what I'm doing and why here's my question:
>
> How do I set the readable title to automatically copy the normal title if
> null?
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.