You are here

function load_pace in PACE - Page load progress bar 7

Same name and namespace in other branches
  1. 8 pace.module \load_pace()
  2. 2.0.x pace.module \load_pace()
1 call to load_pace()
pace_preprocess_html in ./pace.module
Implements template_preprocess_html().

File

./pace.module, line 52
Loads PACE js.

Code

function load_pace() {
  drupal_add_js(drupal_get_path('module', 'pace') . '/js/pace.min.js', array(
    'weight' => -100,
    'preprocess' => TRUE,
  ));
  drupal_add_css(drupal_get_path('module', 'pace') . '/css/' . variable_get('pace_theme'), array(
    'weight' => -100,
    'preprocess' => TRUE,
  ));
  if (variable_get('pace_custom_color_enabled')) {
    $customcolor = '';
    $customcolor .= '.pace .pace-progress {';
    $customcolor .= 'background: #';
    $customcolor .= variable_get('pace_custom_color_value');
    $customcolor .= '; }';
    drupal_add_css($customcolor, 'inline');
  }
}