[tw5] Re: TiddlyWiki: Drag and drop image link to create tiddler with _canonical_uri link to the image

2023-04-05 Thread Charlie Veniot
Using the droppable widget, we have no way (none documented that I know of) 
of knowing the URL of the thing being dropped.

We can get the filename, though.

The whole point of using the droppable widget  is to drop into your 
TiddlyWiki just enough info about images from your storage location.to 
create an image tiddler with a canonical uri link.

The info for the canonical uri via drop to the droppable widget is 
incomplete.  You have to provide the missing bit (the standard bit for all 
of your images) that will be added as a prefix to the image name.

If the intent is to create image tiddlers with canonical uri's from all 
possible sources on the web, this is not the right approach.



On Wednesday, April 5, 2023 at 6:12:41 PM UTC-3 Zaphod Beeblebrox wrote:

> Okay... Works, after a fashion.
>
> When I drag an image from a Chrome tab with the folder into the tiddler 
> containing your macro, I get
>
> ./Graphics%20Samples/
>
> before the filename and no image shows in the Tiddler (this is NOT part of 
> the file path to the image).
>
> But once I delete the above addition, all works fine :)
>
> It still adds the '%20' in place of spaces in the filename, but they can 
> safely be replaced by spaces (if I could write filters, I could probably 
> add one to automatically convert them back to spaces, but...)
>
> In any event, this will still be quite useful - Thank You, Charlie :)
>
> On Wednesday, April 5, 2023 at 8:39:47 AM UTC-4 Charlie Veniot wrote:
>
>> If I view a folder on my computer via my web browser, I can drag the 
>> links for image files from that directory listing in my web browser to that 
>> droppable zone I created and have displaying in my local TiddlyWiki.
>>
>> No server needed for that.
>>
>> On Wednesday, April 5, 2023 at 1:27:35 AM UTC-3 Donald Coates wrote:
>>
>>> You have to have some sort of server running to upload files.  When you 
>>> drag an image into a single file wiki it is not uploading it, it is 
>>> converting it to binary(?), not actually uploading the image.  The nodejs 
>>> version is running on server software that can upload files.  I use 
>>> filestash via docker for a very lightweight server to upload images that I 
>>> then use this code to create link to by dragging the link.  It is such a 
>>> time saver.
>>>
>>> On Monday, April 3, 2023 at 9:19:52 PM UTC-4 Zaphod Beeblebrox wrote:
>>>
 Looks great! :)

 Now... Work your sorcery and create a version to do the same thing, 
 only with locally-stored images!

 On Sunday, April 2, 2023 at 7:36:10 PM UTC-4 Charlie Veniot wrote:

> Related TW script *in this post*, just below the video.
>
> https://youtu.be/NjE0MHsndE8
>
> ```
> \define droppable-image-actions()
> <$action-setfield $tiddler=<> $field="text" $value=""/>
> <$action-setfield $tiddler=<> $field="_canonical_uri" 
> $value={{{ 
> [split[/]last[]addprefix[./Graphics%20Samples/]] 
> }}}/>
> <$action-setfield $tiddler=<> $field="type" $value={{{ 
> [split[/]last[]split[.]last[]addprefix[image/]] }}}/>
> <$action-createtiddler $basetitle={{{ [split[/]last[]] 
> }}} $template=<>/>
> <$action-deletetiddler $tiddler=<>/>
> \end
>
> <$droppable actions=<>>
> 
> Drop image here
> 
> 
> ```
>


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a7870d61-e2c9-4915-a80e-2570ff38183fn%40googlegroups.com.


[tw5] Re: TiddlyWiki: Drag and drop image link to create tiddler with _canonical_uri link to the image

2023-04-05 Thread Zaphod Beeblebrox
Okay... Works, after a fashion.

When I drag an image from a Chrome tab with the folder into the tiddler 
containing your macro, I get

./Graphics%20Samples/

before the filename and no image shows in the Tiddler (this is NOT part of 
the file path to the image).

But once I delete the above addition, all works fine :)

It still adds the '%20' in place of spaces in the filename, but they can 
safely be replaced by spaces (if I could write filters, I could probably 
add one to automatically convert them back to spaces, but...)

In any event, this will still be quite useful - Thank You, Charlie :)

On Wednesday, April 5, 2023 at 8:39:47 AM UTC-4 Charlie Veniot wrote:

