Insertion of External JS into the Sidebar

57 views
Skip to first unread message

Spooky Noodle

unread,
Oct 17, 2019, 3:53:05 PM10/17/19
to TiddlyWiki
I have something of a love-hate relationship with the TiddlyWiki sidebar. I love being able to customize what buttons are available, what's in the tabs, and so on. 

But the large margins can pose problems, and while it's easy to add something to the sidebar, it still takes a few seconds, which can be inconvenient when you're trying to navigate between having various elements locked on the side of the story river. 

As I mentioned in my other thread, I'm in the process of organizing my Dungeons and Dragons campaign notes, and one of the ways that I tend to think most intuitively is by visuals, by maps in particular. I've already found ways to import images into my TW, and to post image tiddles into the sidebar, but the problem is, the sidebar is often small, and while I can obviously go into the layout and resize it, doing so repeatedly is a little tedious. I'd have to increase the sidebar, look at the map, then decrease the sidebar so I can look at my notes. 

As mentioned in that same thread, I've been trying to find some way to merge the multi-page functionality of standard CSS with the 'bite size' pieces from TiddlyWiki. If I were to go that route, there are obviously numerous plugins to zoom in and pan around an image file, such as ImageViewer. However, what I'd love most of all is to have the 'map' widget (which is what I would be using these plugins for) to take up roughly half the screen, then have the river take up the other half. I've tried using the map in the sidebar, but the problem is, the sidebar wants to contain a lot: 

TW title, all of the various tabs like for recent pages, and the contents of those tabs, not to mention the margins for each of those elements. I wish I could make a secondary sidebar, with *just* the map. Then I could minimize the true sidebar, just use the 'map sidebar', until I need to close a bunch of pages, or make a new tiddle, etc. 

The ideal scenario is to have multiple different pages (as discussed in the above-linked thread), then each page as a 'map module' either separate from the sidebar or unique to the sidebar for that page. It doesn't scroll or resize itself alongside the story, it does its own javascript stuff. 

So, is it possible to somehow insert external javascript applications (such as the ImageViewer plugin) into a tiddle in the sidebar? 

PMario

unread,
Oct 18, 2019, 7:09:35 AM10/18/19
to TiddlyWiki
Hi,

If your sidebar tiddler shows the "Map" tab, or the tiddler is open in the story river, the sidebar width temporarily changes.

tiddler: temporary-modify-sidebar-width
tag:  $:/tags/SideBar
caption: Map

<style>
.tc-sidebar-scrollable { width: 450px; }
.tc-story-river { margin-right: 450px; }
</style>

See the attachment!

have fun!
mario
temporary-modify-sidebar-width.json
Reply all
Reply to author
Forward
0 new messages