You are here

function shadowbox_library in Shadowbox 7.3

Same name and namespace in other branches
  1. 7.4 shadowbox.module \shadowbox_library()

Implements hook_library().

File

./shadowbox.module, line 31
Shadowbox, a JavaScript media viewer application for displaying content in a modal dialogue.

Code

function shadowbox_library() {
  $shadowbox_location = variable_get('shadowbox_location', SHADOWBOX_DEFAULT_PATH);
  $libraries['shadowbox'] = array(
    'title' => 'Shadowbox',
    'website' => 'http://www.shadowbox-js.com/',
    'version' => '3.0.3',
    'js' => array(
      $shadowbox_location . '/shadowbox.js' => array(),
      // Make sure to set the shadowbox path so that the language is set properly.
      array(
        'type' => 'setting',
        'data' => _shadowbox_get_settings(),
      ),
      array(
        'type' => 'inline',
        'scope' => 'header',
        'group' => JS_THEME,
        'data' => '
          Shadowbox.path = "' . base_path() . $shadowbox_location . '/";
        ',
      ),
      drupal_get_path('module', 'shadowbox') . '/shadowbox_auto.js' => array(),
    ),
    'css' => array(
      variable_get('shadowbox_location', SHADOWBOX_DEFAULT_PATH) . '/shadowbox.css' => array(
        'type' => 'file',
        'media' => 'screen',
      ),
      array(
        'type' => 'inline',
        'media' => 'print',
        'data' => '
          #sb-container { position: relative; }
          #sb-overlay { display: none; }
          #sb-wrapper { position: relative; top: 0; left: 0; }
          #sb-loading { display: none; }
        ',
      ),
    ),
  );
  return $libraries;
}