> Search your tiddler content for "focusTiddler"... that is the core
> function that is being hijacked by the tweak. If some other plugin
> is also hijacking this function, it might be preventing the tweaked
> code from being properly invoked.
>
> Let me know what you find...
Aha - I found 2 other tiddlers using "focusTiddler". (Interstingly
they focus on 'title', which is exactly what I'm trying to
do... :-) I'm copying the parts that contain the focusTiddler
parts. If anyone bothers to take a look at it; great, but if no
immediate solution pops up I/we'll just leave it and I'll continue to
manually focus (my application for it allows me to). I'm very grateful
for the efforts that you put in Eric!
NewTiddlerWithFieldsMacro
http://tampageekland.tiddlyspot.com#NewTiddlerWithFieldsMacro
config.macros.newTiddlerWithFields.onClickNewTiddlerWithFields =
function() {
var title = this.getAttribute("newTitle");
if(this.getAttribute("isJournal")) {
var now = new Date();
title = now.formatString(title.trim());
}
var params = this.getAttribute("params").split("|");
var custFields = this.getAttribute("custFields").split("|");
var custValues = this.getAttribute("custValues").split("|");
var focus = this.getAttribute("newFocus");
var template = this.getAttribute("newTemplate");
story.displayTiddler(null,title,template);
var text = this.getAttribute("newText");
if (typeof text == "string")
story.getTiddlerField(title,"text").value = text.format([title]);
for (var t=0;t<params.length;t++)
story.setTiddlerTag(title,params[t],+1);
for (var i=0;i<custFields.length;i++)
story.setTiddlerField(title,custValues[i],+1,custFields[i]);
story.focusTiddler(title,focus);
return false;
}
NewHerePlugin
http://mptw.tiddlyspot.com/#NewHerePlugin
{{{
merge(config.commands,{
newHere: {
text: 'new here',
tooltip: 'Create a new tiddler tagged as this tiddler',
hideReadOnly: true,
handler: function(e,src,title) {
if (!readOnly) {
clearMessage();
var t=document.getElementById('tiddler'+title);
story.displayTiddler(t,config.macros.newTiddler.title,DEFAULT_EDIT_TEMPLATE);
story.setTiddlerTag(config.macros.newTiddler.title, title, 0);
story.focusTiddler(config.macros.newTiddler.title,"title"); //
doesn't work??
return false;
}
}
},
newJournalHere: {
//text: 'new journal here', // too long
text: 'new journal',
hideReadOnly: true,
dataFormat: 'DD MMM YYYY', // adjust to your preference
//dataFormat: 'YYYY-0MM-0DD',
tooltip: 'Create a new journal tiddler tagged as this tiddler',
handler: function(e,src,title) {
if (!readOnly) {
clearMessage();
var now = new Date();
var t=document.getElementById('tiddler'+title);
var newtitle = now.formatString(this.dataFormat)
story.displayTiddler(t,newtitle,DEFAULT_EDIT_TEMPLATE);
story.setTiddlerTag(newtitle, title, 0);
story.focusTiddler(newtitle,"title");
return false;
}
}
}
> The "usage" describes the syntax for adding the option into your own
Oh, you mean I can focus onto a specific separate tiddler? Sounds like
it could come in handy when I'm a littler sharper at this.
Eric, thank you!
/Mat