Organization and Chunking!

I have been working on the Theme Builder UI for a while now, and I have come across some typical problems when working with large-scale software: organizing the data into meaningful section, or “chunking” the data.

SSI

To overcome these problems, I have broken the toolbar sections into their own HTML pages, and used server side includes to piece them together. This will be replaced in the future with some PHP code. I originally chose SSIs, so anyone can add or remove sections by simply adding the appropriate SSI directive to the page.

Chunking

Since the toolbar sections are seperate pages, it allows me to test each page separately, and only one page at a time. Each HTML page has two sections: the javascript, and HTML display. This allows me to edit both the HTML and javascript without having to switch between two or more editors or editor tabs.

There is one main page, toolbar.html, which has the code for the main toolbar UI. The main object is called CMSThemeBuilder, which includes a few functions:

  • CMSThemeBuilder.dump([outputDIV]) – this function calls the dump() method in each object., optionally writing the output to the named div tag, outputDIV.
  • [window.]print() – this is a global method which prints to the FireBug console, if installed.
  • CMSThemeBuilder.register(StyleObj) – this function registers the given StyleObj with CMSThemeBuilder.
Advertisements