This patch uses the API (drupal_add_ui) provided through #87994: Quit clobbering people's work when they click the filter tips link to make all the "More help" links AJAXY popup windows.

Inline script tag isn't that nice, but I'm not sure how to pass a function call through Drupal.settings..... Hmmm.

Comments

robloach’s picture

Room for improvement:

  • Inline script? Ew
  • $_GET['popup'] is gross too. Maybe help_dialog_page?
  • Automatically set the title of the popup window?

A good test case is on admin/config/modules.

sun’s picture

Category: feature » task
Issue tags: -advanced help, -HELP +D7 UX freeze

Subscribing for now.

Mentioned a solution in IRC, help_dialog_page($href), circumventing the regular page output + template and just getting the target page callback handler's output into a dialog, and yes, AJAX! :P

robloach’s picture

Category: task » feature
Status: Needs work » Needs review
Issue tags: -D7 UX freeze +advanced help, +HELP
StatusFileSize
new2.79 KB

Got it through the binded events.....

/**
 * Returns code that emits the 'more help'-link.
 */
function theme_more_help_link($variables) {
  // Prepare the variables.
  $link = check_url($variables['url']);
  $id = drupal_html_id('popup-' . $variables['url']);
  $link_id = drupal_html_id('link-' . $variables['url']);

  // Create a dialog box for the help text.
  drupal_add_ui('system', 'ui.dialog', '<div id="' . $id . '"></div>', array(
    'width' => 500,
    'height' => 400,
    'title' => t('Help'),
    'autoOpen' => FALSE,
  ));
  // Open the dialog box when the link is clicked.
  drupal_add_ui('system', 'ui.dialog', '#' . $id, 'open', 'click', '#' . $link_id);
  // When the dialog box opens, load the help content.
  drupal_add_ui('system', 'jquery.load', '#' . $id, $variables['url'].'/dialog', 'dialogopen', '#' . $id);
  // Create the markup.
  return '<div class="more-help-link">' . t('<a id="@link_id" href="@link">More help</a>', array('@link_id' => $link_id, '@link' => $link)) . '</div>';
}

Status: Needs review » Needs work

The last submitted patch failed testing.

Bojhan’s picture

Can anyone tell me what the superior UX is over the current situation - just wondering since its a big change for the help system? also drupal_add_ui sounds terrible.

robloach’s picture

StatusFileSize
new2.79 KB

Hi Bojhan. With the current situation, when you click any "More info" link, you're taken to an entirely different page and loose the context of what you're doing. Using a popup window means that you can read the help, while still being on the same page. Jody in #87994: Quit clobbering people's work when they click the filter tips link added draggable and droppable to the dialog box, so even when the window is there, you can move it to the side of the screen so you can read it when you will out the rest of the form.

drupal_add_ui() is just the API's name to add dynamic JavaScript events to the page. It was "drupal_add_jqueryui" before, but tha_sun thought a shorter name for the function might be more appropriate. If you think of something better, it would be great to suggest it in #87994: Quit clobbering people's work when they click the filter tips link. This patch just uses the API to apply the dynamic behaviors to the More Info links.

Some room for improvement:

Bojhan’s picture

Alright, wanted to make sure we where all on the same line. It makes sense, although I believe the experience could be better. For example making it somewhat larger and adding more visual style closer to Overlay.

robloach’s picture

Status: Needs work » Needs review
StatusFileSize
new3.05 KB

Status: Needs review » Needs work

The last submitted patch failed testing.

yoroy’s picture

Status: Needs work » Needs review

Are you sure, bot?

MichaelCole’s picture

Issue tags: -Usability, -jQuery UI, -advanced help, -HELP

#8: 609094.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Usability, +jQuery UI, +advanced help, +HELP

The last submitted patch, 609094.patch, failed testing.

robloach’s picture

This would not work without drupal_add_action from #87994: Quit clobbering people's work when they click the filter tips link. #647228: Links are needlessly unable to fully participate in D7 AJAX framework features might be a better way around it through through #ajax.

robloach’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs work » Postponed
nod_’s picture

Status: Postponed » Active
realityloop’s picture

jhodgdon’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes

Feature requests are at this point frozen until 8.1.x.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Active » Closed (outdated)

Closing as outdated as the code this issue was solving has gone away/been refactored.

If still an issue please reopen wtih an updated issue summary.

Thanks!