> If I view a folder on my computer via my web browser, I can drag the links 
> for image files from that directory listing in my web browser to that 
> droppable zone I created and have displaying in my local TiddlyWiki.
>
> No server needed for that.
>
> On Wednesday, April 5, 2023 at 1:27:35 AM UTC-3 Donald Coates wrote:
>
>> You have to have some sort of server running to upload files.  When you 
>> drag an image into a single file wiki it is not uploading it, it is 
>> converting it to binary(?), not actually uploading the image.  The nodejs 
>> version is running on server software that can upload files.  I use 
>> filestash via docker for a very lightweight server to upload images that I 
>> then use this code to create link to by dragging the link.  It is such a 
>> time saver.
>>
>> On Monday, April 3, 2023 at 9:19:52 PM UTC-4 Zaphod Beeblebrox wrote:
>>
>>> Looks great! :)
>>>
>>> Now... Work your sorcery and create a version to do the same thing, only 
>>> with locally-stored images!
>>>
>>> On Sunday, April 2, 2023 at 7:36:10 PM UTC-4 Charlie Veniot wrote:
>>>
 Related TW script *in this post*, just below the video.

 https://youtu.be/NjE0MHsndE8

 ```
 \define droppable-image-actions()
 <$action-setfield $tiddler=<> $field="text" $value=""/>
 <$action-setfield $tiddler=<> $field="_canonical_uri" 
 $value={{{ [split[/]last[]addprefix[./Graphics%20Samples/]] 
 }}}/>
 <$action-setfield $tiddler=<> $field="type" $value={{{ 
 [split[/]last[]split[.]last[]addprefix[image/]] }}}/>
 <$action-createtiddler $basetitle={{{ [split[/]last[]] 
 }}} $template=<>/>
 <$action-deletetiddler $tiddler=<>/>
 \end

 <$droppable actions=<>>
 
 Drop image here
 
 
 ```

>>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/22a62fa6-5bba-4fb4-abf7-06fef95af9aen%40googlegroups.com.


[tw5] Re: TiddlyWiki: Drag and drop image link to create tiddler with _canonical_uri link to the image

2023-04-05 Thread Charlie Veniot
If I view a folder on my computer via my web browser, I can drag the links 
for image files from that directory listing in my web browser to that 
droppable zone I created and have displaying in my local TiddlyWiki.

No server needed for that.

On Wednesday, April 5, 2023 at 1:27:35 AM UTC-3 Donald Coates wrote:

> You have to have some sort of server running to upload files.  When you 
> drag an image into a single file wiki it is not uploading it, it is 
> converting it to binary(?), not actually uploading the image.  The nodejs 
> version is running on server software that can upload files.  I use 
> filestash via docker for a very lightweight server to upload images that I 
> then use this code to create link to by dragging the link.  It is such a 
> time saver.
>
> On Monday, April 3, 2023 at 9:19:52 PM UTC-4 Zaphod Beeblebrox wrote:
>
>> Looks great! :)
>>
>> Now... Work your sorcery and create a version to do the same thing, only 
>> with locally-stored images!
>>
>> On Sunday, April 2, 2023 at 7:36:10 PM UTC-4 Charlie Veniot wrote:
>>
>>> Related TW script *in this post*, just below the video.
>>>
>>> https://youtu.be/NjE0MHsndE8
>>>
>>> ```
>>> \define droppable-image-actions()
>>> <$action-setfield $tiddler=<> $field="text" $value=""/>
>>> <$action-setfield $tiddler=<> $field="_canonical_uri" 
>>> $value={{{ [split[/]last[]addprefix[./Graphics%20Samples/]] 
>>> }}}/>
>>> <$action-setfield $tiddler=<> $field="type" $value={{{ 
>>> [split[/]last[]split[.]last[]addprefix[image/]] }}}/>
>>> <$action-createtiddler $basetitle={{{ [split[/]last[]] 
>>> }}} $template=<>/>
>>> <$action-deletetiddler $tiddler=<>/>
>>> \end
>>>
>>> <$droppable actions=<>>
>>> 
>>> Drop image here
>>> 
>>> 
>>> ```
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/34acf26b-6230-47ed-9b7b-d5678010db4bn%40googlegroups.com.


[tw5] Re: TiddlyWiki: Drag and drop image link to create tiddler with _canonical_uri link to the image

2023-04-04 Thread Donald Coates
You have to have some sort of server running to upload files.  When you 
drag an image into a single file wiki it is not uploading it, it is 
converting it to binary(?), not actually uploading the image.  The nodejs 
version is running on server software that can upload files.  I use 
filestash via docker for a very lightweight server to upload images that I 
then use this code to create link to by dragging the link.  It is such a 
time saver.

