Anyone good with bookmarklets? QUick config of tiddlywikis

420 views
Skip to first unread message

TonyM

unread,
Nov 11, 2019, 1:27:49 AM11/11/19
to TiddlyWiki
Folks,

I have a nice little JSON of settings to drop on a tiddlywiki to see things how I like it. Drop the attached json on tiddlywiki.com or an empty.html to see.

I did a little research such as here and is seems plausible that we could make a bookmarklet that would allow me to drop a specified json file onto a tiddlywiki from the bookmarks I would not even need to go looking for my json file to drag and drop it, just select from the bookmarks. If we can point to json files on our local disk or on a server such as provided by TiddlyServer it would be an easy way to distribute tools, tiddlers, data, plugins and macros to one or more wikis.

I use FireFox and Windows 10 but unfortunately do not know yet how to write bookmarklets so thought I would put it out there.

The Next release of Tiddlywiki will reduce the need to save and reload some plugins as well, so in combination with such a bookmarklet effort it may be quite easy to make any readonly wiki open with your prefered settings.

Thanks and regards in advance if you can help.

Tony
Quick-config.json

A Gloom

unread,
Nov 11, 2019, 3:50:09 AM11/11/19
to TiddlyWiki
can't help you but I'll be delving into this-- I use quite a bit of external content (svg & x3d) so this may be helpful

Ton Gerner

unread,
Nov 11, 2019, 4:23:30 AM11/11/19
to TiddlyWiki
Hi Tony,

A long time ago - before the editor toolbar was introduced - I used a lot of bookmarklets and made a guide for making them (thanks to Stephan Hadrek).


Hope that helps.

Cheers,

Ton

TonyM

unread,
Nov 11, 2019, 5:20:25 AM11/11/19
to TiddlyWiki
Ton

Thanks. Yes I remember this work. Do you think it could point to a file or contain a payload to drop on a wiki?

I will look more closely but I need to depend on the templates. Good start though

Thanks
Tony

Ton Gerner

unread,
Nov 11, 2019, 5:36:49 AM11/11/19
to TiddlyWiki
Hi Tony,


Thanks. Yes I remember this work. Do you think it could point to a file or contain a payload to drop on a wiki?

I will look more closely but I need to depend on the templates. Good start though


I really don't know.  My knowledge of Javascript is almost nihil. I just used Stephan Hadrek's idea, see https://groups.google.com/forum/#!msg/tiddlywiki/cUUXichiwdU/8gTL3lsO0MUJ

Cheers,

Ton

Jeremy Ruston

unread,
Nov 11, 2019, 6:46:45 AM11/11/19
to tiddl...@googlegroups.com
> I did a little research such as here and is seems plausible that we could make a bookmarklet that would allow me to drop a specified json file onto a tiddlywiki from the bookmarks I would not even need to go looking for my json file to drag and drop it, just select from the bookmarks. If we can point to json files on our local disk or on a server such as provided by TiddlyServer it would be an easy way to distribute tools, tiddlers, data, plugins and macros to one or more wikis.

A JavaScript bookmarklet cannot in general read files from the local disk. I’ve knocked up a macro that does the next best thing: it can generate bookmarklets containing an arbitrary set of tiddlers identified by a filter.

This example generates a bookmarklet labelled “MyTiddlers” containing all the tiddlers with the tag “HelloThere”:

<<save-as-bookmarklet "MyTiddlers" "[tag[HelloThere]]">>

Drag the bookmarklet link to the browser address bar to install it, and then visit another TiddlyWiki. Clicking the bookmarklet will inject the payload tiddlers into the target wiki.

The text of the macro:

\define save-as-bookmarklet-href()
(function() {
$tw.wiki.addTiddlers($(json-tiddlers)$);
})()
\end

\define save-as-bookmarklet(title,filter)
<$wikify name="json-tiddlers" output="text" text="""<$text text=<<jsontiddlers filter:"$filter$">>/>""">
<a href={{{ [<save-as-bookmarklet-href>encodeuricomponent[]addprefix[javascript:]] }}}><$text text=<<__title__>>/></a>
</$wikify>
\end

Let me know how you get on,

Best wishes

Jeremy


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ee45dc80-e025-48f5-ac12-bbdc45ef5cb5%40googlegroups.com.

