Blog Archives

Userscript: Hulu Right-Click for Pop Out Video

Hulu’s default rather large video player is usually too big for my needs. I prefer the “Pop Out” player. So, I often load the large video, click the cog wheel, move my mouse to the “popout” link, click it, then

Tagged with: , ,
Posted in Development

Add Links to Anchors Automatically

The following snippet is something I used recently to add (below the current item in a menu) links to any anchors found in the content.

Honestly I could probably create the <ul> outside of the each() loop and save having

Tagged with: ,
Posted in Development

Maintaining Lightbox2 Templating

Lightbox2 is a very popular and powerful Drupal module. One of the helpful features is that you can render a Drupal node in a lightbox rather easily in either PHP or HTML. View detailed explanation. The issue is that when you click

Tagged with: , , , , , ,
Posted in Development

Make menu header a link to its first child link

We use menu block a lot to create sidebar menus with specific depths, starting points, etc. The following snippet shows how we can use jQuery to turn a normal <h2> tag into a link. The link’s destination will be the

Tagged with: ,
Posted in Development

How to check if a jQuery plugin is loaded

The following snippet is one way to determine if a jQuery plugin is loaded an available. There are probably other ways to achieve the same behavior, however this one never seems to fail me.

 

Tagged with: ,
Posted in Development

Open All External Links in a New Window/Tab using jQuery

… and to match two urls/domains/whatever:

 

Tagged with: ,
Posted in Development

Multiple Submit Buttons on a Webform

I’ve spent a lot of time working with hook_form_alter() functions to modify forms, but the other day I was stumped by a simple problem. I needed to have two submit buttons on a form. By default, in the latest branch

Tagged with: , , , ,
Posted in Development

Dynamic and AJAX-driven Select Lists in Webform

This example is a two-for-one deal! I’m going to demonstrate how to dynamically populate a webform select list on page load dynamically populate a webform select list based upon the value chosen in another webform select list For both parts of

Tagged with: , , , , , , , ,
Posted in Development