Request: Modified QuickEdit_image for weird situation

5 views
Skip to first unread message

Magpie

unread,
Jun 15, 2009, 3:26:39 PM6/15/09
to TiddlyWikiDev
The basic gist of the problem is that QuickEdit_image (from the
QuickEdit package from TiddlyTools.com) inserts images using the
location on my computer, for example, "Z:/Images/graphics/three.jpg"
when i'd really like it to insert images using the location online,
like this: "http://www.MyURL.com/Images/graphics/three.jpg"

I would really appreciate any assistance in modifying this plugin!

Just in case you are curious about the horribly innefficient way I'm
trying to have the people who own the website insert images, check
this out: http://www.restorativeyouthjustice.org/#[[Basics%20-%20How%20to%20upload%20AND%20insert%20an%20image]]

Note: I'm using NetDrive, so anything on Z: is automatically uploaded
to http://www.restorativeyouthjustice.org

Thanks!

Eric Shulman

unread,
Jun 15, 2009, 4:51:01 PM6/15/09
to TiddlyWikiDev
> The basic gist of the problem is that QuickEdit_image (from the
> QuickEdit package from TiddlyTools.com) inserts images using the
> location on my computer, for example, "Z:/Images/graphics/three.jpg"
> when i'd really like it to insert images using the location online,
> like this: "http://www.MyURL.com/Images/graphics/three.jpg"

Rather than using an absolute URL, you should consider using a
*relative* reference that doesn't start with either file:// or http://
protocol, like this:
[img[alt text|Images/graphics/three.jpg]]

When viewed locally (via file:), this image reference will be to Z:/
Images/... (i.e., relative to the local location of the TW document).
In constrast, when viewed remotedly (via http:), the image will point
to http://www.MyURL.com/Images/... (i.e., relative to the location of
the online TW document).

... and, to make it easy to enter a relative reference, I've updated
QuickEdit_image so that if the local file you select is in a sub-
directory relative to the current document, the leading "file:///Z:/"
will be *automatically* removed, producing the desired relative
reference.

Get the update here:
http://www.TiddlyTools.com/#QuickEdit_image

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

chris...@gmail.com

unread,
Jun 15, 2009, 5:00:16 PM6/15/09
to TiddlyWikiDev
On Jun 15, 9:51 pm, Eric Shulman <elsdes...@gmail.com> wrote:
> ... and, to make it easy to enter a relative reference, I've updated
> QuickEdit_image so that if the local file you select is in a sub-
> directory relative to the current document, the leading "file:///Z:/"
> will be *automatically* removed, producing the desired relative
> reference.

Because I'm not keen on magic, and this seems like magic, I'll
interrupt here to say:

While generally speaking I think relative URLs are the big win and
proper, I've found that in TiddlyWiki and TiddlyWeb situations I need
my URLs for things like images to be absolute to some root because the
tiddler which contains the URL may be displayed in tiddlywikis which
are in different contexts, different directories.

This is especially true in TiddlyWeb (where a tiddler might be display
in a tiddlywiki from a bag, from several different recipes or as HTML
directly from the web server) but has also been true in tiddlywikis
that I symlink around in various places.

Now back to the regularly scheduled thread.

Eric Shulman

unread,
Jun 15, 2009, 8:03:23 PM6/15/09
to TiddlyWikiDev
> While generally speaking I think relative URLs are the big win and
> proper, I've found that in TiddlyWiki and TiddlyWeb situations I need
> my URLs for things like images to be absolute to some root because the
> tiddler which contains the URL may be displayed in tiddlywikis which
> are in different contexts, different directories.

if the references are on the same domain, you can use a link that
starts from the $document_root (e.g., [img[/some/path/from/root/to/
image.jpg]), while still omitting the protocol and domain, so that
local vs. remote access is remains relative to the domain, but
absolute *within* that domain.

-e

Magpie

unread,
Jun 16, 2009, 11:48:33 AM6/16/09
to TiddlyWikiDev
Thanks for the fast reply!

I'll try that :D

Magpie

unread,
Jun 22, 2009, 4:29:56 PM6/22/09
to TiddlyWikiDev
It worked great :D

Thanks so much!
Reply all
Reply to author
Forward
0 new messages