JavaScript

Drupal: Drag and Drop Tables in Custom Modules

Drag and Drop Tables in Drupal

Today I want to cover how to use those built-in drag and drop tables (the ones where you can sort the rows however you want) in Drupal, in the context of setting a weight field in a custom module. There was a pretty good article about this by Computer Minds, but I found some parts of their approach buggy, and not what I prefer, stylistically. So, consider this article my improvements upon their work.

Applying our Photoshop Thumbnail Script to Multiple Documents

A reader asked if there was a way to apply the Photoshop Thumbnail script I wrote to all open documents, so I figured I'd post it up here for everyone to see.

Using the YUI Autocomplete Control as a Combo Box

Yesterday I found this article showing how to add a button to the Yahoo UI Autocomplete Control to make it behave like a combo box (i.e. all of the autocomplete's suggestions are listed in a dropdown when the button is clicked). Read more about Using the YUI Autocomplete Control as a Combo Box

Thumbnail Generation with Photoshop and JavaScript

A couple of weeks ago I wrote a post called Conditional Image Resizing with Photoshop and JavaScript that illustrated how to write a script to perform quick photo cleanup and resizing within a bounded area. Today I want to talk about a similar technique for generating thumbnail images. The fundamentals are the same, but the goal is slightly different.

Conditional Image Resizing with Photoshop and JavaScript

Often I find myself having to do a lot of bulk image processing when I'm working on websites: resizing a bunch of pictures to a certain width or height, color adjustments, and sharpening, usually. It can be the most mind-numbing part of my work, and I'm always looking for ways to avoid that.

In Photoshop, you can use actions to help you automate a lot of repetitive work. However, the shortcoming I've found with actions is their lack of conditional behavior. For example, let's say I have a big batch of images, some portrait-oriented (taller than they are wide) and some landscape-oriented (vice versa), and I want to resize each of them to fit within a 500 x 500 pixel square. If the image is portrait-oriented, then I need to resize proportionally, setting the height to 500 pixels. If it's landscape-oriented, then I should resize proportionally with a 500 pixel width, instead of height. I've never found a good way to do this with a single action. But where actions fail, JavaScript comes to the rescue.

Subscribe to RSS - JavaScript Subscribe to Coffeeshopped Blog