Current musing:

Using contenteditable to test css page layouts

This should be obvious, but I just realized that one could use the the HTML5 contenteditable feature to test page layouts. “Contenteditable” is a fancy little tag attribute that allows the user to edit the content contained in the element from the browser.

For example, Read more…

downloads

These guides are free, but if you have found them useful then please consider donating $2. Hey, that's less then the cup of coffee your drinking right?

subscriptions

« Blog home
Using contenteditable to test css page layouts

This should be obvious, but I just realized that one could use the the HTML5 contenteditable feature to test page layouts. “Contenteditable” is a fancy little tag attribute that allows the user to edit the content contained in the element from the browser.

For example, I have a three column page with a footer that spans the first two columns and places a large element in the third. I needed to be able to alter the lengths of the columns quickly to see how my footer would react and so, instead of flipping back and forth between the html code, I simply did this:


<div id="content" contenteditable="true"> ...
<div id="sidebar" contenteditable="true"> ...

Now I could load the page in Firefox, Chrome, Safari, and Opera and fiddle around with the lengths of the columns simply by adding or deleting dummy text out of the columns and watching the footer move. Cool!


Free, excellent, Optical Character Recognition (OCR)

Why have I not heard about this before!? Google docs now offers automatic Optical Character Recognition for images and pdfs when you upload them. Details at Google Doc’s help site.

As a teacher I’m constantly downloading pdfs and wishing that I could easily convert them to editable text. I just tried this feature on one of my many pdfs and it worked perfectly, it even retained most of the formatting. I’m not sure how it will work on less then perfect images or pdfs, even if it gets 60% of the text right that could be a huge help.


Lucid Outlining Application

I love to outline, but I hate all of the outlining applications I’ve used. I want a simple, open, and free outlining app that works the way I want it to work. So I decided to make my own.

Lucid Outlining Application is my first attempt at creating an outlining app that does only one thing well: make outlines.

It is completely browser based and freely available. It will work with any modern browser which supports HTML 5 and advanced CSS. Unfortunately this means that no version of Internet Explorer works, but all three of the major competitors: Firefox, Safari, and Chrome, work just fine. (Since all three of those are free and available in cross platform versions I do not feel too bad about the lack of support for IE).

Main features

  1. Convenient keyboard shortcuts for fast editing
  2. Supports rich text entries (uses browsers native “contenteditable” attribute)
  3. Saves all data to local hard drive using HTML5′s local storage
  4. Free!

Lucid Outlining Application


Blog theme under development

I recently redesigned my main website, and now I’m finally getting around to making my blog match. Some things may not work properly so please bear with me. Of course, you can also feel free to contact me with any thoughts or suggestions.


New website design

For the first time in almost 5 years I’ve redesigned my main website: www.lucidgreen.net. This is a complete redesign, including a total reworking of my content and it’s organization. All I can say is, “finally!”

My old website was okay, aside from being difficult to maintain, poorly worded, and in dire need of proof-reading, it got the job done. The new site is a lot more personal, far more user friendly, and dramatically simplified.

I hope to have my blog design updated shortly to match so that there is a true seamless integration. In the meantime, I’d love to hear any comments on the new design. Thanks!


Recent tool discoveries

Here is a very brief rundown of some of the new tools/tricks I’ve been using.

Komodo Edit. An open source code editor.
Wow, this thing rocks! So far I’ve only used it for HTML, CSS and Javascript editing, but I’m impressed. It’s free, cross-platform, has an impressive feature set, and is easy to use. FTP/SFTP is built right in, and it even highlights closing tags in HTML!

Superfish: a cross-browser drop-down menu builder.
After hating drop-down menus for nearly a decade, I’ve suddenly had a change of heart. When they work well, they’re great, they save space for the designer and time for the users, but when they don’t work well users and designers alike curse the internet gods. Superfish has played a key role in changing my mind. Of course, the process of getting a Superfish menu to work in every browser (ahem, IE6) is still a little bit finicky, but it’s nothing like what I’ve experienced in the past.

Jquery Cycle Plugin: a Jquery (javascript) slide show script with lots of features.
This is a pretty amazing little script, it takes a div tag full of images and instantly transforms them into a cool looking slideshow. There are an impressive number of features, and options, but I appreciate just how quickly I can create a fancy javascript only slideshow which degrades gracefully.

CSS – Clearing floats without extra markup: a trick I wished I had learned years ago.
This is an amazing trick, every web developer who has ever wanted his containing div to wrap fully below two nested and floated divs needs to read this now!


Snow Leopard: and late night upgrade experience

