You are here

function beautytips_add_js in BeautyTips 7.2

Same name and namespace in other branches
  1. 8 beautytips.module \beautytips_add_js()

Add the basic beautytips javascript to the page.

1 call to beautytips_add_js()
beautytips_add_beautytips in ./beautytips.module
This is the API. Call this function to add beautytips.

File

./beautytips.module, line 138
Provides API for adding beautytips to pages.

Code

function beautytips_add_js() {
  $added =& drupal_static(__FUNCTION__, FALSE);
  if (!$added) {

    // Add beautytips jQuery plugin and module js.
    drupal_add_library('beautytips', 'beautytips-module');

    // Add this for ie compatibility
    drupal_add_library('beautytips', 'excanvas_r3');
    if (variable_get('beautytips_ltr', FALSE)) {
      drupal_add_library('beautytips', 'beautytips-ltr');
    }

    // Add the styles info.
    $styles = beautytips_get_styles();
    drupal_add_js([
      'beautytipStyles' => $styles,
    ], 'setting');

    // Mark as added so we don't do it again.
    $added = TRUE;
  }
}