@TiddlyTweeter

unread,
Nov 11, 2019, 1:47:20 PM11/11/19
to tiddl...@googlegroups.com
Ciao Jeremy & others

Very nice on Firefox latest! Useful!

On both Chrome & Edge (Chromium Dev version) it failed. 
I think its being blocked on those? Maybe a setting could change that behaviour? 
If I confirm its that (rather than find its just my specific setup) I'll report back.

UPDATE: Got it working in Chrome. The issue for me was an extension blocking it.
                Edge (Chromium Dev version) also worked after I changed a JS setting.
                Edge (standard I can't get to work with it--no big deal) 

Best
TT

On Monday, 11 November 2019 12:46:45 UTC+1, Jeremy Ruston wrote

@TiddlyTweeter

unread,
Nov 11, 2019, 2:27:39 PM11/11/19
to TiddlyWiki
UPDATE: for those on email:

@TiddlyTweeter wrote:
On both Chrome & Edge (Chromium Dev version) it failed. 

TonyM

unread,
Nov 12, 2019, 6:22:26 PM11/12/19
to tiddl...@googlegroups.com
Jeremy,

It works so well and without interaction beyond a click I thought it was not working for a moment. Thanks a lot. This is a really productive method.

I used my Quick-config.json in the original post and it works like a dream to reconfigure tiddlywiki.com to be more usable with close all, more page control and other preferences.

There are various ways to build the set of tiddlers to include as the payload from monitor and capture changes, using existing json files and more. 
  • It is of course possible to have two bookmarklets one which sets a number of tiddlers and one which resets the same tiddlers. 
  • I will have to find a way to encode both in set and reset in fixed json files and bookmarklets so I can distribute them in the wiki on which they operate.
  • With a little further crafting it could be an easy way of copy and paste (multiple times) sets of tiddlers. 
Thanks for your help Jeremy
Tony


On Monday, November 11, 2019 at 10:46:45 PM UTC+11, Jeremy Ruston wrote:
> I did a little research such as here and is seems plausible that we could make a bookmarklet that would allow me to drop a specified json file onto a tiddlywiki from the bookmarks I would not even need to go looking for my json file to drag and drop it, just select from the bookmarks. If we can point to json files on our local disk or on a server such as provided by TiddlyServer it would be an easy way to distribute tools, tiddlers, data, plugins and macros to one or more wikis.

A JavaScript bookmarklet cannot in general read files from the local disk. I’ve knocked up a macro that does the next best thing: it can generate bookmarklets containing an arbitrary set of tiddlers identified by a filter.

This example generates a bookmarklet labelled “MyTiddlers” containing all the tiddlers with the tag “HelloThere”:

<<save-as-bookmarklet "MyTiddlers" "[tag[HelloThere]]">>

Drag the bookmarklet link to the browser address bar to install it, and then visit another TiddlyWiki. Clicking the bookmarklet will inject the payload tiddlers into the target wiki.

The text of the macro:

\define save-as-bookmarklet-href()
(function() {
$tw.wiki.addTiddlers($(json-tiddlers)$);
})()
\end

\define save-as-bookmarklet(title,filter)
<$wikify name="json-tiddlers" output="text" text="""<$text text=<<jsontiddlers filter:"$filter$">>/>""">
<a href={{{ [<save-as-bookmarklet-href>encodeuricomponent[]addprefix[javascript:]] }}}><$text text=<<__title__>>/></a>
</$wikify>
\end

Let me know how you get on,

Best wishes

Jeremy
On 11 Nov 2019, at 10:36, Ton Gerner <ton....@gmail.com> wrote:

Hi Tony,

Thanks. Yes I remember this work. Do you think it could point to a file or contain a payload to drop on a wiki?

I will look more closely but I need to depend on the templates. Good start though


I really don't know.  My knowledge of Javascript is almost nihil. I just used Stephan Hadrek's idea, see https://groups.google.com/forum/#!msg/tiddlywiki/cUUXichiwdU/8gTL3lsO0MUJ

Cheers,

Ton


--
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 tiddl...@googlegroups.com.

TonyM

unread,
Nov 13, 2019, 5:00:50 PM11/13/19
to TiddlyWiki
Jeremy et al,
 
As you say;

A JavaScript bookmarklet cannot in general read files from the local disk.

However node and TiddlyServer as an example can host files at local urls and I found the following that I am not sufficiently skilled to use
 

I wonder if it were possible to publish raw JSON or tid files via TiddlyServer or like static tiddlers that could then be dropped on a wiki from a bookmarklet. When I drop items found on file://C:/ or TiddlyServer browsing it only imports the link as an untitled tiddler which is good for importing URL's but not to import the content.

Continuing the conversation
Tony

TonyM

unread,
Jan 1, 2020, 11:03:12 PM1/1/20
to TiddlyWiki
Observations on Bookmarklets

I use my config bookmarklet daily now. I am working on a generic tool and a config management one that captures manually set configs and toggles.

In another area I am looking at bundles and plugins and realised the plugin build in the browser see tiddlywiki.com/dev uses the javaconsole and looks as if it could also be triggered by bookmarklet.

It seems to me automating the build of bookmarklets from tiddlywiki that can perform JavaScript functions on any wiki or further browser utilities is a whole new mechanisium even ecosystem tiddlywiki can also play in.

There are so many directions in which tiddlywiki can extend almost to infinity we have not yet explored yet.

Tony

TiddlyTweeter

unread,
Jan 2, 2020, 8:57:14 AM1/2/20
to TiddlyWiki
TonyM

Some comments.

I have become very aware that you are keen on leverage of (a) browsers and (b) Windows to better support working with TW.

These are things I am much in harmony with.

I tried a few times to document some parts of this I know about. It is not as easy as it first looks to derive something that is comprehensible if you not been through it.
Documentation is very time consuming & prone to error, so I tend to not publish it.  

The Bookmarklet by Jeremy is an elegant example of "just doing it" that is nicely contained.

I continue to work on Polly, which is basically using shell functions to provide a management interface to save, backup, clone, fetch, launch, order etc wikis.

BTW, Timimi (FF only) is interesting for single wiki in the way Bob is for file wike. It is quite easy in Timimi to launch scripts to do things. 
Closing the gap so you can do OS things via TW is real leverage

New year thoughts.
Best, Josiah  

Arlen Beiler

unread,
Jan 5, 2020, 7:26:47 AM1/5/20
to tiddl...@googlegroups.com
A link to a tiddler can be dragged into a different wiki, or dragged to the bookmarks bar then dragged into another wiki for import. Also the best way to load an external file would probably be to append a script tag with src to the body. Haven’t tested it but it should work.

--
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+...@googlegroups.com.

Mohammad

unread,
Jan 5, 2020, 10:32:01 AM1/5/20
to TiddlyWiki
Added to TW-Scripts

Wow!

 This is amazing Arlen!
 Why few people only know these useful tips and tricks :-)
 
