Problems with Eric's QuickNote transclusion on TiddlySpace

8 views
Skip to first unread message

Måns

unread,
Aug 29, 2010, 6:45:44 PM8/29/10
to TiddlyWeb
Hi TwSpaceWizards

How do I make Eric's QuickNote transclusion work on TiddlySpace?
When I hit "save" a tiddler is created (more or less silently) however
it isn't saved even if it appears in the timeline.
When I open it to make edits I see two radiobuttons where I'm supposed
to choose "Private" or "Public".
If I choose "Private" I get an error telling me that "origin is
unknown"... - and I still can't make persistent savings of the
tiddler.

Must I add some code to the transclusion to make TiddlySpace "know"
the tiddlers origin?
http://www.tiddlytools.com/#QuickNote.

QuickNote is an essential tool for my projects when I share a Space
for collaboration.

Regards Måns Mårtensson

FND

unread,
Aug 30, 2010, 1:30:44 AM8/30/10
to tidd...@googlegroups.com
> How do I make Eric's QuickNote transclusion work on TiddlySpace?
> When I hit "save" a tiddler is created (more or less silently) however
> it isn't saved even if it appears in the timeline.

QuickNote, while saving the tiddler to the local TiddlyWiki store (via
saveTiddler), does not trigger persistent storage (via saveChanges).

Whether that's intentional or an omission, I can't tell. Normally
plugins creating or modifying tiddlers should trigger autoSaveChanges
right after saveTiddler, but there are some cases where that might be
undesirable (e.g. when multiple tiddlers are modified in short order).

As a temporary workaround, you could manually trigger saveChanges via
the <<saveChanges>> macro.


-- F.

Måns

unread,
Aug 30, 2010, 2:20:49 AM8/30/10
to TiddlyWeb
Hi again

I've got the same problem with CreateTiddlersFromCsv
http://www.TiddlyTools.com/#CreateTiddlersFromCSV .
When I have created a lot of (300) tiddlers - none are saved - and I
can't save them via the <<saveChanges>> macro on my space. It doesn't
seem to trigger persistent storage in this case or for tiddlers
created with QuickNote..
I've noticed that sometimes, when I've been using a checkBoxToggleTag
- or changed a custom fieldvalue in a tiddler, that tiddler isn't
saved untill I have made a "normal" change to a tiddler - then the
saving of the first edit is triggered.
However this doesn't work for quicknotes or tiddlers created by
CreateTiddlersFromCsv.

I've added fnd as member - if you'd like to watch what happens (or
doesn't happen):http://hu2.tiddlyspace.com/#ElevListeKnap


regards Måns Mårtensson

Måns

unread,
Aug 30, 2010, 2:36:32 AM8/30/10
to TiddlyWeb
Btw I had quite a hazzle trying to remove a published version of my
zzConfig tiddler..
None of the options (from the dropdown to the left "tiddlerOrigin"?)
to change or remove it worked.
As a final solution I opened the [public] version directly and deleted
it. I got this errormessage:
"Error removing zzConfig [public]: Precondition Failed
zzConfig saved successfully"
However it *was* removed and now it seems to work..

Regards Måns Mårtensson

FND

unread,
Aug 30, 2010, 3:09:49 AM8/30/10
to tidd...@googlegroups.com
> I've got the same problem with CreateTiddlersFromCsv

So, turns out it's not just saveChanges - those plugins also don't
handle custom fields as expected, specifying an empty object rather than
using config.defaultCustomFields. You might wanna alert Eric, see
whether he has any objections to changing that behavior.

> I've noticed that sometimes, when I've been using a checkBoxToggleTag
> - or changed a custom fieldvalue in a tiddler, that tiddler isn't
> saved untill I have made a "normal" change to a tiddler - then the
> saving of the first edit is triggered.

Yes, that's the saveChanges issue...

> Btw I had quite a hazzle trying to remove a published version of my
> zzConfig tiddler.. None of the options (from the dropdown to the left
> "tiddlerOrigin"?) to change or remove it worked.

I don't quite follow what happened there - if you can reproduce it,
could you report this in a new thread?


-- F.

PMario

unread,
Aug 30, 2010, 5:10:39 AM8/30/10
to TiddlyWeb
Hi Måns,
Have a look if you have a copy of tiddlySpace core plugin
ToggleTiddlerPrivacyPlugin. I had a similar issue, that was fixed with
the new version.
-m

Måns

unread,
Aug 30, 2010, 5:27:56 AM8/30/10
to TiddlyWeb
Hi Pmario

I have:
Name ToggleTiddlerPrivacyPlugin
Version 0.5.5
Status beta

Cheers Måns Mårtensson

Måns

unread,
Aug 30, 2010, 4:36:44 PM8/30/10
to TiddlyWeb
Hi again

Is it possible to make some kind of "updatecode" to revaluate tiddlers
created by QuickNote?
Like: (this doesn't work in this case, however I used it with
TiddlyHome to trigger the UploadTiddlersPlugin (BidiX) to update
tiddlers I tagged with CheckBoxToggleTag):

<script label="Update tiddlers tagged with a specified tag">
var tag=prompt('Write tagname'); if (!tag||!tag.length) return;
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}
store.resumeNotifications();
</script>

