Feb 192009

Mindtouch has posted the second preview release of Deki Lyons.  I’ll be checking this out on my VM at home soon.  It sounds like this one supports upgrading an existing VM, so I’m going to look at possibly attempting to set it up as an MDC clone to start evaluating our skin on it.  Going to talk to our contacts at Mindtouch before I do that.

It does appear to address several of our concerns, which is good news.  I’ll blog my findings once I’ve tried it out.  Hopefully that will be done tomorrow.

Feeling a little funky today, so my productivity is a little low.  Fortunately, the last few days have been very productive ones, so I don’t feel too badly about that.

 Posted by at 3:29 PM
Feb 192009

As I look over my to-do lists for Firefox 3.1 documentation, I see no action items remaining.  That means we’ve reached that point I like to call “essentially complete.”

What that means, to me, is that as far as I can tell, we now have documentation for all of the new developer-facing topics in Firefox 3.1.

Now it’s up to you, my intrepid friends in Mozilladom, to tell me where our documentation has holes.  Please go through the content linked from the Firefox 3.1 for developers page and tell me where we have gaps, or if you find articles that seem particularly “stubby” to you.

There’s almost certainly still work to be done.  Just because everything is covered, doesn’t necessarily mean it’s covered as well as it needs to be.  But I’m awfully close to most of this material now, so I may or may not be able to see the flaws.  That’s where you come in.

Despite knowing that there’s almost certainly more to be done, this is always an exciting moment in the documentation work for any project.  Knowing that everything is covered — at least to some extent — is always a thrill.

 Posted by at 11:22 AM
Feb 172009

The last couple of days have been busy ones on the Firefox developer documentation front.  I’ve been making my way through the list of bugs marked dev-doc-needed, and more than half of them have now been addressed.  Some of these are Firefox 3.1 related, some of them are older.  A couple are even newer than Firefox 3.1!

Totally new articles include:

In addition, tons of articles have been updated, covering a broad array of topics.  There’s lots more to come, too.  Enjoy!

 Posted by at 5:18 PM
Feb 122009

Mozilla Labs unveiled Bespin tonight.  Bespin is a wicked cool project to create a web-based IDE for web development.  Not only does Bespin offer a sweet in-browser code editor with all the trimmings, but it provides real-time collaboration that’s got to be seen to be believed.

Check out the blog post announcing Bespin, then check out the demo video and then give it a spin for yourself!

I’m excited about Bespin in particular because the Mozilla Developer Center team is investigating ways to integrate MDC into Bespin to make it easy to look up anything you need to know about web development right in your IDE.

 Posted by at 11:03 PM
Feb 112009

I’ve just finished my initial pass at the article Locating DOM elements using selectors.  It provides a quick overview of what selectors are, as well as some simple examples, and refers the reader to the more specific documentation provided in the Gecko DOM Reference.

As always, please take a look and let me know — or correct it — if any errors or deficiencies are found.

With this, all major articles for Firefox 3.1’s documentation are complete.  From here on out, it’s all about touching up existing material to cover updated APIs and the like.

 Posted by at 3:08 PM
Feb 102009

I’ve written the article ICC color correction in Firefox.  I’d like opinions on this.  I’m not sure how much detail I should go into; most of the nitty-gritty details of color correction are, in my opinion, beyond the scope of MDC, which is why I instead link to the  ICC web site.

Please feel free to suggest additions or revisions, or to make them yourself if you see anything that needs to be done.

 Posted by at 4:51 PM
Feb 102009

It’s presently 5:22 AM and I’m finally about tired enough to sleep, I think.  Tried to a few hours ago, without luck.

Anyway, I made good use of the extra wakeful hours, since tomorrow will be largely absorbed by catch-up sleep:

I added two more examples into the article Applying SVG effects to HTML content and did some reorganization work there while I was at it.  Then I wrote the article ICC color correction in Firefox.

The only full-scale article left to write for Firefox 3.1, to my current knowledge, is Locating DOM elements using selectors.  This material is actually already documented in reference form, but a conceptual article needs to be written to cover the subject.

