You are here

protected function field_timer_formatter_js_base::loadJSandCSS in Field Timer 7.2

Load custom JS and CSS files and JS settings.

Parameters

@see hook_field_formatter_view().:

2 calls to field_timer_formatter_js_base::loadJSandCSS()
field_timer_county_base::renderItems in includes/field_timer_county.inc
@inheritdoc
field_timer_jquery_countdown_js_base::loadJSandCSS in includes/field_timer_base.inc
@inheritdoc
1 method overrides field_timer_formatter_js_base::loadJSandCSS()
field_timer_jquery_countdown_js_base::loadJSandCSS in includes/field_timer_base.inc
@inheritdoc

File

includes/field_timer_base.inc, line 124
Contains base help classes to perform field formatter related actions.

Class

field_timer_formatter_js_base
Base class for formatters using js library.

Code

protected function loadJSandCSS($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $js_settings = $this
    ->generateJSSettings($entity_type, $entity, $field, $instance, $langcode, $items, $display);
  drupal_add_js(array(
    'field_timer' => $js_settings,
  ), 'setting');
  drupal_add_js(drupal_get_path('module', 'field_timer') . '/js/field_timer.js');
}