You are here

function navbar_libraries_info in Navbar 7

Implements hook_libraries_info().

See also

Libraries module.

File

./navbar.module, line 823
Administration navbar for quick access to top level administration items.

Code

function navbar_libraries_info() {
  $libraries = array();
  $common = array(
    'version callback' => '_navbar_libraries_get_version',
    'variant order' => array(
      'minified',
      'source',
    ),
  );
  $libraries['modernizr'] = array(
    'name' => 'Modernizr',
    'vendor url' => 'https://github.com/Modernizr/Modernizr',
    'download url' => 'http://modernizr.com/download/#-inputtypes-svg-touch-cssclasses-addtest-teststyles-prefixes-elem_details',
    'version arguments' => array(
      'variants' => array(
        'source' => array(
          'file' => 'modernizr.js',
          // @todo Document an actual example version string.
          'pattern' => '#[Mm]odernizr\\s+[Vv]?([0-9\\.]+)#',
        ),
        'minified' => array(
          'file' => 'modernizr-min.js',
          'pattern' => '#[Mm]odernizr\\s+[Vv]?([0-9\\.]+)#',
        ),
        'minified standard' => array(
          'file' => 'modernizr.min.js',
          'pattern' => '#[Mm]odernizr\\s+[Vv]?([0-9\\.]+)#',
        ),
      ),
    ),
    'versions' => array(
      // Means ">=2.6.2": matches 2.6.2, 2.7.1, etc.
      '2.6.2' => array(
        'variants' => array(
          'source' => array(
            'files' => array(
              'js' => array(
                'modernizr.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'modernizr.js',
            ),
          ),
          'minified' => array(
            'files' => array(
              'js' => array(
                'modernizr-min.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'modernizr-min.js',
            ),
          ),
          'minified standard' => array(
            'files' => array(
              'js' => array(
                'modernizr.min.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'modernizr.min.js',
            ),
          ),
        ),
      ),
    ),
  );
  $libraries['modernizr'] += $common;
  array_unshift($libraries['modernizr']['variant order'], 'minified standard');
  $libraries['underscore'] = array(
    'name' => 'Underscore',
    'vendor url' => 'http://documentcloud.github.io/backbone/',
    'download url' => 'https://github.com/jashkenas/underscore/archive/1.5.2.zip',
    'version arguments' => array(
      'variants' => array(
        'source' => array(
          'file' => 'underscore.js',
          // @todo Document an actual example version string.
          'pattern' => '#VERSION *\\W *[\'\\"]{1}(.*?)[\'\\"]{1}#',
          // In the unminified Underscore.js 1.5.2, the version is defined on
          // line 68.
          'lines' => 100,
        ),
        'minified' => array(
          'file' => 'underscore-min.js',
          'pattern' => '#VERSION *\\W *[\'\\"]{1}(.*?)[\'\\"]{1}#',
        ),
      ),
    ),
    'versions' => array(
      // Means ">=1.5.0": matches 1.5.0, 1.5.2, etc.
      '1.5.0' => array(
        'variants' => array(
          'source' => array(
            'files' => array(
              'js' => array(
                'underscore.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'underscore.js',
            ),
          ),
          'minified' => array(
            'files' => array(
              'js' => array(
                'underscore-min.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'underscore-min.js',
            ),
          ),
        ),
      ),
    ),
  );
  $libraries['underscore'] += $common;
  $libraries['backbone'] = array(
    'name' => 'Backbone',
    'vendor url' => 'http://documentcloud.github.io/backbone/',
    'download url' => 'https://github.com/jashkenas/backbone/archive/1.1.0.zip',
    'version arguments' => array(
      'variants' => array(
        'source' => array(
          'file' => 'backbone.js',
          // @todo Document an actual example version string.
          'pattern' => '#VERSION *\\W *[\'\\"]{1}(.*?)[\'\\"]{1}#',
          // In the unminified Backbone.js 1.1.0, the version is defined on line
          // 38.
          'lines' => 50,
        ),
        'minified' => array(
          'file' => 'backbone-min.js',
          'pattern' => '#VERSION *\\W *[\'\\"]{1}(.*?)[\'\\"]{1}#',
        ),
      ),
    ),
    'versions' => array(
      // Means ">=1.0.0": matches 1.0.0, 1.1.0, etc.
      '1.0.0' => array(
        'variants' => array(
          'source' => array(
            'name' => 'Backbone',
            'files' => array(
              'js' => array(
                'backbone.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'backbone.js',
            ),
            'dependencies' => array(
              'underscore (>=1.5.0)',
            ),
          ),
          'minified' => array(
            'name' => 'Backbone',
            'files' => array(
              'js' => array(
                'backbone-min.js',
              ),
            ),
            // Without a variant callback, the variant is assumed to be
            // installed.
            'variant callback' => '_navbar_libraries_variant_exists',
            'variant arguments' => array(
              'backbone-min.js',
            ),
            'dependencies' => array(
              'underscore (>=1.5.0)',
            ),
          ),
        ),
      ),
    ),
  );
  $libraries['backbone'] += $common;
  return $libraries;
}