[tw5] How to get the title of a tiddler in js?

I installed the tiddler 2click2edit. I want to change it a little that when a tiddler start with the “$”, don’t trigger the edit command.

I already found the related code. Which is $:/plugins/danielo515/2click2edit/ClickListener.js

I think I need to change the code

ClickListener.prototype.editTiddler = function(event) { //alert(this.getVariable("currentTiddler").getTitle());
this.dispatchEvent({type: "tm-edit-tiddler", param: this.getVariable("currentTiddler")}); };

But this.getVariable(“currentTiddler”).getTitle() seems not right, how to fix it.

And is there a manual for program for tw?

Hi,

Instead of altering the javascript, give what’s in the screenshot below a try.

Do note: for the change to take effect, you do have to save and reload your TiddlyWiki.

thank you. Can you give me a link about the viewtemplate, cuz I can’t find it on google.

And why we put a “<$click>” here

You find the viewtemplate in .Danielos 2click2edit plugin

Charlie - editing the viewtemplate lead to another problem - 2 click on one tiddler open all standard tiddlers for edit.

Just to answer your first question, you want to modify the ViewTemplate in your TiddlyWiki that has the plugin. (screenshot below)

Also, after you’ve edited the plugin, you have to make sure to save and reload the TiddlyWiki for the change to take effect.

I just tested this again, and it all works A-1. Double-clicking on any tiddler just opens that one tiddler for edit. Double-clicking on either a shadow or a system tiddler does nothing.

Just as a sanity check, download an empty TiddlyWiki, install the plugin in that TiddlyWiki, and see if things work correctly there.

I suspect you made a change to the plugin’s javascript and also made this edit I suggest to the ViewTemplate.

If you did change the javascript, you should probably remove the plugin and reinstall.

cj.v,
Thank you. I does work for me too now. It was of course an error on my part - not identifying my own typo. It seems no matter how many times we look our writing through- eyes popping out, errors are often not found. I call it TW eye fatigue.

Thank you,
Birthe

Oh good. Big sigh of relief over here. (I may have had “look, see, it works” moments while people politely nod in agreement while awkwardly hoping somebody else lifts a hand and breaks the news…)

Do you know how to disable the plugin when I double click the title? Some time I just want to copy the title not edit the whole tiddler, I double click the title to select it. But now will trigger the edit command

That will require a change to the plugin’s javascript, I think, which will be quite ugly.

Alternatively, you could create a single-click button in the tiddler toolbar which copies the tiddler title to the clipboard. I think that would be a much more trivial affair.