Skip navigation

Category Archives: /home/bryn/webdev/

isvis()

Need a way to test visibility of an element on a page, but don’t have jQuery? Have some isvis().

bpmv.cLog.jsSome JavaScript environments simply dont have the console object or don’t support all of the console functions. I get sick of either removing my debugging, doing oddball conditionals all over the place or re-writing the same wrappers all over again.

So here’s an addon to bpmv.js that will do all the heavy lifting. I’ll warn you that bpmv.cLog.js is experimental! I could change it at any time and I don’t consider it production ready (read the file before you use it).

Most of the console functions I could find for web browsers are in place. Some, like console.debug(), will fall back to console.log() if they don’t exist and console.log() does.

You can grab a copy along with bpmv.js at it’s GitHub home.

This blew my mind. I was looking at some code that had vars named like thing_x and thing_y, then thought, rather reflexively, "those should just be a single object or array var". The kind of thinking that comes along with the "all vars are objects" mentality of JS. If there was a difference, I thought, it should be nominal.

I was wrong. So wrong. I wasn’t expecting this kind of disparity. The difference in V8 is downright astounding.

jsPerf: Separate Vars vs Container Object

jQuery.scaleFrame.js Docs Screenshot

While messing around with CSS transforms, I noticed that scaled IFRAME tags didn’t behave well. They took up their full layout space regardless of their scaling. I wrote a quick plugin last night to aid with that and even threw in some zoom controls. This morning, I made some docs and threw it onto GitHub. Enjoy.

GitHub Project

This is mainly an experiment and a programming exercise for me, but with a usable result. I’m not sure how I or anyone else will use the plugin yet.

inBuckets()One of the biggest nightmares I’ve had to deal with is unpredictable cache keys. Inevitably, someone codes a function that uses its parameters in the key name. In many cases, this is fine. However, when you need to deal with paginated or grouped data in different sizes, things can get messy. To that end, I lean on PHP’s range() function.

Setting up the input for range() and making the output usable is something I’ve ended up doing over and over again, so I’m finally taking an implementation sharing it to save everyone the labor of dealing with it (including myself). And thus, I submit inBuckets() for your perusal (hosted at GitHub – sadly wordpress.com won’t let us embed Gists). The syntax is in the doc block and there’s commented out sample code at the end to get you started. Enjoy.

Bryn's Smarty Debug Console
I’ve cleaned up and released my old variant on the Smarty debug template. Better navigation, better view of vars and using HTML5 as the basis. More improvements to come in the future.

The gist for it can be found on Github.

Adobe Edge Screenshot PortionInteresting. Adobe is making made a GUI for Webkit, (maybe) jQuery and HTML5. In one sense, it’s déjà vu (It’s "Flash-weaver"!) and in another it may be the future (a jQuery IDE?!). They don’t mention jQuery directly, but the method call in this screenshot sure looks familiar as did some of the easing animations. It would suck to end up with yet another $ conflict if they are not using jQuery.

Check it out Adobe’s video preview at tv.adobe.com.

A screenshot of GridMaker's menu location, dialog box and a 64x64 grid with a 3px gutterI am constantly laying out guides in Photoshop. It’s a major time suck when I’m making something like an icon map. I’ve tried everything I could think of to automate the process. I’ve made elaborate actions. I’ve tried using the View->New Guide… dialog over and over. I finally decided to try my hand at scripting the process. Well, Andrew Ingram beat me to it and did a fine job at that with GridMaker. It’ll create a new file placing the guides at any height and width interval you want with a gutter and stop at any total hight and width you specify. Perfect.

You may have noticed the links at the bottom of every page here disguised as `scp` commands. I’ll explain what each is and what they will direct you to. Read More »

Addy Osmani (web|twitter) has a detailed preview of the new version of jQuery. Of course, jQuery Mobile is getting ramped up, but there are some killer new features as well. The ones that particularly interested me were delaying DOM ready (!) and better Flash object support. The jQuery development process is also getting revised some with things like bug and feature voting.

You can see the original post at http://addyosmani.com/futureofjquery2010/