Active
Project:
Password Strength
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2015 at 18:58 UTC
Updated:
10 Feb 2015 at 18:58 UTC
drupal_add_css(drupal_get_path('module', 'password_strength') . '/css/password.css');
drupal_add_js(array('passwordStrength' => $js_settings), 'setting');
drupal_add_js(drupal_get_path('module', 'password_strength') . '/js/password.js');
psynaptic suggests that if these assets are not used frequently on the site then adding them to aggregated bundle means that on the few pages where they are needed a potentially big fresh asset needs to be downloaded by the client. Consider using preprocess = FALSE and associated settings to keep them out of the aggregation.
I've filed this as a D6 issue but this might apply to D7 as well:
$element['#attached']['css'][] = drupal_get_path('module', 'password_strength') . '/css/password.css';
$element['#attached']['js'][] = array(
'data' => array('passwordStrength' => $js_settings),
'type' => 'setting',
);
$element['#attached']['js'][] = array(
'data' => drupal_get_path('module', 'password_strength') . '/js/password.js',
'weight' => 10,
);