Christian Heilmann

You are currently browsing the archives for the General category.

Archive for the ‘General’ Category

Why Homesite 5 still rocks my world

Tuesday, August 23rd, 2005

I have the fun job at the moment right now to turn a lot of word documents into HTML, as the client does not have a CMS or want one.
The Homesite keyboard shortcuts are a real treat there (ctrl+shift+p to turn the highlighted section into a paragraph), and the right-click “turn into unordered list” helps a lot, too.

However, what was missing was a keyboard shortcut to turn a line into a heading. What is cool about Homesite 5 though is that you cannot only write your own toolbars, menus and containers with something called VTML, which is much like XUL) but you also have an API to completely script the editor itself. So what I did is write a small headings.js file and attached it to the keyboard shortcut ctrl+2 (ctrl+1 already replaces all special characters with numbered entities – another script I did) via the Options -> Customise -> Script Shortcuts dialogue.
When I now write something like

1Welcome to the last day of your former life

and press ctrl+2 it turns it into

Welcome to the last day of your former life

the number defines the weight of the heading (1 to 6). The script is easy enough:

function Main()
{
var selectedString = '';
var weight=1;
// highlight the current line and store its content in s
Application.ActiveDocument.SelectCurrentLine();
s = Application.ActiveDocument.SelText;
// get the first character and add the tag brackets with that weight
// around the line
weight=s.substr(0,1);
var r='< h ' + weight + '>'+s.substr(1,s.length) +'< / h ' + weight + '>';
// replace the highlighted line with the new one
Application.ActiveDocument.SelText = r;
}
//Following is some textile bug: 

More Information about the API is available at The Macromedia Site.

Dynamic Galleries, real users and Popup Window conditioning

Friday, August 19th, 2005

I thought I had done well and created an easy to use, dynamic gallery with DOM and CSS. What it does is show pictures when you click them in the page instead of doing a reload. It also shows a “loading image” message. All feedback I got was positive and I was happy to have provided something slick and useful. Alas, I found out that it is not all like that. (more…)

CSS Hacks and Filters review

Tuesday, August 16th, 2005

Cover of CSS Hacks and Filters I hate using CSS hacks and filters. I strongly believe it is not my job to cover up the mistakes of browser vendors, and I hate relying on things I cannot test myself. As I also cannot be bothered to hunt the web for every new hack and workaround I considered buying this title to put it on my desk and get it over with. (more…)

Reading DHTML Utopia

Tuesday, August 9th, 2005

DHTML Utopia coverI ordered it even before it came out, but as I just got stuck in writing a part of my own chapter in an upcoming book, I finally opened Stuart Langridges DHTML Utopia: Modern Web Design Using JavaScript & DOM published by Sitepoint. (more…)

Your part of the playground – what can be done with the different web technologies

Thursday, August 4th, 2005

Toy truck in the sandA lot of email noise is being created on mailing lists and forums plainly because new developers are not sure about where what web technology ends and where the other begins. “Can I style the Icon of the page via CSS?”, “How do I send a form via HTML” or “Can I check in JavaScript if a folder has network sharing enabled” are just some recent examples. (more…)