Tiddlywiki is endless...

--Mohammad


On Sunday, January 5, 2020 at 3:56:47 PM UTC+3:30, Arlen Beiler wrote:
A link to a tiddler can be dragged into a different wiki, or dragged to the bookmarks bar then dragged into another wiki for import. Also the best way to load an external file would probably be to append a script tag with src to the body. Haven’t tested it but it should work.
On Thu, Jan 2, 2020 at 08:57 TiddlyTweeter <Tiddly...@assays.tv> wrote:
TonyM

Some comments.

I have become very aware that you are keen on leverage of (a) browsers and (b) Windows to better support working with TW.

These are things I am much in harmony with.

I tried a few times to document some parts of this I know about. It is not as easy as it first looks to derive something that is comprehensible if you not been through it.
Documentation is very time consuming & prone to error, so I tend to not publish it.  

The Bookmarklet by Jeremy is an elegant example of "just doing it" that is nicely contained.

I continue to work on Polly, which is basically using shell functions to provide a management interface to save, backup, clone, fetch, launch, order etc wikis.

BTW, Timimi (FF only) is interesting for single wiki in the way Bob is for file wike. It is quite easy in Timimi to launch scripts to do things. 
Closing the gap so you can do OS things via TW is real leverage

New year thoughts.
Best, Josiah  

--
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 tiddl...@googlegroups.com.

Mohammad

unread,
Jan 5, 2020, 10:37:28 AM1/5/20
to TiddlyWiki