??

Regards Måns Mårtensson

PMario

unread,
Aug 30, 2010, 5:33:15 PM8/30/10
to TiddlyWeb
hi Måns,
This doesn't work because config.defaultCustomFields aren't set in the
right way by "non tiddlyspace" aware plugins. TiddlySpace won't save
any tiddler, that is created prgrammatically without server.xxx set
right.
If a tiddler is created something like

if(!tid) {
tid = new Tiddler('ColorPalette');
tid.fields = merge({}, config.defaultCustomFields); // <----
tid.modifier ='RandomColorPalette Macro';
}

is needed.
I think, there was no need to set tid.fields, for any plugin prior to
tiddlyWeb.
-m
Message has been deleted

Måns

unread,
Aug 30, 2010, 7:34:20 PM8/30/10
to TiddlyWeb
Hi Mario
> This doesn't work because config.defaultCustomFields aren't set in the
> right way by "non tiddlyspace" aware plugins. TiddlySpace won't save
> any tiddler, that is created prgrammatically without server.xxx set
> right.
I believe this is the codesnippet responsible for the nonfunctioning
saveaction:
store.saveTiddler(title,title,text,who,when,tags,{});

Is it possible/a solution just to add specific TiddlySpace fields to
the row or do I have to define the fields in the transclusion first??

Regards Måns Mårtensson

FND

unread,
Aug 31, 2010, 2:51:40 AM8/31/10
to tidd...@googlegroups.com
> I believe this is the codesnippet responsible for the nonfunctioning
> saveaction:
> store.saveTiddler(title,title,text,who,when,tags,{});
> Is it possible/a solution just to add specific TiddlySpace fields to
> the row or do I have to define the fields in the transclusion first??

You'd just replace "{}" with "config.defaultCustomFields" - however, I'm
not sure it's such a good idea to fork Eric's plugin, better give him a
chance to update it (this is not TiddlySpace- or TiddlyWeb-specific, but
rather a generic issue).


-- F.

Måns

unread,
Aug 31, 2010, 3:29:45 AM8/31/10
to TiddlyWeb
Hi Fnd
> You'd just replace "{}" with "config.defaultCustomFields" - however, I'm
> not sure it's such a good idea to fork Eric's plugin, better give him a
> chance to update it (this is not TiddlySpace- or TiddlyWeb-specific, but
> rather a generic issue).
Thanks, I'll try that.
My intention is *not* to try to fork Eric's plugin (I have made a
request directly to Eric), however I'm making my own mod anyway - so
I'll make changes that suits my TW - (translation to Danish etc).

Regards Måns Mårtensson

Måns

unread,
Aug 31, 2010, 4:19:31 AM8/31/10
to TiddlyWeb
Hi again
> You'd just replace "{}" with "config.defaultCustomFields" -
Works! - Thank you very much.
However the tiddler still has to be edited to trigger saving.
Can I change this code and make an update/save button from it?
- or should I rather add something to the transclusion's code to make
it save the new tiddler at once?:
<script label="Update tiddlers tagged with a specified tag">
var tag=prompt('Write tagname'); if (!tag||!tag.length) return;
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.saveTiddler
(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}

store.resumeNotifications();
</script>

Regards Måns Mårtensson

FND

unread,
Aug 31, 2010, 4:24:33 AM8/31/10
to tidd...@googlegroups.com
> Works! - Thank you very much.
> However the tiddler still has to be edited to trigger saving.

At the end of the script, just add "autoSaveChanges();"


-- F.

Måns

unread,
Aug 31, 2010, 9:20:18 AM8/31/10
to TiddlyWeb
Hi Fnd
> At the end of the script, just add "autoSaveChanges();"
Awesome!!
Thanks a lot - now my QuickNote-TiddlySpace-mod works as a charm!!

Cheers Måns Mårtensson

Måns

unread,
Aug 31, 2010, 4:48:17 PM8/31/10
to TiddlyWeb
Hi again

I tried same procedure with Eric's CreateTiddlersFromCsv, however the
"defaultCustomFields-thing" seems to prevent the process of inputting
the custom fields from the csv:
Original:
store.saveTiddler(title,title,text,who,when,tags,fields,true,created||
when);
displayMessage('Created '+title);
My change:
store.saveTiddler(title,title,text,who,when,tags,config.defaultCustomFields,fields,true,created||
when);
displayMessage('Created '+title);
I tried to change position of "config.defaultCustomFields", however
the result seems to be the same: no custom fields from the csv!

regards Måns Mårtensson

Måns

unread,
Aug 31, 2010, 4:56:16 PM8/31/10
to TiddlyWeb
Sorry -

> I tried to change position of "config.defaultCustomFields", however
> the result seems to be the same: no custom fields from the csv!

