Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.996
diff -u -p -r1.996 common.inc
--- includes/common.inc	27 Sep 2009 11:08:45 -0000	1.996
+++ includes/common.inc	27 Sep 2009 23:32:02 -0000
@@ -3541,6 +3541,42 @@ function drupal_add_tabledrag($table_id,
 }
 
 /**
+ * Adds a dialog using jQuery UI.
+ *
+ * @param $options
+ *   An array of options with the following keys:
+ *   - 'trigger_selector': A jQuery selector which should open a dialog when
+ *     clicked. Example: 'a#modal-link'.
+ *   - 'content_selector': A jQuery selector which contains the content for
+ *     display in the dialog.
+ *   - 'options': An array of dialog options keyed by option name. See
+ *     @link http://docs.jquery.com/UI/Dialog#options jQuery UI documentation @endlink
+ *     for available options.
+ */
+function drupal_add_dialog(array $options = array()) {
+  $dialogs = &drupal_static(__FUNCTION__, array());
+  // Add default options to the options array.
+  $options += array(
+    'options' => array(),
+  );
+  if (!count($dialogs)) {
+    drupal_add_library('system', 'ui.dialog');
+    drupal_add_library('system', 'ui.draggable');
+    drupal_add_library('system', 'ui.resizable');
+    drupal_add_js('misc/dialog.js');
+  }
+  $trigger_selector = $options['trigger_selector'];
+  if (!isset($dialogs[$trigger_selector])) {
+    $dialogs[$trigger_selector] = array(
+      'content_selector' => $options['content_selector'],
+      'options' => $options['options'],
+    );
+    drupal_add_js(array('dialogs' => $dialogs), 'setting');
+  }
+  return $dialogs;
+}
+
+/**
  * Aggregate JS files, putting them in the files directory.
  *
  * @param $files
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.291
diff -u -p -r1.291 filter.module
--- modules/filter/filter.module	20 Sep 2009 07:32:18 -0000	1.291
+++ modules/filter/filter.module	27 Sep 2009 23:29:18 -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),
     ),
@@ -776,10 +773,25 @@ function filter_form($selected_format = 
   );
   $form['format_help'] = array(
     '#prefix' => '<div id="' . $element_id . '-help" class="filter-help">',
-    '#markup' => theme('filter_tips_more_info'),
     '#suffix' => '</div>',
     '#weight' => 1,
   );
+  $form['format_help']['#attached']['drupal_add_dialog'][][] = array(
+    'trigger_selector' => '.filter-tips-modal',
+    'content_selector' => '#filter-tips-modal-dialog',
+    'options' => array(
+      'width' => 600,
+      'height' => 500,
+    ),
+  );
+  $form['format_help']['more'] = array(
+    '#markup' => l(t('More information about text formats'), 'filter/tips', array('attributes' => array('class' => array('filter-tips-modal')))),
+  );
+  $form['format_help']['long'] = array(
+    '#prefix' => '<div id="filter-tips-modal-dialog" class="ui-helper-hidden" title="' . t('Filter tips') . '">',
+    '#markup' => filter_tips_long(),
+    '#suffix' => '</div>',
+  );
 
   return $form;
 }
@@ -893,15 +905,6 @@ function filter_dom_serialize($dom_docum
 }
 
 /**
- * Format a link to the more extensive filter tips.
- *
- * @ingroup themeable
- */
-function theme_filter_tips_more_info() {
-  return '<p>' . l(t('More information about text formats'), 'filter/tips') . '</p>';
-}
-
-/**
  * 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.7
diff -u -p -r1.7 filter.pages.inc
--- modules/filter/filter.pages.inc	8 Mar 2009 21:25:18 -0000	1.7
+++ modules/filter/filter.pages.inc	27 Sep 2009 22:47:26 -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', _filter_tips($format, TRUE), TRUE);
-  }
-  else {
-    $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
-  }
-  return $output;
+  return theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
 }
 
 
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.796
diff -u -p -r1.796 system.module
--- modules/system/system.module	25 Sep 2009 23:48:24 -0000	1.796
+++ modules/system/system.module	27 Sep 2009 22:49:16 -0000
@@ -973,7 +973,6 @@ function system_library() {
     ),
     'css' => array(
       'misc/ui/ui.core.css' => array(),
-      'misc/ui/ui.theme.css' => array(),
     ),
   );
   $libraries['ui.accordion'] = array(
Index: themes/garland/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/style.css,v
retrieving revision 1.64
diff -u -p -r1.64 style.css
--- themes/garland/style.css	31 Aug 2009 17:40:03 -0000	1.64
+++ themes/garland/style.css	27 Sep 2009 23:20:49 -0000
@@ -1125,3 +1125,27 @@ table.system-status-report tr.ok, table.
   background-color: #dfd;
   border-color: #beb;
 }
+
+/**
+ * UI dialogs.
+ */
+.ui-dialog {
+  background-color: #fff;
+  border: 1px solid #ccc;
+  padding: 0;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+}
+.ui-dialog .ui-dialog-titlebar {
+  background-color: #edf5fa;
+}
+.ui-icon {
+  width: 16px;
+  height: 16px;
+  background-image: url(/misc/ui/images/ui-icons_222222_256x240.png);
+}
+.ui-icon-closethick {
+  background-position: -96px -128px;
+}
+
Index: themes/seven/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/style.css,v
retrieving revision 1.18
diff -u -p -r1.18 style.css
--- themes/seven/style.css	11 Sep 2009 13:48:44 -0000	1.18
+++ themes/seven/style.css	27 Sep 2009 23:19:12 -0000
@@ -715,6 +715,29 @@ div.admin-options div.form-item {
   border: none;
 }
 
+/**
+ * UI dialogs.
+ */
+.ui-dialog {
+  background-color: #fff;
+  border: 1px solid #ccc;
+  padding: 0;
+  -moz-border-radius: 5px;
+  -webkit-border-radius: 5px;
+  border-radius: 5px;
+}
+.ui-dialog .ui-dialog-titlebar {
+  background-color: #e0e0d8;
+}
+.ui-icon {
+  width: 16px;
+  height: 16px;
+  background-image: url(/misc/ui/images/ui-icons_222222_256x240.png);
+}
+.ui-icon-closethick {
+  background-position: -96px -128px;
+}
+
 /* Overlay theming */
 body.overlay {
   background: #fff;