On Monday, November 11, 2019 at 3:16:45 PM UTC+3:30, Jeremy Ruston wrote:
> I did a little research such as here and is seems plausible that we could make a bookmarklet that would allow me to drop a specified json file onto a tiddlywiki from the bookmarks I would not even need to go looking for my json file to drag and drop it, just select from the bookmarks. If we can point to json files on our local disk or on a server such as provided by TiddlyServer it would be an easy way to distribute tools, tiddlers, data, plugins and macros to one or more wikis.

A JavaScript bookmarklet cannot in general read files from the local disk. I’ve knocked up a macro that does the next best thing: it can generate bookmarklets containing an arbitrary set of tiddlers identified by a filter.

This example generates a bookmarklet labelled “MyTiddlers” containing all the tiddlers with the tag “HelloThere”:

<<save-as-bookmarklet "MyTiddlers" "[tag[HelloThere]]">>

Drag the bookmarklet link to the browser address bar to install it, and then visit another TiddlyWiki. Clicking the bookmarklet will inject the payload tiddlers into the target wiki.

The text of the macro:

\define save-as-bookmarklet-href()
(function() {
$tw.wiki.addTiddlers($(json-tiddlers)$);
})()
\end

\define save-as-bookmarklet(title,filter)
<$wikify name="json-tiddlers" output="text" text="""<$text text=<<jsontiddlers filter:"$filter$">>/>""">
<a href={{{ [<save-as-bookmarklet-href>encodeuricomponent[]addprefix[javascript:]] }}}><$text text=<<__title__>>/></a>
</$wikify>
\end

Let me know how you get on,

Best wishes

Jeremy
On 11 Nov 2019, at 10:36, Ton Gerner <ton....@gmail.com> wrote:

Hi Tony,

Thanks. Yes I remember this work. Do you think it could point to a file or contain a payload to drop on a wiki?

I will look more closely but I need to depend on the templates. Good start though


I really don't know.  My knowledge of Javascript is almost nihil. I just used Stephan Hadrek's idea, see https://groups.google.com/forum/#!msg/tiddlywiki/cUUXichiwdU/8gTL3lsO0MUJ

Cheers,

Ton


--
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 tiddl...@googlegroups.com.

TonyM

unread,
Jan 5, 2020, 6:04:23 PM1/5/20
to TiddlyWiki
Arlen,

Thanks, I had assumed only the link would be stored in the bookmarks when dragged to the bookmarks. 

If we had a new plugin to install in a number of wikis dropping it on the bookmarks and dragging and dropping to each target wiki is a nice workflow.

Regards
Tony


On Sunday, January 5, 2020 at 11:26:47 PM UTC+11, Arlen Beiler wrote:
A link to a tiddler can be dragged into a different wiki, or dragged to the bookmarks bar then dragged into another wiki for import. Also the best way to load an external file would probably be to append a script tag with src to the body. Haven’t tested it but it should work.
On Thu, Jan 2, 2020 at 08:57 TiddlyTweeter <Tiddly...@assays.tv> wrote:
TonyM

Some comments.

I have become very aware that you are keen on leverage of (a) browsers and (b) Windows to better support working with TW.

These are things I am much in harmony with.

I tried a few times to document some parts of this I know about. It is not as easy as it first looks to derive something that is comprehensible if you not been through it.
Documentation is very time consuming & prone to error, so I tend to not publish it.  

The Bookmarklet by Jeremy is an elegant example of "just doing it" that is nicely contained.

I continue to work on Polly, which is basically using shell functions to provide a management interface to save, backup, clone, fetch, launch, order etc wikis.

BTW, Timimi (FF only) is interesting for single wiki in the way Bob is for file wike. It is quite easy in Timimi to launch scripts to do things. 
Closing the gap so you can do OS things via TW is real leverage

New year thoughts.
Best, Josiah  

--
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 tiddl...@googlegroups.com.

Chuck R.

unread,
Jan 7, 2020, 11:52:48 AM1/7/20
to TiddlyWiki
Jeremy, that sounds great! If I create that bookmarklet for a TW5 on Tiddlyspot, can the user navigate or even see the other tiddlers in the TW5 file that are not part of the bookmarklet filter?
Reply all
Reply to author
Forward
0 new messages