Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Sat, 14 Jan 2017

Check out the Categories feature in the right column

I originally coded the categories listing as part of the overall Counter addin to Ode early last year, and Ode project leader Rob Reed lent his expertise to the addin, optimizing the code and squashing a few bugs in the process.

I had the categories listing in my right-hand column for a while, but since this Ode site has a LOT of directories/folders in it, that display made the right side of the page super long.

So I wanted the ability for readers to show/hide that listing. I didn't want to use jQuery, but I was very open to using vanilla JavaScript to make it happen.

And so I did. I looked at a lot of tutorials on how to hide the content of HTML divs (i.e. the stuff between a <div> and a </div>), and this one struck me as both simple and effective (meaning it's short and it works).

So now you can click Show / hide categories on the right to see the entire structure of the documents directory and drill down into topics that may be of interest.

Rob did a lot of work on my code, and I looked back at our e-mail thread from March 2016 and realized that I'm not even running the most recent version of the Counter addin on this site. Once I get that up and running, I will work on expanding the documentation on how to use the addin and then make it available to all.

Thanks go to Will Master for the JavaScript and Rob Reed for the Perl.

Once I figured out the concept of an addin (or, at any rate, my addin), I was off to the races. It was basically, "figure out what you want to display, figure out how to pull the information using Perl and the Ode addin structure, then drop tags into my Ode template to display the information."

Of course you can also say, "Here are things I can do in Perl, maybe it will be cool to put that on the web site." I guess I did a little of that, too.

However you slice it up, writing code and seeing results on a live web site is fun. In the Ode world, you can do that with HTML and CSS just like with any web site, and you can also write Perl addins. With this most recent hack (the show/hide), it was a matter of "appropriating" some vanilla JavaScript to add a feature I've been wanting for some time.