Fortunately, John Resig and others have already created blog posts about the subject, so the research has pretty much already been done.  I will be working on that article on Tuesday or Wednesday, depending on how my sleep situation goes for the next few hours.

As always, please feel free to let me know if you see any issues with the articles mentioned here, or, better, fix the problems right in the wiki.

 Posted by at 5:29 AM
Feb 062009

It occurs to me that the new IRC channel list feature we’ve added to MDC could serve as a sweet example of some of the nifty stuff we can do with Deki, so I thought I’d blog a bit about how it works.

There are a few components to this, some of which are hidden in the configuration of MDC.  Suffice it to say that the Suggestchannels template is automatically embedded into MDC wherever the suggestchannels CSS class is used — in particular, in the table of contents box along the right-hand side of the page.  The template accepts as input the ID of the page whose tags it needs to evaluate.

Feel free to take a look at the source for that page; the magic is done in the source, which uses DekiScript to build lists of tags that correspond to various IRC channels and then  conditionally insert list items based on which tags are assigned to the page.

Open up the source for the template and follow along while we study how the magic happens.

The entire template is a single div block that has two custom attributes used by Deki.  The first is the if attribute.  This attribute specifies a Boolean expression that must be true in order for the element to be rendered.  If the expression evaluates to false, the entire div block is dropped and doesn’t appear in the rendered document.

The second custom attribute is the init attribute.  This specifies DekiScript code that is run before evaluating the element.  In our case, we have a lengthy chunk of code that runs here.  It starts by fetching the Deki page object representing the page being rendered, then grabbing the list of tags associated with the page.

After that, lists are created representing the tags associated with each IRC channel supported by the template, followed by an all list that includes all the tags recognized by the template.

The final step in the initialization code is to walk through the list of tags associated with the article and see if any of them occur in the list of tags for which IRC channels are known.  If this happens, we know that the div block needs to render, and we set the value of the show variable to true.

The div block is stripped from the page if the show variable is false; this is how we suppress the display of the “Discuss in IRC” section if the article has no known appropriate channels.

We use a similar technique for each item in the list of channels; each channel item is only included in the list if the corresponding tag is found in the list of tags matching that channel.

Adding new tags to existing channels

We can easily route additional tags to IRC channels already recognized by this template by simply adding the tags to the appropriate lists.  For example, if the tag “foo” should route to the channel “xforms”, we would simply add “foo” to the line for the xforms list, like this:

var xforms = [ ‘xforms’, ‘foo’ ];

Adding new channels

Adding new channels is slightly more complicated, but not ridiculously so.  The first thing we have to do is add a new list for that tag.  For example:

var newchannel = [ ‘tag1’, ‘tag2’, ‘tag3’ ];

Then we add the new channel to the all list:

var all = extdev .. css .. addons .. js .. xul .. devmo .. jsapi .. xulrunner .. developers .. qa .. svg .. xforms.. canvas .. embedding .. places .. venkman .. newchannel;

Finally, we add a new list item for the new channel.  These are generally included in alphabetical order.

<li init=”var show = false; foreach(var tag in tags) if(list.contains(newchannel, string.tolower(tag.name))) let show=true;” if=”show”><a class=”external” href=”irc://irc.mozilla.org/newchannel”>#newchannel</a></li>

Once these changes are committed, the new channel will automatically show up on pages tagged “tag1”, “tag2”, or “tag3”.

The future

This is a good sign for the future; we can do some very nifty stuff with this.  If you haven’t done so already, check out my list of ideas for things we can do to make MDC even cooler in the future.

 Posted by at 4:37 PM
Feb 062009

I’ve updated the article Applying SVG effects to HTML content to actually have useful information, as well as an example.  More work is forthcoming, as examples of how to use external document references need to be added.

I’ve stricken the original plan to have a separate article on using external references for SVG effects; that doesn’t make a lot of sense in retrospect, so I’ll put that information in the same article.

The article Controlling DNS prefetching should be complete at this point, barring any errors that are pointed out to me by others.

As always, I eagerly await comments and corrections on these or any other content on MDC!

 Posted by at 3:27 PM