I tried too few times before posting - It seems to work like this:
store.saveTiddler(title,title,text,who,when,tags,fields,config.defaultCustomFields,true,created||
when);

I can't make the autosave function - however it might be a bad thing
to autosave 150 tiddlers individually - so I'm back at the first track
- trying to alter the "update tiddlers tagged" to work on
TiddlySpace...

Sorry for my impatient postings - I'm in a hurry - and I didn't try
all possible combinations in advance..

Cheers Måns Mårtensson

Måns

unread,
Aug 31, 2010, 5:18:00 PM8/31/10
to TiddlyWeb
Last post on this subject from me:
I made it work like this:
<script label="Update tiddlers tagged with a specified tag">
var tag=prompt('Write tagname'); if (!tag||!tag.length) return;
var tids=store.getTaggedTiddlers(tag);
store.suspendNotifications();
for (var i=0; i<tids.length; i++) { var t=tids[i];
store.saveTiddler
(defaultCustomFields,t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields);
}

store.resumeNotifications();
</script>
It works as I wanted it to - triggers save on all tiddlers tagged with
a tag. This way I can create an updatebutton for my CheckBoxToggleTag
- which is exactly what I need for my project.

Thanks for helping me out.

Cheers Måns Mårtensson

Måns

unread,
Aug 31, 2010, 6:34:40 PM8/31/10
to TiddlyWeb
Sorry again - the script doesn't work - saving it merely triggered
saving of all modified tiddlers.. :-(

FND

unread,
Sep 1, 2010, 4:40:03 AM9/1/10
to tidd...@googlegroups.com
> I tried same procedure with Eric's CreateTiddlersFromCsv, however the
> "defaultCustomFields-thing" seems to prevent the process of inputting
> the custom fields from the csv

You want to merge the fields then:
fields = jQuery.extend({}, config.defaultCustomFields, fields);
store.saveTiddler(...);


-- F.

Måns

unread,
Sep 1, 2010, 1:25:35 PM9/1/10
to TiddlyWeb
Hi Fnd
> You want to merge the fields then:
>     fields = jQuery.extend({}, config.defaultCustomFields, fields);
>     store.saveTiddler(...);
Great!! Thanks for the tip - I really appreciate your minimalistic
snippetstyle answers, I get the feeling that I learn new stuff from
putting snippets into context and at the same time i get a peek into
some really basic things which I know less than nothing about
(syntactically speaking)from each reply!
Thank you very much for socratic and patient guidance!!

Cheers Måns Mårtensson

Måns

unread,
Sep 1, 2010, 1:53:22 PM9/1/10
to TiddlyWeb
Hi again - another question related to this:
> You want to merge the fields then:
>     fields = jQuery.extend({}, config.defaultCustomFields, fields);
>     store.saveTiddler(...);
I tried to use the snippet in TiddlerNotesPlugin, however it doesn't
work..

Here's how the original code looks (if I insert the merge fields
function, the noteswindow will not close - or save the note):
var suffix = box.getAttribute("suffix");
var t = store.getTiddler(title+"-"+suffix);
store.saveTiddler(title+"-"+suffix,title
+"-"+suffix,textarea.value,config.options.txtUserName,new Date(),t?
t.tags:box.getAttribute("tag"),t?t.fields:{});

regards Måns Mårtensson

FND

unread,
Sep 3, 2010, 10:35:46 AM9/3/10
to tidd...@googlegroups.com
> I tried to use the snippet in TiddlerNotesPlugin, however it doesn't
> work..

That plugin has some logic embedded there:
t?t.fields:{}

That's a ternary operation, a shortcut for "if t then t.fields else {}".

Best to untangle this, determining fields above the saveTiddler call:

var t = store.getTiddler(title + "-" + suffix);
var fields = t ? t.fields : {};


fields = jQuery.extend({}, config.defaultCustomFields, fields);

store.saveTiddler( ... , fields);

> I really appreciate your minimalistic snippetstyle answers, I get the
> feeling that I learn new stuff from putting snippets into context and
> at the same time i get a peek into some really basic things which I
> know less than nothing about (syntactically speaking)from each
> reply! Thank you very much for socratic and patient guidance!!

It's quite encouraging to watch you continuously acquire new skills!


-- F.

Måns

unread,
Sep 4, 2010, 5:44:16 PM9/4/10
to TiddlyWeb
Hi Fnd

> That plugin has some logic embedded there:
>     t?t.fields:{}
>
> That's a ternary operation, a shortcut for "if t then t.fields else {}".
>
> Best to untangle this, determining fields above the saveTiddler call:
>
> var t = store.getTiddler(title + "-" + suffix);
> var fields = t ? t.fields : {};
> fields = jQuery.extend({}, config.defaultCustomFields, fields);
> store.saveTiddler( ... , fields);

You're the man!! GREAT magic from a TwWizard ;-)
Thanks a lot. Now I've got the TiddlerNotesPlugin working as well :-)

Cheers Måns Mårtensson
Reply all
Reply to author
Forward
0 new messages