You are here

function bynder_library in Bynder 7

Implements hook_library().

File

./bynder.module, line 144

Code

function bynder_library() {
  $path = drupal_get_path('module', 'bynder');
  $info = system_get_info('module', 'bynder');
  $common = array(
    'website' => 'http://www.bynder.com',
    'version' => !empty($info['version']) ? $info['version'] : '7.x-1.x',
  );

  // Powers the 'Add media from Bynder' page.
  $libraries['bynder_administration'] = array(
    'title' => 'Media: Bynder Administration',
    'js' => array(
      $path . '/js/bynder.js' => array(
        'group' => JS_LIBRARY,
        'weight' => -5,
      ),
      $path . '/js/masonry.min.js' => array(
        'group' => JS_LIBRARY,
        'weight' => -5,
      ),
      $path . '/js/imagesloaded.min.js' => array(
        'group' => JS_LIBRARY,
        'weight' => -5,
      ),
    ),
    'dependencies' => array(
      array(
        'bynder',
        'spin',
      ),
    ),
  );

  // Generates animated CSS3 loading spinners.
  $libraries['spin'] = array(
    'title' => 'Spin',
    'js' => array(
      $path . '/js/spin.min.js' => array(
        'group' => JS_DEFAULT,
      ),
    ),
  );

  // Powers the 'Add media from Bynder' page.
  $libraries['media_dropzone'] = array(
    'title' => 'Media: Upload dropzone',
    'js' => array(
      $path . '/js/bynder_dropzone.js' => array(
        'group' => JS_LIBRARY,
        'weight' => -5,
      ),
      $path . '/js/dropzone/dropzone.min.js' => array(
        'group' => JS_LIBRARY,
        'weight' => -5,
      ),
    ),
    'css' => array(
      $path . '/js/dropzone/dropzone.min.css' => array(),
    ),
  );

  // Add common information to each library.
  foreach ($libraries as &$library) {
    $library += $common;
  }
  return $libraries;
}