function resp_img_add_js in Responsive images and styles 7
Same name and namespace in other branches
- 8 resp_img.module \resp_img_add_js()
- 7.2 resp_img.module \resp_img_add_js()
Add cookie support, script and settings
3 calls to resp_img_add_js()
- resp_img_init in ./
resp_img.module - Implements hook_init().
- resp_img_pp_field_slideshow in ./
resp_img.module - Support for field_slideshow.
- resp_img_pp_image in ./
resp_img.module - Support for general images.
File
- ./
resp_img.module, line 136
Code
function resp_img_add_js() {
static $added = FALSE;
if (!$added) {
$added = TRUE;
$settings = array();
$settings['default_suffix'] = variable_get('resp_img_default_suffix', '');
$settings['current_suffix'] = resp_img_get_best_suffix();
$settings['forceRedirect'] = variable_get('resp_img_forceredirect', FALSE);
$settings['forceResize'] = variable_get('resp_img_forceresize', FALSE);
$settings['reloadOnResize'] = variable_get('resp_img_reloadonresize', FALSE);
$settings['useDevicePixelRatio'] = variable_get('resp_img_use_device_pixel_ratio', FALSE);
$settings['suffixes'] = resp_img_suffix_load_all_breakpoints();
drupal_add_library('system', 'jquery.cookie');
drupal_add_js(array(
'respImg' => $settings,
), array(
'type' => 'setting',
'weight' => -11,
'group' => JS_DEFAULT,
));
drupal_add_js(drupal_get_path('module', 'resp_img') . '/resp_img.js', array(
'type' => 'file',
'weight' => -10,
'group' => JS_DEFAULT,
));
}
}