(WebDev)

A Diagnosis to Which I Relate (using a word I’ve never heard)

June 10, 2010 @ 12:35:45

From he who is famous for this (which I just rediscovered):

Ideation Limitation

I think coding a site to upload some photos, automate them into a simple slideshow is a no brainer. Your mom on the other hand thinks that’s about the most fan-futon-tastic thing ever. She and all the ladies in her card group use it religiously; sharing photos of their baby grandchildren drooling and gnawing on the dogs chew toys. Who knew.

Post Thumbnail

The ReadyAgain jQuery Plugin: Re-executing Ready

June 9, 2010 @ 16:21:50

I’ve been wanting to become better acquainted with the Mecurial revision control system (see Hg Init for more info). There’s also been a jQuery related issue I’ve been wanting to investigate. So I made the jump and

1. Created a plugin
2. Created a repository for that plugin at BitBucket

ReadyAgain at BitBucket

The ReadyAgain jQuery Plugin

Prior to version 1.4, the array of functions saved by jQuery for execution when the DOM is ready (i.e. those functions added by $(document).ready(function...)) was an accessible property of jQuery. This meant that you could reference the array directly using something like $.readyList. Now, however, that array has been hidden within an anonymous, self-executing function (the deepest, darkest well of data hiding in javascript, here’s a bit of a primer). So re-executing all of the ready functions by grabbing a copy of that array becomes impossible.

The ReadyAgain plugin is my attempt to solve that issue. The specifics can be seen by looking at the code, but the basic concept is to override jQuery.ready to intercept each function as its added, and to save it within our own internal array.

Public Code

So the initial commit of the code is there and I’ve typed up a page on the Wiki with some examples. I hope that people use it and maybe even contribute to it. It would certainly be something fun for me to be a part of and from which to learn.

↓↓(show more)↓↓

Post Thumbnail

Miter Box Slider

May 24, 2010 @ 09:19:20

I submitted a jQuery plugin to CodeCanyon before this past weekend started, and this morning I received an “it’s been accepted” email. If you’re not already familiar with it, CodeCanyon is a marketplace for code. It allows anyone to submit a piece of code to sell. If accepted, they set the price and take a cut of any profits. It’s part of the larger Envato marketplace, which includes areas for selling things like site designs and audio clips.

Miter Box Slider is my submission. It’s a jQuery ’slider’ plugin (i.e. when there’s a slideshow display of images at websites). What’s awesome about it is that it provides the ability to create truly unique animation transitions. With other sliders you’ll see a set of predefined transition effects, but with Miter Box, you create the transitions. It’s actually very powerful. One of the largest issues I had developing it was that I would often end up just playing with it. It’s a fun tool for experimenting.

Regardless of whether other people decide to use it, I really am pretty proud of it. Remember that those who run the site review the code and set the price? Right now, mine is the highest priced (one of only two at that price) item in the javascript section of code. I don’t know everything that goes into that price point, but I will say that I think it’s an indication of the power my plugin offers.

If you’ve got a site, or create sites, and are looking for some way to spice up the way you display your images, check out the Miter Box demo.

SWFObject, IE and Dynamic Content (a problem)

July 22, 2009 @ 22:43:08 11 Comments

I’ve got a problem. The main players are my plugin, Internet Explorer (7, maybe 8, not 6) and SWFObject.

The original inkling of issues came via Anon’s comment, on my previous update post, that YouTube videos pulled down as part of the “more” section were broken. I tested this locally and saw that, with IE7, he/she was right. Of course, it’s not just YouTube. It would be any of the <object>/<embed> elements video sharing sites provide.

That really sucks.
↓↓(show more)↓↓

RMRH Update for WP 2.8.1

July 16, 2009 @ 22:28:34 12 Comments

I had to update the Read More Right Here plugin for the recent 2.8.1 Wordpress release (details below). The most important item to note is that now the minimum required version of WP is 2.8.

↓↓(show more)↓↓

Overflowing List Elements

July 13, 2009 @ 23:43:34

