You are here

function isotope_library in Isotope (with Masonry and Packery) 7

Implements hook_library().

Checks to see if the Library exists, and makes it available with the settings configured by the admin_settings form

File

./isotope.module, line 67
Defines the default hooks that the history js module implements.

Code

function isotope_library() {
  $libraries = array();
  $libpath = libraries_get_path('isotope');
  $jspath = array();
  $jspath['jquery.isotope'] = $libpath . '/jquery.isotope.min.js';
  $jspath['jquery.infinitescroll'] = $libpath . '/js/jquery.infinitescroll.min.js';
  $jspath['jquery.bbq'] = $libpath . '/js/jquery.ba-bbq.min.js';
  $jspath['isotope.jquery'] = $libpath . '/js/jquery-1.7.1.min.js';
  $dependencies = array();
  $settings = variable_get('isotope_libraries', array());
  $useisobbq = !empty($settings['jquery.ba-bbq']);
  $useisoscroll = !empty($settings['jquery.infinitescroll']);
  $libraries['jquery.isotope'] = array(
    'title' => 'David Desandro\'s Isotope.js',
    'website' => 'https://github.com/desandro/isotope/',
    'version' => '1.5.03',
    'js' => array(
      $jspath['jquery.isotope'] => array(),
    ),
    'dependencies' => array(),
  );
  $libraries['jquery.infinitescroll'] = array(
    'title' => 'David Desandro\'s Isotope.js',
    'website' => 'https://github.com/desandro/isotope/',
    'version' => '2.0b2.110713',
    'js' => array(
      $jspath['jquery.infinitescroll'] => array(),
    ),
  );
  $libraries['jquery.bbq'] = array(
    'title' => 'jQuery BBQ',
    'website' => 'http://benalman.com/projects/jquery-bbq-plugin/',
    'version' => '1.2.1',
    'js' => array(
      $jspath['jquery.bbq'] => array(),
    ),
  );
  if ($useisoscroll) {
    $libraries['jquery.isotope']['dependencies'][] = array(
      'isotope',
      'jquery.infinitescroll',
    );
  }
  if ($useisobbq) {
    $libraries['jquery.isotope']['dependencies'][] = array(
      'system',
      'jquery.bbq',
    );
  }
  return $libraries;
}