[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-24 Thread Astrid Elocson
A very interesting link – thank you, Mario. – æ -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group,

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-24 Thread Tobias Beer
Probably this: From hangout #38 11.March.2014 1:03:54 Jeremy- proposal: .. hiding internal tiddler fields, because they are immutable ... discussion. https://www.youtube.com/watch?x-yt-ts=1421914688v=6obIvP5NiQ4x-yt-cl=84503534feature=player_detailpage#t=3834 about 10 minutes This was

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-24 Thread PMario
On Friday, January 23, 2015 at 12:54:41 AM UTC+1, Tobias Beer wrote: Presumably the reason for freezing the fields is to force all modifications to go through a single point – namely *addTiddler* – to guarantee that the display gets refreshed in response. Let's wait and see what the

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-22 Thread Astrid Elocson
*addTiddler* appears to also update existing tiddlers, and only those fields handed down in the fields object. When a field is explicitly declared as *undefined* or *null*, it is deleted. *addTiddler* either just accepts its parameter as a tiddler, or it constructs a new tiddler using its

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-22 Thread Tobias Beer
I couldn't quite decipher how *addTiddler *circumvents this. I don't think it does. The tiddler constructor function freezes the tiddler's map of fields and the value of each field. *addTiddler* constructs an entirely new tiddler and slots it into the wiki's map of tiddlers, replacing

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-22 Thread Astrid Elocson
I couldn't quite decipher how *addTiddler *circumvents this. I don't think it does. The tiddler constructor function freezes the tiddler's map of fields and the value of each field. *addTiddler* constructs an entirely new tiddler and slots it into the wiki's map of tiddlers, replacing the

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-22 Thread Astrid Elocson
Anyhow, updating a tiddler essentially means deleting the old one and overwriting it with another. Yes. The *setText* method of the wiki object is perhaps the simplest case of this. Would be good if there were some instructions on how to handle *getCreationFields *and

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-22 Thread Tobias Beer
Presumably the reason for freezing the fields is to force all modifications to go through a single point – namely *addTiddler* – to guarantee that the display gets refreshed in response. Let's wait and see what the master will add as a rationale to all this. I sure appreciate the fact

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-22 Thread Tobias Beer
*addTiddler* either just accepts its parameter as a tiddler, or it constructs a new tiddler using its parameter as a definition of the fields. I see. So, to modify one... 1. you retrieve the tiddler in the code 2. instead of manipulating it directly 3. you create a fields object

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread RichShumaker
Thanks BJ for the question I used a [[Special Tag]] so I knew what all the Tiddlers were, I do not need to change that. Thanks again Tobias for all your help, I hit one minor snag and I don't know if your code will be able to overcome it. I did more testing last night and I think I have to use

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread RichShumaker
So now for the silly question, how do I use this? Do I create a bookmarklet http://tb5.tiddlyspot.com/#Creating%20Smart%20Bookmarklets with it or do I need to use this another way?(I haven't made any bookmarklets yet so that might be interesting) As always thanks everyone for your help. Rich

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread Tobias Beer
tiddlers are forced to be immutable by tiddlywiki so the code has to be more like this: Do you know what part of the core does this immutability thing? I'd be interested in seeing how that works. Best wishes, Tobias. -- You received this message because you are subscribed to the Google

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread BJ
It's in the boot.js - ``` // Freeze the tiddler against modification Object.freeze(this.fields); ``` On Wednesday, January 21, 2015 at 3:54:58 PM UTC-6, Tobias Beer wrote: tiddlers are forced to be immutable by tiddlywiki so the code has to be more like this: Do you know what part

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread Tobias Beer
I should ask you Tobias have you tested with an embedded image and does the image data stay or is it deleted? The above code clears the text field. You could modify the code of the above by - adapt the filter to have it select all with a *_canonical_uri* field - remove the code that

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread RichShumaker
So I was able to get the stuff I did yesterday with JSON over to my other computer and it worked flawlessly. ARGH I will be trying your solution next Tobias and thanks again for your help. I really like JSON, just wish it worked on this computer and I have no idea what craziness is on this

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread RichShumaker
Tobias, Thank you very much that took me a few minutes to find the images I put in there but now they are all External and the TW dropped almost 10mb in size. WooHoo. You may want to add the F12 Console details to your developer page for this solution. That was awesome and saved me a TON of

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread RichShumaker
Last update I hope. I used the length macro and lsort filter http://tbdemo.tiddlyspot.com/#length%20macro%20and%20lsort%20filter thanks again for cataloging that Tobias and I shaved even more off. From 16mb to under 3mb in less than an hour. Thanks again everyone for all the help. Rich

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread Tobias Beer
Object.freeze(this.fields); I couldn't quite decipher how *addTiddler *circumvents this. What am I missing? Best wishes, Tobias. -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread Tobias Beer
So now for the silly question, how do I use this? Do I create a bookmarklet http://tb5.tiddlyspot.com/#Creating%20Smart%20Bookmarklets with it or do I need to use this another way?(I haven't made any bookmarklets yet so that might be interesting) You hit F12 to open the developer tools

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread Tobias Beer
I tried to write a litte console script, but I'm stuck... var tids = $tw.wiki.filterTiddlers([field:type[image/jpeg]!has[_canonical_uri]]); $tw.utils.each(tids,function(t){ var tid = $tw.wiki.getTiddler(t); tid.fields.text = ; tid.fields._canonical_uri = t;

Re: [tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread BJ
tiddlers are forced to be immutable in boot - so the code has to be more like: $tw.utils.each(tids,function(t){ var tiddler = $tw.wiki.getTiddler($tw.listtag)||{title:$tw.listtag}, updateFields = {}; updateFields[text] = ; updateFields[_canonical_uri] =

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread BJ
Hi Tobias, tiddlers are forced to be immutable by tiddlywiki so the code has to be more like this: $tw.utils.each(tids,function(t){ var tiddler = $tw.wiki.getTiddler(t), updateFields = {}; updateFields[text] = ; updateFields[_canonical_uri] = Images/+t;

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-21 Thread Tobias Beer
tiddlers are forced to be immutable by tiddlywiki so the code has to be more like this: Thanks, BJ, that works... convert embedded to external images @ dev5 http://dev5.tiddlyspot.com/#convert%20embedded%20to%20external%20images The code (just set the path correctly, assuming the tiddler

[tw] Re: [TW5] Changing an Image from Embedded to _canonical_uri

2015-01-20 Thread BJ
Do you mean that you have tagged all the tiddlers to be changed with [[Special Tag]]? BJ On Tuesday, January 20, 2015 at 7:59:54 PM UTC-6, RichShumaker wrote: I have a bunch of JPEG's that I put directly into my TW5 before I saw the _canonical_uri light. I have all the images in the same