So I had a problem. A long, unordered list of links seems to want to overflow out of their containing <div>. The list items were set to display inline and were extending out past the width of that <div> instead of wrapping down to a new “row”. This list was being generated programmatically, i.e. (simplified):

1
2
3
4
5
6
7
8
9
10
11
$values = get_values();
$display = "<ul>";
 
foreach($values as $value)
{
    $display .= "<li>$value</li>";
}
 
$display .= "</ul>";
 
echo $display;

Why was my list spilling out of its well defined boundaries? A staggering amount of time was spent fiddling with every possible CSS property for that element and those around it. Edit, save and reload. Edit save and reload. It was driving me insane.

Solution? Append a newline after each list element.

6
$display .= "<li>$value</li>\n";

I have no idea why. If you do, please enlighten in the comments.

Dear Lord I hope this helps someone else out.

Wordpress 2.8 Breaks RMRH Plugin

June 17, 2009 @ 18:13:04 22 Comments

(It’s fixed….see second update below)

I just updated this site to use the latest WP (2.8) and now my “Read More Right Here” plugin doesn’t work quite right. When you click the “Read More” text, the rest of the post successfully downloads and is displayed. However, the next “click” takes you to the post’s single page display instead of just collapsing the new content.

I will hopefully get this sorted out soon. Whenever I do, I’ll update here.

UPDATE:

Unfortunately I haven’t been able to fix this. The problem is caused by the latest version of jQuery (1.3.2), to which WP apparently updated. Actually, it was caused somehow in the changes made in between 1.2.6 and 1.3.

Specifically, the function curCSS is throwing exceptions during the animation of the new content “away” (i.e. hiding).

800
var computedStyle = defaultView.getComputedStyle( elem, null );

The elem parameter being passed to getComputedStyle that causes the exception is a “\n“. With jQuery 1.2.6, I don’t see that element being passed to that function.

I tried some of the other animation techniques, but they I guess they all hit curCSS at some point or another. Even plain old hide causes problems.

So…..sorry. As of right now, the RMRH plugin does not work with WP 2.8. The only solution I can see at the moment is to include the older version of jQuery with the plugin. But I’m not sure yet how that will work out.

UPDATE 2: FIXED
↓↓(show more)↓↓

Absolute Positioning and the Canvas Element

June 1, 2009 @ 22:27:46 5 Comments

I’ve been working on a personal “hobby time” project lately using John Resig’s port of Processing (a Java thing) to Processing.js (a javascript thing).

I was at one of those lulls where, instead of worrying about the code, I started playing with the layout. My <canvas> element is sitting inside a <div>, whose “positioning” property I changed to absolute. After this edit, the top-left corner of my <canvas> was no longer (0,0). It had changed to the (x,y) coordinate of the <canvas> element on the page.

Of course, the above conclusion was only reached after a bunch of “W.T.F is going on? Why T.F. is everything broken?”. After some other debugging routes, it dawned on me what might have happened. So I set the frame rate to 1, and used Firebug to log the mouseX and mouseY as I moved the mouse around. Sure enough, my positioning of “top: 200; left:200;” was reflected in Firebug’s console output showing coordinates near those values while hovering around the top left corner. Commenting out the style sheet’s absolute positioning returned the console output to the (0,0) area code.

So this is a defect, right? I can’t imagine that’s how it’s supposed to work. Anyway, consider this a heads-up if you decide to embark on a little processing.js play.

Defect Fix for RMRH Plugin

May 2, 2009 @ 19:03:44 6 Comments

Over on the post announcing my “Read More Right Here” wordpress plugin, an interesting few comments popped up by Thijs (I love these drawings). He found that the plugin breaks when a domain lets wordpress run its root, but the actual Wordpress files are stored in a subdirectory (see this codex article for the how to).

And awesomely enough, he found the cause of the problem!
↓↓(show more)↓↓

A Thorough Video Tutorial for Slicing and CSSing

November 13, 2008 @ 22:50:06

