--- jquery_ui.info 2009-06-20 20:50:34.000000000 -0700 +++ jquery_ui.info (working copy) @@ -3,6 +3,7 @@ name = jQuery UI description = Provides the jQuery UI plug-in to other Drupal modules. package = User interface core = 6.x +dependencies[] = libraries ; Information added by drupal.org packaging script on 2009-06-21 version = "6.x-1.3" --- jquery_ui.install 2009-06-20 20:43:03.000000000 -0700 +++ jquery_ui.install (working copy) @@ -14,11 +14,9 @@ function jquery_ui_requirements($phase) $t = get_t(); $jquery_ui_version = 0; - if ($phase == 'install') { - // The jquery_ui_get_version() function is in the .module file, which isn't - // loaded yet. - include_once dirname(__FILE__) . '/jquery_ui.module'; - } + // Ensure the Libraries API module is loaded. + drupal_load('module', 'libraries'); + drupal_load('module', 'jquery_ui'); $requirements['jquery_ui']['title'] = $t('jQuery UI'); if ($jquery_ui_version = jquery_ui_get_version()) { --- jquery_ui.module 2009-06-20 20:43:03.000000000 -0700 +++ jquery_ui.module (working copy) @@ -11,20 +11,6 @@ */ /** - * Path to jQuery UI library. - * - * During site installation, JQUERY_UI_PATH is the absolute path to the - * jQuery UI library. At all other times JQUERY_UI_PATH is relative, and - * safe for use in URLs. - */ -if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install') { - define('JQUERY_UI_PATH', dirname(__FILE__) . '/jquery.ui'); -} -else { - define('JQUERY_UI_PATH', drupal_get_path('module', 'jquery_ui') . '/jquery.ui'); -} - -/** * Add the specified jQuery UI library files to this page. * * The ui.core file is always included automatically, as well as the @@ -36,7 +22,7 @@ else { */ function jquery_ui_add($files = array()) { static $loaded_files, $ui_core, $effects_core; - $jquery_ui_path = JQUERY_UI_PATH . '/ui'; + $jquery_ui_path = libraries_get_path('jquery.ui') . '/ui'; $compression = variable_get('jquery_update_compression_type', 'mini'); // Convert file to an array if it's not one already, to compensate for @@ -49,6 +35,18 @@ function jquery_ui_add($files = array()) if (!isset($ui_core)) { $ui_core = TRUE; jquery_ui_add(array('ui.core')); + + // Add extra core files for JQuery 1.8.x + if (strncmp(jquery_ui_get_version(), '1.8', 3) >= 0) { + if ($compression != 'none') { + // Just load the whole library when compression is not Development (none) + jquery_ui_add(array('jquery-ui')); + } + else { + // Hopefully we got them all, suggest using minified to make sure though! + jquery_ui_add(array('ui.widget', 'ui.mouse')); + } + } } // Loop through list of files to include and add them to the page. @@ -59,6 +57,15 @@ function jquery_ui_add($files = array()) jquery_ui_add(array('effects.core')); } + // Try to fix old path requests for JQuery 1.8.x + if (strncmp(jquery_ui_get_version(), '1.8', 3) >= 0 && strncmp($file, 'jquery', 6) !== 0) { + // Don't bother going any further unless compression is Development (none) + if ($compression != 'none') { + return; + } + $file = 'jquery.' . $file; + } + // Load other files. if (!isset($loaded_files[$file])) { switch ($compression) { @@ -88,8 +95,9 @@ function jquery_ui_add($files = array()) function jquery_ui_get_version() { $version = 0; - if (file_exists(JQUERY_UI_PATH . '/version.txt')) { - $version = file_get_contents(JQUERY_UI_PATH . '/version.txt'); + $version_file = libraries_get_path('jquery.ui') . '/version.txt'; + if (file_exists($version_file)) { + $version = file_get_contents($version_file); } return $version; --- README.txt 2009-06-20 20:43:03.000000000 -0700 +++ README.txt (working copy) @@ -23,17 +23,17 @@ To submit bug reports and feature sugges -- INSTALLATION -- -* Copy the jquery_ui module directory to your sites/all/modules directory. +* Copy the libraries and jquery_ui modules to your sites/all/modules folder. * Download the latest jQuery UI 1.6 development package from: http://code.google.com/p/jquery-ui/downloads/list?can=3&q=1.6 -* Extract it as a sub-directory called 'jquery.ui' in the jquery_ui folder: +* Extract it to a folder in sites/all/libraries and name it 'jquery.ui': - /sites/all/modules/jquery_ui/jquery.ui/ + /sites/all/libraries/jquery.ui/ -* Enable the module at Administer >> Site building >> Modules. +* Enable the libraries and jquery_ui modules at admin/build/modules. -- JQUERY UI 1.7 --