You are here

function activity_comments_add_js in Activity 6.2

Same name and namespace in other branches
  1. 7 activity_comments/activity_comments.module \activity_comments_add_js()

After build function to add the js to the page

1 string reference to 'activity_comments_add_js'
activity_comments_form in activity_comments/activity_comments.module
Add comment form.

File

activity_comments/activity_comments.module, line 227
Provides comment handling for activity messages

Code

function activity_comments_add_js($form, $form_state) {
  static $js_added = FALSE;
  if (!$js_added) {
    $js_added = TRUE;
    drupal_add_js(drupal_get_path('module', 'activity_comments') . '/activity_comments.js');

    // set the settings for the default text as well
    drupal_add_js(array(
      'activity_comments' => array(
        'destination' => drupal_get_destination(),
      ),
    ), 'setting');
    drupal_add_js(array(
      'activity_comments' => array(
        'default_text' => $form['activity_form_items']['activity_comment']['#default_value'],
      ),
    ), 'setting');
  }
  return $form;
}