Thursday, December 29, 2011

ShinyField - a placeholder jQuery plugin

A simple jQuery plugin, originally developed for the Mendeley website, to

1) implement consistent HTML5 input (text/password) placeholder hinting behaviour across all major browsers, including IE 7+! (Note that having a placeholder value is optional)

2) apply beautiful CSS3 styling such as border-radius and box-shadow on the inputs. Sorry, IE users will not get those lovely rounded corners.

ShinyField source and download on GitHub

Live demo (html source):



Customization examples

Every look-and-feel aspect of this plugin can be customized via CSS. Here are some common examples:

1) To change the dimensions of the input (default is 292px by 36px, with 10px by 8px "inner padding")

 // JS  
 $("input[name=pretty-text-example1]").shinify({"wrapperId": "example1"});  
 // CSS  
 #example1 { width: 100px; height: 24px; }  
 #example1 input { margin: 5px; width: 90px; font-size: 11px; } /* note that you have to override MARGIN here */  
 #example1 .shiny-field-hint { padding: 5px; width: 90px; font-size: 11px; } /* note that you have to override PADDING here */  

2) To change "in focus" border colour

 // JS  
 $("input[name=pretty-text-example2]").shinify({"wrapperId": "example2"});  
 // CSS { border-color: red; }  

Special thanks to @AndrewOfficer and @subcide, of the Mendeley UX team, for design input and advice.

Wednesday, December 28, 2011

Bullhorn Conversion - Chop and Flop

I have been meaning to swap the dropbar on my commuter singlespeed for a bullhorn bar for a while. Over the festive period, after reading a few articles on the web, I finally decided to buy a £2.50 hacksaw and "chop and flop" the bar, i.e. chop off the "drops" and invert the bar.

Why the chop?

The combination of the old school dropbar and the old school Weinmann brake levers makes braking "on the hood" rather difficult, and I often resort to riding with my palms on the ramps of the bar and using my middle and my fourth fingers to push the suicide levers in order to brake, which is not ideal especially when you need that extra bit of braking power in the rain. As I rarely ride in the drop position when dashing around London anyway, I thought a bullhorn setup which allows me to bring the brakes closer to my normal gripping position would be more ideal.

I could probably have got a brand-new bullhorn bar for just over a tenner, but in this age of insane consumerism, it certainly feels very refreshing to be able to create something new yourself using existing bits, in keeping with a greener ethos. Hence I was very excited to undertake this little DIY project.

How to chop?

The whole process was surprisingly easy (even for someone like me who had never sawed anything!) and only took a couple of hours. The following is a step-by-step guide to how to "chop and flop":

Apart from the usual bike tools, such as allen keys, spanners, screw drivers, etc, all the tools that are needed specifically for this job include a (junior) hacksaw, a roll of tape, some lubricating oil and a bit of sandpaper (or a metal file):

The chromed steel bar and the Weinmann brakes before the chop. Notice the protruding pivot bolts - I managed to remove the suicide levers with no problem with this pair of brakes, and I simply left the bolts sticking out, which is perfectly fine:

Now flip the bar upside down and put it back on the bike. Try out a few positions until you have found the most comfortable hand-gripping point. REMEMBER YOU MUST ALLOW ENOUGH EXTRA ROOM FOR ATTACHMENTING THE BRAKES. Simply mark the exact point where you want to cut the bar by wrapping some tape around it. Remember which side of the tape you want to cut:

If you can clamp the bar against a worktop, good for you! Otherwise, some people suggest sawing the bar with it attached to the bike stem. I simply put it on the floor and started sawing. A couple of tips: 1) put it on top of some cloth/foam to stop your neighbours from wondering about the strange noise 2) frequently drop lubricating oil (or chain oil) onto the contact point to stop the blade from breaking:

Hopefully you will have achieved quite a clean cut. Use a bit of sandpaper to sand down any rough/sharp bits. Now use the removed end to help you mark out the cutting point for the other side of the bar. Again remember which side of the tape you want to cut:


On my 90s Concorde steel frame (Sturmey Archer Stem, Selle Turbo Saddle, Schwalbe Marathon Original Tyre, Vittoria Randonneur White Tyre, and a wine bottle cork bar end plug!)

First impression:

I went out for a 30-minutes ride after the chop, and the new bullhorn bar felt superb. I felt that power transfer was much better especially when I was riding out of the saddle. I was able to really lean on the bar. At the same time, transitioning to a more relaxed riding position by moving my hands closer to the top of the bar was smooth and easy. The brake lever reach is still a little bit too far for my liking, but at least I can readily reach the levers now, and I suspect having some modern brake levers may help.