Hi,
Modifying the "Note" tiddler by Tobias Beer 
(http://lastfm.tiddlyspot.com/#Notes) I was able to use the following code 
as a transclusion (<<tiddler inputBox with:"tag tag tag">>). 
It allows for the "silent" creation of tiddlers by entering their title 
into the box and pressing enter. 
I have not been able to make it so that the focus returns to the input box, 
but then my use of the AutoRefresh tranclusion might have messed with that.
It's called "inputBox" and here is the code:
<html><nowiki>
    <form id="Notes" style="width:100%;height:20px;">
        <input 
            title="message title" 
            name="msgTitle" 
            type="text" 
            cols="60" 
            style="
                width:100%;
                height:20px;
                padding:0px;
                margin-bottom:1px;
                margin-right:2px;
                border:1px solid #CCC;" 
            onKeydown="
if (event.keyCode == 13){
var note=this.form.msgBody.value;
var tags=this.form.msgTags.value.readBracketedList();
tags.push();
var tid = store.getTiddler('tiddler');
var who=config.options.txtUserName; 
var when=new Date();
var title=this.form.msgTitle.value;
if (title=='') title=when.formatString('YYYY-0MM-0DD 0hh:0mm:0ss');
var msg=config.messages.overwriteWarning.format([title]);
if (store.tiddlerExists(title) && !confirm(msg)) return; 
store.saveTiddler(title,title,note,who,when,tags,{}); 
refreshDisplay('$2');
story.refreshTiddler('$3',null,true);
this.form.msgTitle.value='';
this.form.msgTags.value='';
this.form.msgBody.value='';
this.form.msgTitle.focus();}">
        <input 
            title="tags added to message" 
            name="msgTags" 
            type="text" 
            value="$1" 
            cols="60" 
            style="display:none;">
        <textarea 
            title="message body" 
            name="msgBody" 
            value="$4" 
            rows="1" 
            cols="0" 
            style="display:none;">
        </textarea>
    </form>
</html>
Note the use of the place holders $1, $2, $3, $4. 
Any suggestions for improvements are welcome.

Regards,
Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/505324d2-69a4-4950-8c97-dfc145754139%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to