Hi Mark Sorry, forgot to add that I was talking about dragging the links from a FF > tab being used as a local file browser. I believe (but could be mistaken) > that this circumnavigates the missing path information problem. >
Ah, OK, yes, in that case the browser exposes an URL link as text, and so we could do the global-to-local transformation etc. The trouble is that I'm not sure that it's worth it, given that it would only work with the Firefox file browser. I think it would be more useful to spend the effort on getting TiddlyFox/TiddlyClip to make it possible to drag files from the OS Finder/Explorer and get a relative link made automatically. > If the browser, under those situations, passes the link, doesn't it also > pass the extension? So the file type could be determined with 90% accuracy > based on the extension? > Yes, inferring the type from the extension for file: protocol links is probably reasonably safe. Best wishes Jeremy. > > Thanks, > Mark > > > > On Friday, November 7, 2014 8:07:01 AM UTC-8, Jeremy Ruston wrote: > >> Hi Mark >> >> To me, what would make sense is that when you drop an external local >>> image file (jpg,png,gif,,etc.) into TW it would create an image link to >>> that file, preferably with a relative address. I would not require TW to >>> verify that the contents of the file are really image data. >>> >> >> Sadly, as I mentioned further up in this thread, when you drag things >> into a browser we only get to see the embeddable data; for security >> reasons, the path to the item is not passed. That means it is currently not >> possible to drag and drop an image and have it show up as an external image. >> >> We can HTML drag links from other webpages into TiddlyWiki, but the >> browser doesn't tell us whether the target of the link is an image, sound >> file, HTML etc. >> >> >>> Dragging or dropping into an open tiddler would append the img or ext >>> link to the bottom (or to the cursor location if possible). >>> >> >> As mentioned above, dragging a link to the a tiddler text editor will >> insert the text of the link at the drop point. >> >> Best wishes >> >> Jeremy. >> >> >>> This way you could easily transport your TW and supporting files just >>> by copying, zipping, or synching a single directory. >>> >>> The ambiguous situation would be that of a text (.txt, ini ... other?) >>> file. I suppose some people might want the file to be imported into its own >>> tiddler since that is within TW's capabilities. A configuration might >>> allow the user to specify how he/she wants links to text to be handled >>> (embedded or linked). >>> >>> Thanks for listening! >>> Mark >>> >>> >>> >>> >>> >>> On Friday, November 7, 2014 12:55:33 AM UTC-8, Jeremy Ruston wrote: >>>> >>>> Hi Blake >>>> >>>> Sorry if I was unclear but I do not support the idea of importing files >>>>> directly into an html file such as TiddlyWiki since this will cause slow >>>>> down and a loss of file mobility. >>>>> >>>> >>>> Well, I think the ability to embed images etc is useful, but I agree >>>> that it is an ability that has to be exercised with caution. >>>> >>>> I don't quite understand why you think that embedding a file into TW >>>> causes a loss of mobility? I think that one of the advantages of embedding >>>> is that it makes it easier to move the TW file around, without worrying >>>> about dependent files. >>>> >>>> >>>>> My request for a link import was based on linking to relative files >>>>> and folders. >>>>> >>>>> One point to note is that you'll get different behaviour if you drag >>>>>> the link into the text editor within a tiddler you are editing ... We >>>>>> could >>>>>> indeed tweak it to be a relative link if possible. >>>>> >>>>> >>>>> I think this would vastly improve the process of including files in TW. >>>>> >>>> >>>> OK >>>> >>>> >>>>> By the way, when I drag a file into the text region of a Tiddler >>>>> during editing I get redirected by my browser to the file (using most >>>>> recent Chrome on Win 8) so I do not get the absolute link you mentioned. >>>>> >>>> >>>> Yes, dragging a file behaves differently. It's dragging a link from the >>>> browser into a text editor that has the behaviour I described. >>>> >>>> Best wishes >>>> >>>> Jeremy. >>>> >>>> >>>> >>>>> >>>>> -Blake >>>>> >>>>> >>>>> On Thu, Nov 6, 2014 at 4:46 PM, Jeremy Ruston <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi Blake >>>>>> >>>>>> One point to note is that you'll get different behaviour if you drag >>>>>> the link into the text editor within a tiddler you are editing. By >>>>>> default, >>>>>> you'll get the absolute link. We could indeed tweak it to be a relative >>>>>> link if possible. >>>>>> >>>>>> The behaviour I was thinking about in my answers above is when you >>>>>> drag the link into the rest of the TiddlyWiki window, which triggers the >>>>>> import mechanism. It's still unclear to me what we should do when we try >>>>>> to >>>>>> import a link. >>>>>> >>>>>> Best wishes >>>>>> >>>>>> Jeremy. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Nov 6, 2014 at 9:36 PM, Blake Blacksmith < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> We could indeed introduce special behaviour for dragging links; the >>>>>>>> browser identifies the text as a link when it is dropped. *The >>>>>>>> problem is that it's not clear what that behaviour should be; for image >>>>>>>> links*, ... >>>>>>>> >>>>>>>> >>>>>>> I do not think the job of a drag-and-drop file-link *inserter *should >>>>>>> include determining what type of data the file-link leads to. That >>>>>>> should >>>>>>> be up to the user to decide with [img[...]] or other user-defined file >>>>>>> handling macros. >>>>>>> >>>>>>> The most general & simple solution would be that the >>>>>>> drag-and-dropped function should: >>>>>>> >>>>>>> 1. grab the absolute-file-link string file >>>>>>> >>>>>>> - such as: *file:///d:/data/Proj/* >>>>>>> *PhotoScrapbook/origs/%7B040%7DIM-3837.jpg* >>>>>>> >>>>>>> >>>>>>> 2. check that the file is within the TiddlyWiki's folder >>>>>>> >>>>>>> - for example: *d:/data/Proj/**PhotoScrapbook/ * >>>>>>> >>>>>>> >>>>>>> 3. paste the appropriate link into a text box >>>>>>> >>>>>>> - if it is in under same folder as the TiddlyWiki then paste the >>>>>>> *relative >>>>>>> *file link text : *file:.//**origs/%7B040%*7DIM-3837.jpg >>>>>>> - and if the file is not under that folder assume the user wants >>>>>>> the file to be imported into the TiddlyWiki are raw text. >>>>>>> >>>>>>> >>>>>>> - could also have the option to paste the *absolute *path link text >>>>>>> : f*ile:///d:/data/Proj/*PhotoScrapbook/origs/%7B040%*7DIM-3837.jpg >>>>>>> *(although I am not sure under what scenario this would be >>>>>>> useful). >>>>>>> >>>>>>> How does that sound? Is that doable or does that violate some >>>>>>> browser security limitations? >>>>>>> >>>>>>> Blake >>>>>>> -- >>>>>>> >>>>>> -- >>> 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. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Jeremy Ruston >> mailto:[email protected] >> > -- > 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. > For more options, visit https://groups.google.com/d/optout. > -- Jeremy Ruston mailto:[email protected] -- 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. For more options, visit https://groups.google.com/d/optout.

