You are here

function nice_menus_library in Nice Menus 7.3

Same name and namespace in other branches
  1. 7.2 nice_menus.module \nice_menus_library()

Implements hook_library().

File

./nice_menus.module, line 99
Module to enable CSS dropdown and flyout menus.

Code

function nice_menus_library() {
  $module_path = drupal_get_path('module', 'nice_menus');

  // Jquery bgiframe, jquery >=1.2.6.
  $libraries['jquery.bgiframe'] = array(
    'title' => 'bgiframe',
    'website' => 'http://plugins.jquery.com/bgiframe',
    'version' => '3.0.0',
    'js' => array(
      $module_path . '/js/jquery.bgiframe.js' => array(),
    ),
  );

  // Jquery hoverIntent.
  $libraries['jquery.hoverIntent'] = array(
    'title' => 'hoverIntent',
    'website' => 'https://github.com/briancherne/jquery-hoverIntent',
    'version' => 'r7',
    'js' => array(
      $module_path . '/js/jquery.hoverIntent.js' => array(),
    ),
  );

  // Superfish, jquery jquery >=1.8.
  $libraries['superfish'] = array(
    'title' => 'Superfish',
    'website' => 'http://plugins.jquery.com/superfish/',
    'version' => '1.7.4',
    'js' => array(
      $module_path . '/js/superfish.js' => array(),
    ),
    'dependencies' => array(
      array(
        'nice_menus',
        'jquery.bgiframe',
      ),
      array(
        'nice_menus',
        'jquery.hoverIntent',
      ),
    ),
  );

  // Nicemenus.
  $libraries['nice_menus'] = array(
    'title' => 'Nice Menus',
    'website' => 'http://drupal.org/project/nice_menus',
    'version' => '1.0',
    'js' => array(
      // Add the Superfish options variables.
      $module_path . '/js/nice_menus.js' => array(),
    ),
    'dependencies' => array(
      array(
        'nice_menus',
        'superfish',
      ),
    ),
  );

  // Add the javascript according to configuration settings.
  $libraries['nice_menus']['js'][] = array(
    'type' => 'setting',
    'data' => array(
      'nice_menus_options' => array(
        'delay' => variable_get('nice_menus_sf_delay', 800),
        'speed' => variable_get('nice_menus_sf_speed', 'slow'),
      ),
    ),
  );
  return $libraries;
}