You are here

function simple_dialog_add_js in Simple Dialog 7

Adds the necessary js and libraries to make the dialog work. Really just adds the jquery.ui library and the simple dialog javscript file but if we need to add anything else down the road, at least it's abstracted into an api function

1 call to simple_dialog_add_js()
simple_dialog_init in ./simple_dialog.module
Implements hook_init().

File

./simple_dialog.module, line 296

Code

function simple_dialog_add_js() {
  drupal_add_library('system', 'ui.dialog');
  drupal_add_js(drupal_get_path('module', 'simple_dialog') . '/js/simple_dialog.js');
  if ($classes = variable_get('simple_dialog_classes', '')) {
    $classes = str_replace(' ', ', .', $classes);
  }
  drupal_add_js(array(
    'simpleDialog' => array(
      'classes' => $classes,
      'defaults' => variable_get('simple_dialog_defaults', 'width:300;height:auto;position:[center,60]'),
      'selector' => variable_get('simple_dialog_default_target_selector', 'content'),
      'title' => variable_get('simple_dialog_default_dialog_title', ''),
    ),
  ), 'setting');
}