Wednesday, March 21, 2012

Add Hints & Auto Focus Form Fields (jQuery)

1: $(document).ready(function () {

   2:          //Focus auto-focus fields
   3:          //  add class="auto-focus" to first field
   4:          $('.auto-focus:first').focus();
   5:          //Initialize auto-hint fields
   6:          //  add class="auto-hint" to fields
   7:          //  needs CSS: .auto-hint{color: #AAAAAA;}
   8:          $('INPUT.auto-hint, TEXTAREA.auto-hint').focus(function () {
   9:                 if ($(this).val() == $(this).attr('title')) {
  10:                         $(this).val('');
  11:                         $(this).removeClass('auto-hint');
  12:                 }
  13:          });
  14:          $('INPUT.auto-hint, TEXTAREA.auto-hint').blur(function () {
  15:                 if ($(this).val() == '' && $(this).attr('title') != '') {
  16:                         $(this).val($(this).attr('title'));
  17:                         $(this).addClass('auto-hint');
  18:                 }
  19:          });
  20:          $('INPUT.auto-hint, TEXTAREA.auto-hint').each(function () {
  21:                 if ($(this).attr('title') == '') { return; }
  22:                 if ($(this).val() == '') { $(this).val($(this).attr('title')); }
  23:                 else { $(this).removeClass('auto-hint'); }
  24:          });
  25:  });

Tuesday, March 6, 2012

Restoring PDF Thumbnails to display in Windows Explorer (x64)

I recently upgraded from Windows 7 32-bit to Windows 7 64-bit.  Under the 32-bit OS, I was able to see thumbnails of PDF files (the first page) as the file’s icon.  Under 64-bit Windows 7 I only get the Adobe PDF icon and no thumbnail.

The reason Windows Explorer 64 won’t generate thumbnails?  This occurs because a 64-bit process that runs on a computer that is running an x64-based version of Windows cannot load the 32-bit DLL file that is required to generate the thumbnails.

This describes how you can generate thumbnails for specific PDF files (it’s a little tedious) – however, this will not restore Windows Explorer’s ability to generate them itself.  Pity!

image

The first thing to do is to be sure you have the folder options set correctly- though this will not take care of the problem, there is another step.  Open up the Folder Options dialog in Windows Explorer:

image

Ensure the “Always show icons, never thumbnails” is unchecked:

image

Next open Adobe Acrobat Reader and click the “Open Files” dialog and navigate to a folder with PDF files.

Adobe Reader will generate thumbnails for the files that are in view.

image

Go back to Explorer and you should see the thumbnails generated by Adobe.  Notice that thumbnails are displayed only for those PDF files that were processed by Adobe.

image

awesome