Luke,on the topic of  News
03.31.2009   |   0comment

Yea I know, that’s a long chunk of capital letters in the title. It stands for Intermountain West Nursing Staff Development Organization. They are a group of nurses that needed to be able to post news and events on their site. They host educational events for developing a well trained staff of nurses. They had a small site but it was still very fun to code. Let us know what you think.

Screenshot of the IMWNSDO website

Screenshot of the IMWNSDO website


Benjam,on the topic of  JavaScript
03.25.2009   |   0comment

Before we start this discussion, I’d like to point out that while dynamically inserting JavaScript and CSS can easily be done with PHP, or your server-side scripting language of choice, those solutions don’t apply to static HTML pages (what? static pages? what are those?), and I came across a situation where I needed a non-PHP solution.

On my personal website, I have a single static page, my home page. This page does nothing but provide links to the rest of my site, and as such, it does not need to be PHP driven with all the bells and whistles that go with it. Just some clean code, and some clean CSS to make it pretty. Recently I found a small JavaScript snippet that I wanted on my home page, so I added it, and it looked good. The trouble is that it’s a seasonal script, and it makes no sense to leave it on all year. So instead of editing my page twice a year to add and remove this script, I figured I could go one better and dynamically add the script to my page via JavaScript. After a quick search I found Dynamically Loading External JavaScript Files which has a couple of methods listed to do this. After looking them over, I decided the DHTML method would suit my needs better.

Here is that method:

function load_script(url) {
   var e = document.createElement("script");
   e.src = url;
   e.type = "text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}

continue reading Dynamically inserting JavaScript and CSS with JavaScript”


Mac,on the topic of  PHP, Tools
03.25.2009   |   1comment

In a long-awaited promotion from the “public beta” status it has enjoyed for the last 18 months, the new Gradefix.com is finally live. Many hands have played a role in getting this to where it stands today, not the least of which is Luke Larsen, who did the design built the HTML/CSS for the new site. But the face isn’t all that’s new – the back end has been overhauled with new and improved algorithms and features that our users have been asking for. Some of them were so anxious that they switched all their Gradefix use to the beta server to start enjoying the new features now. (There’s also another good reason to revisit the site: there are actually 6 different design themes that you’ll see as you visit the site. The cookie that sticks you to a single theme for your visit is valid for an hour, so either wait and come back, or delete the cookie to see the other themes.)

Screenshot of the Blue theme of the new and improved Gradefix.com

Screenshot of the Blue theme of the new and improved Gradefix.com

Gradefix is one example of a project that we at Code Greene conceived, planned, designed, and built for ourselves. After building enough sites for other people that make them a bundle of money, you eventually decide to make one yourself, and that’s part of how Gradefix came about. Our CEO, Mark Polson, had the dream of what Gradefix could be back in about 2003 or 2004, and we partnered up and started building it in 2005. It launched to the public in 2006, after 2 full rounds of reworking and rebuilding, and has had a few major updates to the internals in the first few years. This is not only a major improvement to the algorithm in response to user feedback, but also a dramatically improved look and feel based on the response our target audience has had to the site. It was hard at first to get used to the idea of letting go of the old look, but I’ve grown attached to the new one now, and I think it is a lot more trendy and up-to-date and will succeed a lot better with our user base, which is primarily college and high school students.

We’re always looking for feedback on Gradefix, so let us know what you think or how you think we could improve it. Feel free to blog your own reviews, or if you’re interested in an interview etc. for your own blog, let us know and we’d be happy to talk to you about it.


Benjam,on the topic of  jQuery
03.23.2009   |   5comment

A colleague of mine (Tim) introduced me to a jQuery plugin that I had not heard of before. The plugin is called cssWithVars. This plugin makes use of some JavaScript and jQuery magic to bring variables and reuse to the CSS world. I recently looked through the example given with the download, played around with it, took a look at the backend magic, and here is what I thought about it.

While the background magic is actually pretty simple (look for any properties using a variable, which are wrapped in [ ], and if found, look for the related selector, and insert the properties defined in that selector into the variable instance), the implications are great. What this means is that you can create various pieces of style that can be reused anywhere and when it comes time to edit those styles, you simply edit the one instance and they all work. Here is an example style sheet:

text_box { /* this becomes a variable */
	width: 100px;
	height: 100px;
}

notice { /* this becomes a variable */
	color: #F00;
	font-weight: bold;
}

p {
	[text_box] /* a variable in use */
}

h2 {
	[notice] /* another variable in use */
}

h3 {
	[h2] /* normal selectors can be variables as well */
	font-size: smaller;
}

p.alert {
	[text_box]
	[notice]
	/* normal properties can be used as well */
	border: 2px solid #000;
}

As you can surmise, changing the details of the [notice] variable (or any of the other variables) would be extremely easy. Simply change the color, or font-weight, in the selector where it gets defined and it propagates through to all the other instances. This, to me, is what got me intrigued by this plugin. It has far reaching implications, and can be a very powerful thing. But as with all great power comes great responsibility (and confusion.) With this, it becomes increasingly difficult to say what properties are applied to what selector, or even where they come from. Say for instance I have a variable that sets a border style and I use it in a property that also sets a border style, which one gets used? I would imagine the one that is set explicitly in that selector gets used, but then what if I am using two variable styles that both try to apply conflicting styles, one floated left, and the other floated right… what then? Which one is the intended style?

This could get ugly.

One more thing that you may or may not have thought of… What if JavaScript is turned off?

This little question is a deal breaker for me on this plugin. Not only is it a deal breaker, but it completely turns the tables on my recommendation of this plugin. Not only is the CSS completely invalid, but in the (not so) rare case that the user has JavaScript turned off, they are going to see, in the best case scenario, a completely unstyled page, and in the worst case scenario, a page that looks like it was rendered with IE (yes, that’s bad.)

It is for this reason that I recommend that, while this plugin has it’s intriguing ideas, and is certainly fun to play with, should not be used in a production environment, because it has a poor execution (through no fault of the developer, but due to the possibility of broken pages due to invalid CSS and disabled JavaScript.) But CSS spec writers take notice, this would be a great and powerful addition to CSS. But it would take a lot of thought to get some of the caveats I’ve mentioned here (and more that I didn’t) working together as the designer intended.


Luke,on the topic of  Browsers
03.18.2009   |   3comment

On the train ride home Friday Kevin Carter and I were talking and complaining about good ol Microsoft. We talked how it would be great if Microsoft just quit making a browser. The next day he sent me this article. I was pretty surprised that what we were talking about on the train might become partly true. Infoworld mentions that it is quite possible that IE8 will be the last IE. That doesn’t mean that Microsoft will quit making a browser. They will just create a new browser not running on the IE engine. That would be awesome to not have the IE engine around anymore. Anyways check out the article for yourself and let us know what you think.


Luke,on the topic of  Coding Music
03.12.2009   |   8comment

Coding always goes much better and smoother with a good environment to code in. I think that a good part of creating that environment is music. Mike and I always think it is fun to crank up the Mortal Combat theme song when working on squashing an IE6 bug. Gets you all charged up to take it down! Anyways, we will start posting an album now and again of music we like to play when coding. If you have any you like please feel free to comment.

ratatatThe first album is a favorite of mine. It is by Ratatat and the album is called Classics. I highly recommend it. If you get it make sure you listen for the wildcat growl.


Master Sensei,on the topic of  Usability
03.01.2009   |   13comment

When I first started dabbling with HTML, it was from within the Notepad program on Windows 98. The font used was the one and only fixedsys, which happens to be the oldest font on Windows, dating all the way back to version 1.0.

fixedsys

Digital typography has come a long way in the last decade, and a wide array of monospaced beauties are now available for our coding pleasure. But what’s the best font choice when it comes to code? What about size? What about color? I think a lot of these decisions come down to personal preference, but one thing’s for sure, when you’re staring at a screen for hours on end, readability is paramount.

continue reading What’s the best coding font?”