Just because I’m already tired of the “horror” stories from those who, like me, upgraded their macs to Snow Leopard last night. Here’s my experience.

11:44 am: Fedex attempts to deliver the package from Apple, but no one is home to sign for it, so they leave a nice note saying exactly when and where I can pick it up if I’m so inclined.

1:00 pm: Fedex gives me a courtesy call to tell me I missed my package. How thoughtful!

5:00 pm: I arrive at the Fedex shipping center. The friendly worker finds my package and says, “Have a great evening!”

5:30 pm: I arrive home and begin to prepare for dinner with friends. Installation must wait.

7:00 pm: Friends arrive for dinner. Installation still on hold.

11:00 pm: Friends leave, dishes started.

11:15 pm: Installation begins. Insert DVD, click OK a few times. Walk away to take a shower and brush teeth.

12:15 am: Installation complete. Computer runs flawlessly.

12:30 am: Still no problems, all my apps run nicely, new features are fun.

12:45 am: go to bed.

That’s it. I’m happy to report things are still running fine. If something blows up I promise let everyone know! (Not that you care, and if you do… find a hobby!)


fix for css 100% height producing scrollbars (not a hack)

UPDATE 5/30/2009: My original solution didn’t work as expected, but, as usual, someone else had already solved the problem. The solution code example below is modified from http://ryanfait.com/sticky-footer/.

Caveat, this fix has been tested in Firefox 3+, Safari 4beta, and IE8. It should work in other standards compliant browsers.

Assume for a moment you want the following simple page layout:

Header, height: 200px

Content, height: 100% of available space

Footer, height: 30px

You want the footer to always be at the bottom of the browser window, but also drop below the bottom of the browser window if the content extends below it.

You might be tempted to achieve this layout with the following code:

HTML
<div  id="header">Header</div>
<div  id="content">content</div>
<div  id="footer">footer</div>

CSS
html,body {height:100%} /* you need this to allow for 100% on any other elements */
#header {height:200px;}
#content {height:100%;}
#footer {height:30px;}

this works great if your content is longer than then the browser window is high, you footer will always be below your content, and you will have to scroll down to see it as you would expect. But what if your content is significantly shorter than the browser window is high?

If you try this you will quickly discover that no matter how small or large you make your browser window the footer will always be below the visible edge of the page and you will have to use the scrollbar to see it. The container div is not taking up 100% of the available height, but 100% of the window height. In other words, if your browser window is 800 px high then your container div will be 800px high, and then your 200px header and 30px footer will be added on to this making the entire page 1030 px high.

So how do you avoid this?

Fairly easily as it turns out. Do the following:

HTML
<div id="container">
<div  id="header">Header</div>
<div  id="content">content</div>
<div id="push"></div>
</div>
<div  id="footer">footer</div>

CSS
* {margin:0; padding:0;} /*required to remove default padding and margins */
html,body {height:100%} /* you need this to allow for 100% on any other elements */
#container {height:100%; margin-bottom:-30px; min-height: 100%; height: auto !important;}
#header {height:200px;}
#footer, #push {height:30px;} /*push must be exactly the same height as footer to prevent the footer from covering up or going under content when the window is smaller than the content*/


Full screen web browsing on a mac (for real!)

This has been something of a personal quest for the Holy Grail. I’ve wanted to have a full screen browser on my Mac for a very long time. I’ve searched for plugins, I’ve searched for special browsers, but no luck. Until today! And it has been hiding under my nose the whole time: Opera 9.6!

I’ve had Opera on my machine for a long time, pretty much only for testing purposes, but today, I upgraded it and decided to take it for a little spin, only to have the Holy Grail dropped in my lap!

Why would I want full screen web browsing on the Mac? For presentations, for kiosk displays (I’m going to be using this next week at a teacher recruitment gig), for distraction free google doc work, and just for the heck of it!

If you’ve been looking for a full screen web browser on the Mac, check out Opera, and comment on this post. I’d love to know I’m wasn’t alone in this search!


modx date picker template variable not working

This is probably an obscure problem, but if it happens to you it is incredibly annoying. Hopefully the next person who struggles with this will search and find this answer.

Here’s the problem: you have a date template variable available for your modx templates. It is named “event_date”. You have enabled the “date formatter” widget so that user can click a little button to have a date chooser to popup in the manager. But, when you click the button for the date chooser nothing happens.

Here’s the solution: remove the underscore (“_”) in your template variable name. That’s it. Apparently the modx parser converts the underscore to an url safe entity and that messes up the javascript required to launch the popup.

Of course you might also want to be certain that popups are allowed by your browser for this domain!