NETTUTS has an extremely thorough, step-by-step video tutorial that covers slicing a site design in Photoshop, coding the HTML, creating the CSS and then (briefly) adding a touch of Javascript.

I make this recommendation with a bit of hesitance though, as the total running time is a bit over 90 minutes. I actually skipped the last third or so of the first video (slicing the PSD). But there is something strangely mesmerizing about watching someone else progress through their work like this. It’s also interesting for me to see someone else’s work flow and tools use.

The presenter/author, Jeffrey Way, states that the tutorial is for beginners, but I’d say that it edges closer to the intermediate level. The CSS section, though long, progresses pretty quickly. You have to already be pretty familiar with the selectors syntax. And he moves right past terms like “inline” and “block”.

If you’ve got the time and the inclination, it’s an excellent howto for that area of web work.

Using the HTML Element for Background Images

October 21, 2008 @ 12:58:36 1 Comment

There’s a pretty simple tutorial over at Web Designer Wall covering large backgrounds with CSS. Of course, I enjoy the “pretty simple” write-ups because there almost always manages to be some nugget of gold for me. In this case, I had no idea that it was possible to use the HTML element to display background images.
↓↓(show more)↓↓

Firefox, CSS and floats: Where’s my background?

September 26, 2008 @ 22:53:15

This is one of those absurd situations that result in far too much effort and stress (if you ask me). It goes like this: You want to create a layout with a couple columns. Those columns are set inside your “container” with a pretty background color or nice border. Wrap a couple <div> elements, float one left, the other right, and add your border/color. Right? Check it out in IE and things look as you expect. But when you look at the results in Firefox, you’ve lost your background! Or that distinguishing border is now lumped at the top as a single, less-than-appealing line! What happened?

There are countless solutions to this available via the normal searching mechanisms. I have to give credit to my first encounter of the solution I like the best: a “Background height problem” forum post with the solution being the very first response. The <img> element at the bottom of poster’s content could be modified with the “clear: both” style applied to it. The solution also points to this excellent article, “Clearing a float container without source markup“, which goes into some great detail (a must read).

So here’s my quick tutorial on the matter. For this to be worth while, you’ll need to be following along in Firefox. And again, for more details, please read the “Easy Clearing” article linked to above.
↓↓(show more)↓↓

Announcing the ‘Read More Right Here’ Wordpress Plugin

September 21, 2008 @ 17:12:47 12 Comments

I’m releasing the first of what I hope are many plugins for Wordpress. All of the details are at the new “WP Plugins” page here at wooliet.

If you’re reading this on the wooliet main page (with multiple posts listed), you can see it in action by clicking the link below. If the is the “single post page” display then..well….there’s nothing to see! Just go to Wooliet and find an entry with a link to more content.

(Updated with official WP plugin link)

↓↓(show more)↓↓

Wordpress, jQuery and ‘noConflict’

September 5, 2008 @ 21:31:19 3 Comments

I’ve been working on a plugin for Wordpress and have, until now, been using Mootools. I decided that I should try and simplify things by using jQuery, since it is already included with Wordpress.

So let me take you through my links and hopefully summarize what I’ve learned. First though, let me say, I’m assuming that you already know what it means to hook into the Wordpress application flow by adding “actions”. If not, read up.
↓↓(show more)↓↓

GUI Controls For the Fridge

September 2, 2008 @ 20:12:27 1 Comment

GUIMags. Magnets designed like standard GUI controls (text field, combo selection, etc.) which can be written on with the dry-erase markers. The idea is quick layout/design prototyping. It’s one of those “born out of necessity” ideas:

Our lead designer wanted to find a way to keep coming up with great interfaces after carpel tunnel entered his body uninvited. As he pondered a design at home, he used refrigerator magnets as imaginary interface controls, since drawing and clicking was painful.
A journey of ideas and tests later resulted in the birth of GUImags which turned out to not only help hurting arms, but helped speeding up the design process as a bonus.

The site also has tabs for GUIPanes and GUIBoards, both of which are still underwraps.

Not a recommendation or anything, these just looked fun.
↓↓(show more)↓↓