=== modified file 'README.txt' --- README.txt 2010-10-18 10:40:49 +0000 +++ README.txt 2010-10-18 10:58:29 +0000 @@ -48,6 +48,14 @@ * Enable the module at Administer >> Site building >> Modules. +-- DRUSH -- + +* You can download the Jquery UI library using the provided Drush command, provided you have Drush installed. + The format of the command is "drush jqueryui-download VERSION PATH" + Both VERSION and PATH are optional as they default to "1.6" and "sites/all/libraries/jquery.ui" when no arguments are provided. + + Please Note that for now, the command should be typed "drush jqueryui-download 1.6 ./sites/all/modules/jquery_ui/jquery.ui" + This is due to http://drupal.org/node/489140 being unresolved and Jquery UI 1.7 requiring the Jquery Update module. -- JQUERY UI 1.7 -- === added file 'jquery_ui.drush.inc' --- jquery_ui.drush.inc 1970-01-01 00:00:00 +0000 +++ jquery_ui.drush.inc 2010-10-18 10:41:15 +0000 @@ -0,0 +1,43 @@ + 'Download the jQuery UI library.', + 'arguments' => array( + 'version' => dt('Optional. A version number for jquery.ui. Should be in the form "1.6" or "1.7.3". Defaults to 1.6.'), + 'path' => dt('Optional. A path to the download folder. If omitted Drush will use the default location (sites/all/libraries/jquery.ui).'), + ), + ); + return $items; +} + +/** + * Checkout jQuery UI from SVN. + */ +function drush_jquery_ui_jqueryui_download() { + $args = func_get_args(); + + $version = ($args[0]) ? $args[0] : '1.6'; + $path = ($args[1]) ? $args[1] : drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/jquery.ui'; + + if (drush_shell_exec('svn checkout http://jquery-ui.googlecode.com/svn/tags/' . $version . '/ ' . $path)) { + drush_log(dt('jQuery UI version @version has been downloaded to @path.', array('@path' => $path, '@version' => $version)), 'success'); + } + else { + drush_log(dt('Drush was unable to download the jQuery UI library version @version to @path.', array('@path' => $path, '@version' => $version)), 'error'); + } +} + +/** + * Implements drush_MODULE_post_COMMAND(). + */ +function drush_jquery_ui_post_enable() { + $modules = func_get_args(); + if (in_array('jquery_ui', $modules)) { + jquery_ui_drush_download(); + } +}