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.

Files: 
CommentFileSizeAuthor
#8 609094.patch3.05 KBRobLoach
FAILED: [[SimpleTest]]: [MySQL] 20,076 pass(es), 29 fail(s), and 2 exception(es). View
#6 609094.patch2.79 KBRobLoach
Failed: Failed to run tests. View
#3 609094.patch2.79 KBRobLoach
Failed: Failed to run tests. View
morehelppopup.patch1.98 KBRobLoach
Failed: Failed to run tests. View

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
FileSize
2.79 KB
Failed: Failed to run tests. View

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', '
', 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 ''; }

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

FileSize
2.79 KB
Failed: Failed to run tests. View

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
FileSize
3.05 KB
FAILED: [[SimpleTest]]: [MySQL] 20,076 pass(es), 29 fail(s), and 2 exception(es). View

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.