On Monday, April 3, 2023 at 9:19:52 PM UTC-4 Zaphod Beeblebrox wrote:

> Looks great! :)
>
> Now... Work your sorcery and create a version to do the same thing, only 
> with locally-stored images!
>
> On Sunday, April 2, 2023 at 7:36:10 PM UTC-4 Charlie Veniot wrote:
>
>> Related TW script *in this post*, just below the video.
>>
>> https://youtu.be/NjE0MHsndE8
>>
>> ```
>> \define droppable-image-actions()
>> <$action-setfield $tiddler=<> $field="text" $value=""/>
>> <$action-setfield $tiddler=<> $field="_canonical_uri" 
>> $value={{{ [split[/]last[]addprefix[./Graphics%20Samples/]] 
>> }}}/>
>> <$action-setfield $tiddler=<> $field="type" $value={{{ 
>> [split[/]last[]split[.]last[]addprefix[image/]] }}}/>
>> <$action-createtiddler $basetitle={{{ [split[/]last[]] }}} 
>> $template=<>/>
>> <$action-deletetiddler $tiddler=<>/>
>> \end
>>
>> <$droppable actions=<>>
>> 
>> Drop image here
>> 
>> 
>> ```
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/169a0f0a-9229-4e31-b05a-96d4ad53cc32n%40googlegroups.com.


[tw5] Re: TiddlyWiki: Drag and drop image link to create tiddler with _canonical_uri link to the image

2023-04-03 Thread Charlie Veniot
Actually, it works A-1.

However, do not drag a local file.

Instead, view the local directory that has the files via your web browser.  
Then drag an image file's link to the droppable zone.

The droppable zone will handle links to files, but not actual files.


On Monday, April 3, 2023 at 10:19:52 PM UTC-3 Zaphod Beeblebrox wrote:

> Looks great! :)
>
> Now... Work your sorcery and create a version to do the same thing, only 
> with locally-stored images!
>
> On Sunday, April 2, 2023 at 7:36:10 PM UTC-4 Charlie Veniot wrote:
>
>> Related TW script *in this post*, just below the video.
>>
>> https://youtu.be/NjE0MHsndE8
>>
>> ```
>> \define droppable-image-actions()
>> <$action-setfield $tiddler=<> $field="text" $value=""/>
>> <$action-setfield $tiddler=<> $field="_canonical_uri" 
>> $value={{{ [split[/]last[]addprefix[./Graphics%20Samples/]] 
>> }}}/>
>> <$action-setfield $tiddler=<> $field="type" $value={{{ 
>> [split[/]last[]split[.]last[]addprefix[image/]] }}}/>
>> <$action-createtiddler $basetitle={{{ [split[/]last[]] }}} 
>> $template=<>/>
>> <$action-deletetiddler $tiddler=<>/>
>> \end
>>
>> <$droppable actions=<>>
>> 
>> Drop image here
>> 
>> 
>> ```
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a96b0748-bdc9-4ebf-92cb-243f8ea98fc3n%40googlegroups.com.


[tw5] Re: TiddlyWiki: Drag and drop image link to create tiddler with _canonical_uri link to the image

2023-04-03 Thread Zaphod Beeblebrox
Looks great! :)

Now... Work your sorcery and create a version to do the same thing, only 
with locally-stored images!

On Sunday, April 2, 2023 at 7:36:10 PM UTC-4 Charlie Veniot wrote:

> Related TW script *in this post*, just below the video.
>
> https://youtu.be/NjE0MHsndE8
>
> ```
> \define droppable-image-actions()
> <$action-setfield $tiddler=<> $field="text" $value=""/>
> <$action-setfield $tiddler=<> $field="_canonical_uri" 
> $value={{{ [split[/]last[]addprefix[./Graphics%20Samples/]] 
> }}}/>
> <$action-setfield $tiddler=<> $field="type" $value={{{ 
> [split[/]last[]split[.]last[]addprefix[image/]] }}}/>
> <$action-createtiddler $basetitle={{{ [split[/]last[]] }}} 
> $template=<>/>
> <$action-deletetiddler $tiddler=<>/>
> \end
>
> <$droppable actions=<>>
> 
> Drop image here
> 
> 
> ```
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7d7174c5-75e3-4ad3-bbdc-197e7983eb47n%40googlegroups.com.