Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1013 diff -u -p -r1.1013 common.inc --- includes/common.inc 11 Oct 2009 06:05:53 -0000 1.1013 +++ includes/common.inc 12 Oct 2009 19:41:32 -0000 @@ -3661,6 +3661,55 @@ function drupal_add_library($module, $na } /** + * Adds a jQuery UI element to the page, and invokes its behaviors. + * + * @param $tool + * The name of the tool to add (dialog, accordion, resizable, etc). + * @param $selector + * (optional) The CSS selector of which to apply the tool. + * @param $options + * (optional) The options that are passed to the element during execution. + * @param $event + * (optional) On what binded event the tool should be applied to the element. + * Defaults to document ready. + * @param $binded_element + * (optional) When binding on an event other then ready, will be the element + * that the event is binded to. + * @param $base + * (optional) The base name of the tool that is being added. Specify "effect" + * for any jQuery UI effect, and "ui" for widgets and interactions. + * @return + * An array representing all elements added to the page so far. + */ +function drupal_add_jqueryui($tool, $selector = NULL, $options = array(), $event = 'ready', $binded_element = NULL, $base = 'ui') { + $elements = &drupal_static(__FUNCTION__, array()); + // Add the jQuery UI Drupal behaviors. + if (empty($elements)) { + drupal_add_js('misc/jqueryui.js'); + } + // Add the jQuery UI tool if it hasn't been added yet. + if (!isset($elements[$tool])) { + $elements[$tool] = array(); + drupal_add_library('system', "$base.$tool"); + } + // Add the settings so that the behaviors are attached to the elements. + if (isset($selector) && !isset($elements[$tool][$selector][$event])) { + $elements[$tool][$selector][$event] = $options; + drupal_add_js(array('jqueryui' => array( + $tool => array( + $selector => array( + $event => array( + 'options' => $options, + 'item' => $binded_element, + ), + ), + ), + )), 'setting'); + } + return $elements; +} + +/** * Retrieves information for a JavaScript/CSS library. * * Library information is statically cached. Libraries are keyed by module for Index: misc/jqueryui.js =================================================================== RCS file: misc/jqueryui.js diff -N misc/jqueryui.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ misc/jqueryui.js 12 Oct 2009 19:41:32 -0000 @@ -0,0 +1,45 @@ +// $Id$ +(function ($) { + +/** + * @file + * Provides the jQuery UI Drupal behaviors. + */ + +/** + * The jQuery UI Drupal behavior. + * + * This will go through all widgets and apply them to the given selectors with + * the appropriate arguments. It also takes binded events into consideration. + */ +Drupal.behaviors.jqueryui = { + attach: function(context, settings) { + if (settings.jqueryui || false) { + // Iterate through each widget and apply the tool to the elements. + jQuery.each(settings.jqueryui, function(tool, selectors) { + // Iterate through each selector to bind the events. + jQuery.each(selectors, function(selector, events) { + // Iterate through each event to bind the elements to their properties. + jQuery.each(events, function(event, options) { + // See if we are to bind the tool to an event, or just apply it when + // the document is ready. + if (event == 'ready') { + // Apply the jQuery UI's effect. + $(selector, context).once('jqueryui-' + tool + '-ready')[tool](options.options); + } + else { + // Apply the jQuery UI's effect on a binded event. + $(options.item, context).once('jqueryui-' + tool + '-' + event).bind(event, function(e) { + $(selector, context)[tool](options.options); + // Remove the default effect as we're using jQuery UI now. + return false; + }); + } + }); + }); + }); + } + } +}; + +})(jQuery); Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.296 diff -u -p -r1.296 filter.module --- modules/filter/filter.module 10 Oct 2009 21:39:02 -0000 1.296 +++ modules/filter/filter.module 12 Oct 2009 19:41:32 -0000 @@ -49,9 +49,6 @@ function filter_theme() { 'arguments' => array('tips' => NULL, 'long' => FALSE), 'file' => 'filter.pages.inc', ), - 'filter_tips_more_info' => array( - 'arguments' => array(), - ), 'filter_guidelines' => array( 'arguments' => array('format' => NULL), ), @@ -793,10 +790,28 @@ function filter_form($selected_format = ); $form['format_help'] = array( '#prefix' => '
' . l(t('More information about text formats'), 'filter/tips') . '
'; -} - -/** * Format guidelines for a text format. * * @ingroup themeable Index: modules/filter/filter.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.pages.inc,v retrieving revision 1.8 diff -u -p -r1.8 filter.pages.inc --- modules/filter/filter.pages.inc 9 Oct 2009 00:59:58 -0000 1.8 +++ modules/filter/filter.pages.inc 12 Oct 2009 19:41:32 -0000 @@ -11,14 +11,7 @@ * Menu callback; show a page with long filter tips. */ function filter_tips_long() { - $format = arg(2); - if ($format) { - $output = theme('filter_tips', array('tips' => _filter_tips($format, TRUE), 'long' => TRUE)); - } - else { - $output = theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE)); - } - return $output; + return theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE)); } Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.805 diff -u -p -r1.805 system.module --- modules/system/system.module 12 Oct 2009 15:40:04 -0000 1.805 +++ modules/system/system.module 12 Oct 2009 19:41:32 -0000 @@ -1022,6 +1022,8 @@ function system_library() { ), 'dependencies' => array( array('system', 'ui'), + array('system', 'ui.draggable'), + array('system', 'ui.resizable'), ), ); $libraries['ui.draggable'] = array(