Part of the JavaScript selectors clean-up effort.
#1574470: Selectors clean-up
#1415788: Javascript winter clean-up

Comments

nod_’s picture

See if there is a way to use ui tabs to do that, jquery ui html template can be changed easily enough.

If not possible this needs some serious work on the selectors. It's pretty messy.

Kiphaas7’s picture

if jquery ui isn't used, investigate if adding basic events and detach makes sense, as described in #1763812: [META] Provide complete attach/detach with basic events.

If jquery ui is used, a detach method would be nice.

nod_’s picture

Issue tags: +Needs JS testing

tag

nod_’s picture

Title: Selectors clean-up: vertical-tabs.js » Rewrite vertical-tabs.js

Closed #654894: Difficult to override a vertical tabs summary JS as dup.

From droplet

I just come up same idea. We have 22 usages in CORE, sharing same pattern of code.

e.g.

    $context.find('fieldset#edit-submission').drupalSetSummary(function(context) {
      var vals = [];
      vals.push(Drupal.checkPlain($(context).find('#edit-title-label').val()) || Drupal.t('Requires a title'));
      return vals.join(', ');
    });

- target selector
- decide to show label text or a custom text

I hope it convert to something like:

$target.drupalSetSummary({
	'.form-item-revision input' : {
		rule: ':check',
		validMessage: 'Published',
		invalidMessage: 'Not Published'
	},
	'.form-item-node-type-language-default select option' : {
		rule: ':selected',
		validMessage: null, // Default message, find label texts
		invalidMessage: null, // Default message, find label texts
	},
});

config able to read from Drupal.settings. also make FORM API to eat these params.

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

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should 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.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should 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.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should 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.