Jim's Depository

this code is not yet written

I have abandoned CSS columns. They are an ongoing time sink. If you are willing to specify hard physical pixel widths for the columns they almost work like I want, but not quite. Their background colors end early, and when you get a wider than planned element inside one it spills out on to neighboring content instead of resizing.

Back to the grand one row table for me. The CSS zealots may scoff, but my columns work right all the time.

On the plus side, I may now be web 2.0. I added a couple rounded corners and a drop shadow. Unless you are using IE.

I went ahead and registered femtoblogger.com which reminds me how much easier it is for me to write code than prose. Filling a page is just painful. I’ll have to make filling in that outline be a long term project.

For now it serves as a placeholder for people that might guess at the URL and will send them back to this blog for femtoblogger news. I suppose I need to rename this blog now which means more code. Blast.

This is half baked, but I’m going to roll it out and try to live with it. Articles and comments will now use a WYSIWYG interface for styling. I hope to remove the How do I insert-a-link/bold/blockquote? type of questions that interrupt people’s thought process when posting in a new venue.

The downsides are many:

  • This uses the designMode and the execCommand() interface. execCommand() was probably designed by children and is functionally incomplete and inadequately specified. It promises to be a festering source of browser quirks and user bafflement for years to come.
  • The HTML sanitizer will need to normalize as well to unquirk the postings.
  • I need to also support a raw HTML mode for people with odd browsers.
  • I will need to make decisions about copying in images and possibly resizing.
  • I will probably need onscreen hinting ofsome sort to let people know how design mode works, e.g. They can drag in links and images.
  • I will probably screw up and butcher comments at least several times.

But… what would life be without a little excitement, so here we go.

Ok, comments seem to be at least minimally functional with the new editor code in Safari.
  1. Switch new post editing over to the new style.
  2. Make sure I didn't break Firefox.
  3. Patch things up so IE works.
  4. Make a safe fallback to HTML for browsers without designMode.

You can now put html into femtoblogger comments.

Ornamental Tags : b i em strong tt quote Structure Tags : br p pre blockquote div Linking : img a (but no funny URLs).

The downside is that I had to take out the “single newline to <br>“ translator and some bare punctuation is now illegal. I’m not sure this is a win, but I wanted to put in a hyperlink.

I think this paves the way for an even better solution which involves a Javascript WYSIWYG editor for posting. Something like TinyMCE but at less than 140k of Javascript and a 10 second startup time.

Comments and articles also get a preview button now so you can see what they will look like before you post them. Not too critical since you can edit them afterwards, but I suppose people are conditioned that think they can't edit comments.

48 hours in and I’ve crossed the 1000 line mark for combined HTML and PHP. I will soon need to add a ‘next page’ function to the front page as we go past the 10 article cutoff. I think I’ll take that opportunity to shrink the code somewhat.

I’m not happy with the

getting duplicated in all the primary files, but sometimes I want to tweak it and I’m not sure how to best do that. Maybe I can leave some expandable markers in the standard , and when the primary page calls the WriteHead() function it could pass in a dictionary of marker expansions.

Likewise the DIV structure to make the left and right columns on the pages is replicated in all the primary pages. I’d like to make that go away, but somehow the WritePageFront()…writemystuff…WritePageBack() does not appeal. I dislike having the front code and back code split apart like that. Pasting up the inside as a string is ugly. Passing in a function to write the middle might be the way to go. Perhaps as an entry in a dictionary like WriteHead(). It would be much nicer in a language with continuations.

I pulled the boilerplate html into a NormalPageTop() and NormalPageBottom() function. It looks gross, but it gets it all together in one spot. Each of these takes a dictionary argument to supply non-standard values for various pieces of the boilerplate.

This gets femtoblogger back to right at 1000 lines of code with the RSS feed added.

Update: and right back over 1000. I changed things around so clicking on an article title takes you to a page with just that article. There is now a little edit pencil on the articles to edit them, like on the comments.

I added comments to femtoblogger. Just in case someone wants to say something. You can comment anonymously, but you will have to pass the captcha. People logged in can comment freely. That isn’t too much of a hardship. You can create yourself an account if you would like.

This is an anonymous comment.
This comment is by jim, and has been edited.

I’m not releasing femtoblogger for a while. I am enjoying the luxury of changing things willy-nilly without worrying about converting deployed databases. I’m not even worrying about sometimes breaking the screens while I change code.

The road map looks thusly:

  • Develop in secret until the datastore schema seems relatively stable.
  • Move the svn library to googlecode and have a quiet release.
  • Maintain.

I added a browser type tally to the right hand column. I have very little idea why. It is another database query and update for each page load, but it doesn’t have significant impact on the performance. I’m still loading 280 front pages/second which is 5 times my available bandwidth. No worries yet.

I’m measuring my page load capacity with “openload”. There is a debian package and it is trivial to use. I like that in a tool. They can be found over at sourceforge, http://openwebload.sourceforge.net/

Because I used nanoblogger, but found it too large and complicated and there was already a reference to picoblogger in google.

When I write a new improved version in a new improved language I will call it attoblogger or perhaps zeptoblogger. Ain’t wikipedia grand?

I wonder if people will think femtoblogger has something to do with women?

Femtoblogger is my (Jim Studt) miniature blogging tool. I suppose there are reasons why I wrote it…

  • I wanted something with which to write notes to myself and the googlebots.
  • I loathe giant, complicated software packages written by the sort of people that use PHP or perl. They are a problem waiting to happen and a nuisance to manage.
  • As I think about better ways to approach web development I thought it would be nice to have a dataset collected and a ‘standard’ solution to compare it against.

It is day one of turning on femtoblogger. It supports searching, user accounts, access control, categories with filtering, and article editing. Things it will likely gain are:

  • ✓ Some sort of HTML in the articles.
  • ✓ Hypertext links would be nice. This is the web after all and the googlebot won’t like me if I don’t link.
  • I think I’d like to make a way to embed images in the articles. Maybe.
  • Some sort of invitation only policy for creating accounts. For now I rely on obscurity and will simply delete any idiots that show up.
  • Some sort of TODO or “Look at later” type list would be nice.
  • ✓ An RSS feed so I can notify myself when I have written something?
  • ✓ Comments, right, it should have comments.
more articles