Commit f0e07954 authored by webchick's avatar webchick
Browse files

#268645: Make jQuery UI module work with latest 1.5 release.

parent 010b9bff
......@@ -29,9 +29,11 @@ on its own.
INSTALLATION
------------
1. Copy the jquery_ui directory to your sites/SITENAME/modules directory.
1. Copy the jquery_ui module directory to your sites/SITENAME/modules
directory.
2. Download the full version of jQuery UI from http://ui.jquery.com/download.
2. Download the "Development bundle" of jQuery UI from
http://ui.jquery.com/download.
3. Extract it as a sub-directory called 'jquery.ui' in the jquery_ui folder:
......
......@@ -29,10 +29,16 @@ function jquery_ui_requirements($phase) {
else {
// Required library wasn't found. Abort installation.
$requirements['jquery_ui']['value'] = $t('Not found');
$requirements['jquery_ui']['description'] = $t('Missing jQuery UI plug-in. Please !download and extract it to your jquery_ui module directory. See README.txt for more info.', array('!download' => l(t('download jQuery UI'), 'http://ui.jquery.com/download')));
$requirements['jquery_ui']['description'] = $t('Missing jQuery UI plug-in. Please !download and extract it to your jquery_ui module directory. See README.txt for more info.', array('!download' => l(t('download the jQuery UI development bundle'), 'http://ui.jquery.com/download')));
$requirements['jquery_ui']['severity'] = REQUIREMENT_ERROR;
}
return $requirements;
}
/**
* Implementation of hook_uninstall().
*/
function jquery_ui_uninstall() {
variable_del('jquery_ui_compression_type');
}
......@@ -9,6 +9,11 @@
* modules that implement the JQuery UI library. It ensures that multiple
* modules will all include the same library script just once on any given page.
*/
/**
* Path to jQuery UI library.
*/
define('JQUERY_UI_PATH', drupal_get_path('module', 'jquery_ui') . '/jquery.ui');
/**
* Add JQuery interface library to this page.
......@@ -22,7 +27,7 @@
*/
function jquery_ui_add($files = array(), $type = NULL) {
static $loaded_files, $ui_core, $effects_core;
$jquery_ui_path = drupal_get_path('module', 'jquery_ui') . '/jquery.ui';
$jquery_ui_path = JQUERY_UI_PATH . '/ui';
// If a type wasn't specified, then default to whatever was specified in the
// settings page.
......@@ -51,11 +56,11 @@ function jquery_ui_add($files = array(), $type = NULL) {
$file_path = "$file.js";
break;
case 'packed':
$file_path = "packed-javascript/$file.packed.js";
$file_path = "packed/$file.packed.js";
break;
case 'minified':
default:
$file_path = "minified-javascript/$file.min.js";
$file_path = "minified/$file.min.js";
break;
}
$js_path = $jquery_ui_path . '/' . $file_path;
......@@ -101,14 +106,8 @@ function jquery_ui_admin_settings() {
function jquery_ui_get_version() {
$version = 0;
// Attempt to locate the jQuery UI directory and extract the version.
$module_directory = drupal_get_path('module', 'jquery_ui') . '/jquery.ui';
$files = file_scan_directory($module_directory, 'jquery\.ui-all-.*\.js$', $nomask = array('.', '..', 'CVS'), $callback = 0, $recurse = FALSE);
if (!empty($files)) {
$file = array_shift($files);
if (preg_match('#jquery\.ui-all-(.+)$#', $file->name, $matches)) {
$version = $matches[1];
}
if (file_exists(JQUERY_UI_PATH . '/version.txt')) {
$version = file_get_contents(JQUERY_UI_PATH . '/version.txt');
}
return $version;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment