title: Is there a better way to use the jQuery UI widget factory without jQuery UI?
body: <p>I develop and maintain a jQuery widget called <a href="http://code.google.com/p/jquery-ui-picklist/" rel="nofollow">jquery-ui-picklist</a>. I've been wanting to remove the dependency on jQuery UI so that it can be used in both jQuery and jQuery UI apps alike.</p>
  
  <p>I've avoided the transition, until yesterday, when I figured out I could simply do something like this:</p>
  
  <pre><code>(function($)
  {
      if($.widget == null)
      {
          // Contents of jquery.ui.widget.js, straight from jQuery UI, goes here.
      }
  
      $.widget("awnry.pickList",
      {
          // My widget's actual code goes here.
      });
  }(jQuery));
  </code></pre>
  
  <p>(If you're interested, the widget's full source <a href="http://code.google.com/p/jquery-ui-picklist/source/browse/tags/0.6.0/jquery-picklist.js" rel="nofollow">can be found here</a>.)</p>
  
  <p>Needless to say it feels dirty and hacky to be including, verbatim, a vendor's code like this. Is there a more correct, elegant, or better way to drop the jQuery UI dependency without making my users add another JS include to their pages?</p>