(TWC) Input Box

80 views
Skip to first unread message

jpt

unread,
Apr 13, 2015, 7:19:27 PM4/13/15
to tiddl...@googlegroups.com
Hi,
I am trying to make a box for inputting new tiddlers (tiddler titles only).
It has to operate from the Main Menu and I want it to create the tiddler "silently" (without opening it).
I have tried QuickNotes (http://tiddlytools.com/#QuickNotePlugin), it adds however user name and date as the title and opens the tiddler once created and I don't know how to tweak that.
I used Tobi Beer's Notes (http://lastfm.tiddlyspot.com/#Notes) and it looks promising, but has to be tweaked.
I hacked and mutilated the code and got it working in the "story" part of the TW. It only works on the Main Menu when the tiddler containing it is also being displayed for viewing.
Sorry if this all sounds complicated.
Here is the re-purposed code:

<html><nowiki><form id="Notes" style="width:100%;height:20px;">
<input title="message title" name="msgTitle" type="text" cols="60" style="width:90%;height:20px;padding:0px;margin-bottom:1px;margin-right:2px;border:1px solid #CCC;"><input title="tags added to message" name="msgTags" type="text" cols="60" style="display:none;width:0%;height:20px;padding:0px;margin-bottom:0px;border:0px solid #CCC;"><br/>
<textarea title="message body" name="msgBody" rows="1" cols="0" style="display:none;width:0%;height:0px;padding:0px 0px;margin:0px;float:left;border:0px solid #CCC;"></textarea>
<input class="button" type="button" value="ok" style="font-weight:bold;font-size:1.0em;width:9%;height:22px;float:right;border:1px solid #CCC;margin:-23px 0px 0px 0px;" title="click to save this message" onclick="
       
var note=this.form.msgBody.value;// if (note=='') return;
       
var tags=this.form.msgTags.value.readBracketedList();
        tags
.push('day');
       
var tid=story.findContainingTiddler(place).getAttribute('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,{});
       
this.form.msgTitle.value='';
       
this.form.msgTags.value='';
       
this.form.msgBody.value='';
       
this.form.msgTitle.focus();">
</form></html>


I would be grateful for any pointers.

Thank you.

Johannes

Leo Staley

unread,
Apr 14, 2015, 5:09:36 AM4/14/15
to tiddl...@googlegroups.com
Okie dokie. So Tobi has a much more complete version of this working at tbgtd.tiddlyspot.com/#QuickNotes, with some great documentation at http://tbgtd.tiddlyspot.com/#[[quick-add%20help]] (Tobi tends to have downright awesome documentation!)

Basically, copy the script into a new tiddler, and it should work, no plugin required. (you'll need the TiddlerListMacro plugin for the feature of listing recently created notes from it)

You should be able to hack and tweak away at this to fit your needs quite a bit more easily.

jpt

unread,
Apr 14, 2015, 5:54:14 AM4/14/15
to tiddl...@googlegroups.com
Great!
Thank you - will try.
Johannes
Reply all
Reply to author
Forward
0 new messages