Libraries included in Drupal 7 core

Drupal 7

There're many JavaScript libraries included in the Drupal 7 core. Many of them are rarely used in custom modules (I haven't used many of them) but they're helpful in some situations and it's nice to kwow what are inside the core as baseline knowledge for Drupal development.

Here is a list of the libraries. Each library comprises of a machine name, title, website and description in the following format.

  • machine name
    • title
    • website (optional)
    • description

Drupal 7 core JavaScript libraries

  • drupal.ajax
  • drupal.batch
    • Drupal batch API
    • Drupal's original library. Provides assets for Drupal's batch system.
  • drupal.progress
    • Drupal progress indicator
    • Drupal's original library. Provides assets to show progress indicator.
  • drupal.form
    • Drupal form library
    • Drupal's original library. Provides form related assets.
  • drupal.states
    • Drupal states
    • Drupal's original library. Provides states API related assets.
  • drupal.collapse
    • Drupal collapsible fieldset
    • Drupal's original library. Provides assets for collapsible fieldset.
  • drupal.textarea
    • Drupal resizable textarea
    • Drupal's original library. Provides assets for resizable textarea.
  • drupal.autocomplete
    • Drupal autocomplete
    • Drupal's original library. Provides assets for autocomplete widget.
  • drupal.vertical-tabs
  • jquery
    • jQuery
    • jQuery
    • jQuery library everyone in the Web industry knows.
  • jquery.once
    • jQuery Once
    • jQuery Once | jQuery Plugin Registry
    • Filters out all elements that had the same filter applied on them before. It can be used to ensure that a function is only applied once to an element.
  • jquery.form
    • jQuery Form Plugin
    • jQuery Form Plugin
    • The jQuery Form Plugin allows you to easily and unobtrusively upgrade HTML forms to use AJAX.
  • jquery.bbq
    • jQuery BBQ
    • Ben Alman » jQuery BBQ: Back Button & Query Library
    • jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history. In addition, jQuery BBQ provides a full .deparam() method, along with both hash state management, and fragment / query string parse and merge utility methods.
  • farbtastic
    • Farbtastic
    • Farbtastic is a jQuery plug-in that can add one or more color picker widgets into a page.
  • jquery.cookie
  • ui
    • jQuery UI: Core
    • jQuery UI
    • jQuery UI everyone knows.
  • ui.accordion
    • jQuery UI: Accordion
    • Displays collapsible content panels for presenting information in a limited amount of space.
  • ui.autocomplete
    • jQuery UI: Autocomplete
    • Enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.
  • ui.button
    • jQuery UI: Button
    • Enhances standard form elements like buttons, inputs and anchors to themeable buttons with appropriate hover and active styles.
  • ui.datepicker
    • jQuery UI: Date Picker
    • Select a date from a popup or inline calendar
  • ui.dialog
    • jQuery UI: Dialog
    • Open content in an interactive overlay.
  • ui.draggable
    • jQuery UI: Draggable
    • Allow elements to be moved using the mouse.
  • ui.droppable
    • jQuery UI: Droppable
    • Create targets for draggable elements.
  • ui.mouse
  • ui.position
    • jQuery UI: Position
    • Position an element relative to the window, document, another element, or the cursor/mouse.
  • ui.progressbar
    • jQuery UI: Progress Bar
    • Display status of a determinate or indeterminate process.
  • ui.resizable
    • jQuery UI: Resizable
    • Change the size of an element using the mouse.
  • ui.selectable
    • jQuery UI: Selectable
    • Use the mouse to select elements, individually or in a group.
  • ui.slider
    • jQuery UI: Slider
    • Drag a handle to select a numeric value.
  • ui.sortable
    • jQuery UI: Sortable
    • Reorder elements in a list or grid using the mouse.
  • ui.tabs
    • jQuery UI: Tabs
    • A single content area with multiple panels, each associated with a header in a list.
  • ui.widget
    • jQuery UI: Widget
    • Widget Factory | jQuery UI
    • The jQuery UI Widget Factory is an extensible base on which all of jQuery UI's widgets are built.
  • effects
    • jQuery UI: Effects
  • effects.blind
    • jQuery UI: Effects Blind
  • effects.bounce
    • jQuery UI: Effects Bounce
  • effects.clip
    • jQuery UI: Effects Clip
  • effects.drop
    • jQuery UI: Effects Drop
  • effects.explode
    • jQuery UI: Effects Explode
  • effects.fade
    • jQuery UI: Effects Fade
  • effects.fold
    • jQuery UI: Effects Fold
  • effects.highlight
    • jQuery UI: Effects Highlight
  • effects.pulsate
    • jQuery UI: Effects Pulsate
  • effects.scale
    • jQuery UI: Effects Scale
  • effects.shake
    • jQuery UI: Effects Shake
  • effects.slide
    • jQuery UI: Effects Slide
  • effects.transfer
    • jQuery UI: Effects Transfer
  • contextual-links

These can be used in the following ways.

$render_array['#attached']['library'][] = [$module_name, $library_name];
// e.g. render_array['#attached']['library'][] = ['system', 'jquery.cookie'];
drupal_add_library($module_name, $library_name);
// e.g. drupal_add_library('system', 'jquery.cookie');

Reference


アバター
後藤隼人 ( ごとうはやと )

Python や PHP を使ってソフトウェア開発やウェブ制作をしています。詳しくはこちら