Commit 53cb065f authored by sun's avatar sun
Browse files

Re-adding files from DRUPAL-6--1.

parent 64135ad1
// $Id$
jQuery UI x.x-x.x, xxxx-xx-xx
-----------------------------
jQuery UI 7.x-1.x, xxxx-xx-xx
-----------------------------
jQuery UI 6.x-1.x, xxxx-xx-xx
-----------------------------
#362509 by Rob Loach, Deciphered, sun, and adrinux: New release system with
jQuery UI 1.6.
#322731 by sun: Fixed improper use of t() in module install file.
#227687 by sun: Fixed improperly capitalized package name.
jQuery UI 6.x-1.2, 2008-06-23
-----------------------------
- Updated to work with jQuery UI 1.5 release.
- Uses jQuery Update's compression settings rather than its own.
jQuery UI 6.x-1.1, 2008-03-27
-----------------------------
- Initial release of jQuery UI.
- Works with jQuery UI 1.5b4.
Please move to HEAD.
// $Id$
CONTENTS OF THIS FILE
---------------------
* Introduction
* Installation
* API
INTRODUCTION
------------
Authors:
* Jeff Robbins (jjeff)
* Angela Byron (webchick)
* Addison Berry (add1sun)
This Module Made by Robots: http://www.lullabot.com
jQuery UI (http://ui.jquery.com/) is a set of cool widgets and effects that
developers can use to add some pizazz to their modules.
This module is more-or-less a utility module that should simply be required by
other modules that depend on jQuery UI being available. It doesn't do anything
on its own.
INSTALLATION
------------
1. Copy the jquery_ui module directory to your sites/all/modules directory.
2. Download the latest jQuery 1.6 development package from:
http://code.google.com/p/jquery-ui/downloads/list?can=3&q=1.6
3. Extract it as a sub-directory called 'jquery.ui' in the jquery_ui folder:
/sites/all/modules/jquery_ui/jquery.ui/
4. Enable the module at Administer >> Site building >> Modules.
JQUERY UI 1.7
-------------
The jQuery UI module uses jQuery UI 1.6 because jQuery UI 1.7 requires at least
jQuery 1.3, which is not shipped with Drupal 6. If you absolutely need to move
to jQuery UI 1.7, you can get around this by doing the following:
1. Install the jQuery Update module appropriately from:
http://drupal.org/project/jquery_update
2. Download the latest jQuery UI 1.7 development package from:
http://code.google.com/p/jquery-ui/downloads/list?can=3&q=1.7
3. Replace the old jQuery UI folder with the 1.7 package at:
/sites/all/modules/jquery_ui/jquery.ui/
API
---
Developers who wish to use jQuery UI effects in their modules need only make
the following changes:
1. In your module's .info file, add the following line:
dependencies[] = jquery_ui
This will force users to have the jQuery UI module installed before they can
enable your module.
2. In your module, call the following function:
jquery_ui_add($files);
For example:
jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
jquery_ui_add('ui.sortable'); // For a single file
See the contents of the jquery.ui-X.X sub-directory for a list of available
files that may be included, and see http://ui.jquery.com/docs for details on
how to use them. The required ui.core file is automatically included, as is
effects.core if you include any effects files.
; $Id$
name = jQuery UI
description = Provides the jQuery UI plug-in to other Drupal modules.
package = User interface
core = 6.x
<?php
// $Id$
/**
* @file
* Installation file for jQuery UI module.
*/
/**
* Implementation of hook_requirements().
*/
function jquery_ui_requirements($phase) {
$requirements = array();
$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 drupal_get_path('module', 'jquery_ui') . '/jquery_ui.module';
}
$requirements['jquery_ui']['title'] = $t('jQuery UI');
if ($jquery_ui_version = jquery_ui_get_version()) {
// Everything looks good; display the current jQuery UI version.
$requirements['jquery_ui']['value'] = $jquery_ui_version;
$requirements['jquery_ui']['severity'] = REQUIREMENT_OK;
}
else {
// Required library wasn't found. Abort installation.
$requirements['jquery_ui']['value'] = $t('Not found');
// Provide a download link to the jQuery UI development bundle. The provided
// link will list the latest 1.6.x build.
$requirements['jquery_ui']['description'] = $t('The <a href="@jqueryui">jQuery UI</a> plugin is missing. <a href="@download">Download</a> and extract it to your <em>jquery_ui</em> module directory. See <a href="@readme">README.txt</a> for more info.', array('@jqueryui' => 'http://jqueryui.com', '@download' => 'http://code.google.com/p/jquery-ui/downloads/list?can=3&q=1.6', '@readme' => url(drupal_get_path('module', 'jquery_ui') .'/README.txt')));
$requirements['jquery_ui']['severity'] = REQUIREMENT_ERROR;
}
return $requirements;
}
/**
* Implementation of hook_uninstall().
*/
function jquery_ui_uninstall() {
variable_del('jquery_ui_compression_type');
}
<?php
// $Id$
/**
* @file
* Provides the jQuery UI plug-in to other Drupal modules.
*
* This module doesn't do too much, but it is a central location for any other
* 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 the specified jQuery UI library files to this page.
*
* The ui.core file is always included automatically, as well as the
* effects.core file if any of the effects libraries are used.
*
* @param $files
* An array of what additional files (other than UI core) should be loaded
* on the page, or a string with a single file name.
*/
function jquery_ui_add($files = array()) {
static $loaded_files, $ui_core, $effects_core;
$jquery_ui_path = JQUERY_UI_PATH . '/ui';
$compression = variable_get('jquery_update_compression_type', 'mini');
// Convert file to an array if it's not one already, to compensate for
// lazy developers. ;)
if (!is_array($files)) {
$files = array($files);
}
// If core hasn't been added yet, add it.
if (!isset($ui_core)) {
$ui_core = TRUE;
jquery_ui_add(array('ui.core'));
}
// Loop through list of files to include and add them to the page.
foreach ($files as $file) {
// Any effects files require the effects core file.
if (!isset($effects_core) && strpos($file, 'effects.') === 0) {
$effects_core = TRUE;
jquery_ui_add(array('effects.core'));
}
// Load other files.
if (!isset($loaded_files[$file])) {
switch ($compression) {
case 'none':
$file_path = "$file.js";
break;
case 'pack':
$file_path = "packed/$file.packed.js";
break;
case 'mini':
default:
$file_path = "minified/$file.min.js";
break;
}
$js_path = $jquery_ui_path . '/' . $file_path;
drupal_add_js($js_path);
$loaded_files[$file] = $js_path; // or TRUE...
}
}
}
/**
* Return the version of jQuery UI installed.
*/
function jquery_ui_get_version() {
$version = 0;
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