You are here

function quickedit_library_alter in Quick Edit 7

Implements hook_library_alter().

Backport a couple of things from jQuery that are required by CreateJS/VIE.

File

./quickedit.module, line 700
Provides in-place content editing functionality for fields.

Code

function quickedit_library_alter(&$libraries, $module) {
  $jquery_version =& drupal_static(__FUNCTION__, NULL);
  if ($module == 'system') {
    $jquery_version = $libraries['jquery']['version'];
  }
  if ($jquery_version && $module == 'quickedit') {
    $path = drupal_get_path('module', 'quickedit');

    // If the version of jQuery is old, we need to add `addBack`.
    if ($jquery_version < '1.8') {
      $libraries['quickedit']['js'][$path . '/js/jquery/ducktape.addback.js'] = array(
        'group' => JS_LIBRARY,
      );
    }

    // If the version of jQuery is old, we need to add `on` and `off`.
    if ($jquery_version < '1.7') {
      $libraries['quickedit']['js'][$path . '/js/jquery/ducktape.events.js'] = array(
        'group' => JS_LIBRARY,
      );
    }

    // If the version of jQuery is old, we need to add `prop`.
    if ($jquery_version < '1.6') {
      $libraries['quickedit']['js'][$path . '/js/jquery/ducktape.prop.js'] = array(
        'group' => JS_LIBRARY,
      );
    }

    // If the version of jQuery is old, we need to add `deferred`.
    if ($jquery_version < '1.5') {
      $libraries['quickedit']['js'][$path . '/js/jquery/ducktape.deferred.js'] = array(
        'group' => JS_LIBRARY,
      );
    }
  }
}