gotohayato.com

月(ダークモード)
太陽(ライトモード)

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
    • description

Drupal 7 core JavaScript libraries

  • drupal.ajax
    • Drupal AJAX
    • Ajax framework | ajax.inc | Drupal 7.x | Drupal API
    • Drupal’s original library. Provides assets for Drupal’s Ajax framework.
  • 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
    • Accordion | jQuery UI
    • Displays collapsible content panels for presenting information in a limited amount of space.
  • ui.autocomplete
    • jQuery UI: Autocomplete
    • Autocomplete | jQuery UI
    • 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
    • Button | jQuery UI
    • Enhances standard form elements like buttons, inputs and anchors to themeable buttons with appropriate hover and active styles.
  • ui.datepicker
  • ui.dialog
  • ui.draggable
  • ui.droppable
  • ui.mouse
  • ui.position
    • jQuery UI: Position
    • Position | jQuery UI
    • Position an element relative to the window, document, another element, or the cursor/mouse.
  • ui.progressbar
  • ui.resizable
  • ui.selectable
  • ui.slider
  • ui.sortable
  • ui.tabs
    • jQuery UI: Tabs
    • Tabs | jQuery UI
    • A single content area with multiple panels, each associated with a header in a list.
  • ui.widget
  • effects
  • effects.blind
  • effects.bounce
  • effects.clip
  • effects.drop
  • effects.explode
  • effects.fade
  • effects.fold
  • effects.highlight
  • effects.pulsate
  • effects.scale
  • effects.shake
  • effects.slide
  • 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');

参考


後藤隼人
ウェブサイト制作・ウェブアプリ開発やマーケティングをしています。
GitHub
© 2020 gotohayato.com
サイトについてタグアーカイブメッセージを送る