diff --git a/core/misc/announce.js b/core/misc/announce.js index 235c597ecc36a558310c1c2058b2eff46677e51c..acf850a641476530e8008e646807ecf9558b2654 100644 --- a/core/misc/announce.js +++ b/core/misc/announce.js @@ -29,6 +29,9 @@ * Builds a div element with the aria-live attribute and add it to the DOM. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches the behavior for drupalAnnouce. */ Drupal.behaviors.drupalAnnounce = { attach: function (context) { @@ -98,6 +101,7 @@ * 'polite' or 'assertive'. * * @return {function} + * The return of the call to debounce. * * @see http://www.w3.org/WAI/PF/aria-practices/#liveprops */ diff --git a/core/misc/autocomplete.js b/core/misc/autocomplete.js index afcc84b674b556382f27ffb37138e321d8635c45..ff9ff145d3786917ec544e379420a8892c645558 100644 --- a/core/misc/autocomplete.js +++ b/core/misc/autocomplete.js @@ -15,8 +15,10 @@ * @function Drupal.autocomplete.splitValues * * @param {string} value + * The value being entered by the user. * * @return {Array} + * Array of values, split by comma. */ function autocompleteSplitValues(value) { // We will match the value against comma-separated terms. @@ -53,8 +55,10 @@ * @function Drupal.autocomplete.extractLastTerm * * @param {string} terms + * The value of the field. * * @return {string} + * The last value of the input field. */ function extractLastTerm(terms) { return autocomplete.splitValues(terms).pop(); @@ -66,8 +70,10 @@ * @function Drupal.autocomplete.options.search * * @param {object} event + * The event triggered. * * @return {bool} + * Whether to perform a search or not. */ function searchHandler(event) { var options = autocomplete.options; @@ -84,7 +90,9 @@ * JQuery UI autocomplete source callback. * * @param {object} request + * The request object. * @param {function} response + * The function to call with the response. */ function sourceData(request, response) { var elementId = this.element.attr('id'); @@ -98,6 +106,7 @@ * display the available terms to the user. * * @param {object} suggestions + * Suggestions returned by the server. */ function showSuggestions(suggestions) { var tagged = autocomplete.splitValues(request.term); @@ -115,6 +124,7 @@ * Transforms the data object into an array and update autocomplete results. * * @param {object} data + * The data sent back from the server. */ function sourceCallbackHandler(data) { autocomplete.cache[elementId][term] = data; @@ -140,6 +150,7 @@ * Handles an autocompletefocus event. * * @return {bool} + * Always returns false. */ function focusHandler() { return false; @@ -149,9 +160,12 @@ * Handles an autocompleteselect event. * * @param {jQuery.Event} event + * The event triggered. * @param {object} ui + * The jQuery UI settings object. * * @return {bool} + * Returns false to indicate the event status. */ function selectHandler(event, ui) { var terms = autocomplete.splitValues(event.target.value); @@ -172,10 +186,13 @@ /** * Override jQuery UI _renderItem function to output HTML by default. * - * @param {object} ul + * @param {jQuery} ul + * jQuery collection of the ul element. * @param {object} item + * The list item to append. * - * @return {object} + * @return {jQuery} + * jQuery collection of the ul element. */ function renderItem(ul, item) { return $('<li>') @@ -187,6 +204,11 @@ * Attaches the autocomplete behavior to all required fields. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches the autocomplete behaviors. + * @prop {Drupal~behaviorDetach} detach + * Detaches the autocomplete behaviors. */ Drupal.behaviors.autocomplete = { attach: function (context) { diff --git a/core/misc/collapse.js b/core/misc/collapse.js index f6356474a3aaf8caaf6bc374bda14d1b2fb28df9..767325ec1ad7d060765b389b0d5a9a34516c21f0 100644 --- a/core/misc/collapse.js +++ b/core/misc/collapse.js @@ -13,6 +13,7 @@ * @constructor Drupal.CollapsibleDetails * * @param {HTMLElement} node + * The details element. */ function CollapsibleDetails(node) { this.$node = $(node); @@ -82,6 +83,7 @@ * Handle legend clicks. * * @param {jQuery.Event} e + * The event triggered. */ onLegendClick: function (e) { this.toggle(); @@ -120,6 +122,9 @@ * Polyfill HTML5 details element. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches behavior for the details element. */ Drupal.behaviors.collapse = { attach: function (context) { diff --git a/core/misc/dialog/dialog.ajax.js b/core/misc/dialog/dialog.ajax.js index bfe2980639d4ff661e2af261c27feef42bfd4626..16f72f00ab9b0871931a60fa2a57be16493553dd 100644 --- a/core/misc/dialog/dialog.ajax.js +++ b/core/misc/dialog/dialog.ajax.js @@ -11,6 +11,9 @@ * Initialize dialogs for Ajax purposes. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches the behaviors for dialog ajax functionality. */ Drupal.behaviors.dialog = { attach: function (context, settings) { @@ -90,10 +93,14 @@ * Command to open a dialog. * * @param {Drupal.Ajax} ajax + * The Drupal Ajax object. * @param {object} response + * Object holding the server response. * @param {number} [status] + * The HTTP status code. * * @return {bool|undefined} + * Returns false if there was no selector property in the response object. */ Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) { if (!response.selector) { @@ -146,10 +153,15 @@ * If no selector is given, it defaults to trying to close the modal. * * @param {Drupal.Ajax} [ajax] + * The ajax object. * @param {object} response + * Object holding the server response. * @param {string} response.selector + * The selector of the dialog. * @param {bool} response.persist + * Whether to persist the dialog element or not. * @param {number} [status] + * The HTTP status code. */ Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) { var $dialog = $(response.selector); @@ -170,11 +182,17 @@ * JQuery UI specific way of setting dialog options. * * @param {Drupal.Ajax} [ajax] + * The Drupal Ajax object. * @param {object} response + * Object holding the server response. * @param {string} response.selector + * Selector for the dialog element. * @param {string} response.optionsName + * Name of a key to set. * @param {string} response.optionValue + * Value to set. * @param {number} [status] + * The HTTP status code. */ Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) { var $dialog = $(response.selector); @@ -187,9 +205,13 @@ * Binds a listener on dialog creation to handle the cancel link. * * @param {jQuery.Event} e + * The event triggered. * @param {Drupal.dialog~dialogDefinition} dialog + * The dialog instance. * @param {jQuery} $element - * @param {object} settings + * The jQuery collection of the dialog element. + * @param {object} [settings] + * Dialog settings. */ $(window).on('dialog:aftercreate', function (e, dialog, $element, settings) { $element.on('click.dialog', '.dialog-cancel', function (e) { @@ -203,8 +225,11 @@ * Removes all 'dialog' listeners. * * @param {jQuery.Event} e + * The event triggered. * @param {Drupal.dialog~dialogDefinition} dialog + * The dialog instance. * @param {jQuery} $element + * jQuery collection of the dialog element. */ $(window).on('dialog:beforeclose', function (e, dialog, $element) { $element.off('.dialog'); diff --git a/core/misc/dialog/dialog.js b/core/misc/dialog/dialog.js index 197fae227313e535be5167b4b3cf996c09369dfb..ea1e52c8dc9aa7414d03c84650b2e7ba0ca85045 100644 --- a/core/misc/dialog/dialog.js +++ b/core/misc/dialog/dialog.js @@ -55,10 +55,12 @@ * Polyfill HTML5 dialog element with jQueryUI. * * @param {HTMLElement} element + * The element that holds the dialog. * @param {object} options * jQuery UI options to be passed to the dialog. * * @return {Drupal.dialog~dialogDefinition} + * The dialog instance. */ Drupal.dialog = function (element, options) { var undef; diff --git a/core/misc/dialog/dialog.position.js b/core/misc/dialog/dialog.position.js index c0dd9df0e1aaebaac3fe0dd01604f6c1b973a2b8..76786460a3b36b0ca9f7c06981b44ea3828abbbc 100644 --- a/core/misc/dialog/dialog.position.js +++ b/core/misc/dialog/dialog.position.js @@ -27,6 +27,7 @@ * @function Drupal.dialog~resetSize * * @param {jQuery.Event} event + * The event triggered. * * @fires event:dialogContentResize */ @@ -67,8 +68,10 @@ * @function Drupal.dialog~resetPosition * * @param {object} options + * Options object. * * @return {object} + * Altered options object. */ function resetPosition(options) { var offsets = displace.offsets; diff --git a/core/misc/dropbutton/dropbutton.js b/core/misc/dropbutton/dropbutton.js index ef707a6c84c760324200339b4f112f95671c71cf..04f9491ad7398d52d4e18a930a15db3f166e09e3 100644 --- a/core/misc/dropbutton/dropbutton.js +++ b/core/misc/dropbutton/dropbutton.js @@ -11,6 +11,9 @@ * Process elements with the .dropbutton class on page load. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches dropButton behaviors. */ Drupal.behaviors.dropButton = { attach: function (context, settings) { @@ -36,6 +39,7 @@ * @function Drupal.DropButton~dropbuttonClickHandler * * @param {jQuery.Event} e + * The event triggered. */ function dropbuttonClickHandler(e) { e.preventDefault(); @@ -190,6 +194,7 @@ /** * @param {jQuery.Event} e + * The event triggered. */ focusOut: function (e) { this.hoverOut.call(this, e); @@ -197,6 +202,7 @@ /** * @param {jQuery.Event} e + * The event triggered. */ focusIn: function (e) { this.hoverIn.call(this, e); @@ -209,6 +215,7 @@ * A toggle is an interactive element often bound to a click handler. * * @param {object} options + * Options object. * @param {string} [options.title] * The HTML anchor title attribute and text for the inner span element. * diff --git a/core/misc/drupal.js b/core/misc/drupal.js index f19fc431499f15639f5184c9763f9c3ed7a19092..750d908245b65b2d587ba34a27cff5726b1b4158 100644 --- a/core/misc/drupal.js +++ b/core/misc/drupal.js @@ -273,6 +273,7 @@ if (window.jQuery) { * `{@link Drupal.theme}('placeholder')`). * * @return {string} + * The formatted string. * * @see Drupal.t */ diff --git a/core/misc/form.js b/core/misc/form.js index f2bf08ac120c2bd38ec0d4081aeae26fe953910d..7ca64fc4257cafc52c5195a5379340814296af25 100644 --- a/core/misc/form.js +++ b/core/misc/form.js @@ -20,6 +20,7 @@ * Retrieves the summary for the first element. * * @return {string} + * The text of the summary. */ $.fn.drupalGetSummary = function () { var callback = this.data('summaryCallback'); @@ -34,6 +35,7 @@ * retrieved or a string (which is returned each time). * * @return {jQuery} + * jQuery collection of the current element. * * @fires event:summaryUpdated * @@ -125,6 +127,7 @@ * Sends a 'formUpdated' event each time a form element is modified. * * @param {HTMLElement} element + * The element to trigger a form updated event on. * * @fires event:formUpdated */ @@ -136,8 +139,10 @@ * Collects the IDs of all form fields in the given form. * * @param {HTMLFormElement} form + * The form element to search. * * @return {Array} + * Array of IDs for form fields. */ function fieldsList(form) { var $fieldList = $(form).find('[name]').map(function (index, element) { @@ -154,6 +159,11 @@ * * @type {Drupal~behavior} * + * @prop {Drupal~behaviorAttach} attach + * Attaches formUpdated behaviors. + * @prop {Drupal~behaviorDetach} detach + * Detaches formUpdated behaviors. + * * @fires event:formUpdated */ Drupal.behaviors.formUpdated = { @@ -208,6 +218,9 @@ * Prepopulate form fields with information from the visitor browser. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches the behavior for filling user info from browser. */ Drupal.behaviors.fillUserInfoFromBrowser = { attach: function (context, settings) { diff --git a/core/misc/machine-name.js b/core/misc/machine-name.js index 27016edb577897615225b0957a42c39ca098efed..bbad2e39d0d26854ef1acb1a28e8b738ad55258a 100644 --- a/core/misc/machine-name.js +++ b/core/misc/machine-name.js @@ -11,6 +11,9 @@ * Attach the machine-readable name form element behavior. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches machine-name behaviors. */ Drupal.behaviors.machineName = { @@ -18,7 +21,9 @@ * Attaches the behavior. * * @param {Element} context + * The context for attaching the behavior. * @param {object} settings + * Settings object. * @param {object} settings.machineName * A list of elements to process, keyed by the HTML ID of the form * element containing the human-readable value. Each element is an object diff --git a/core/misc/progress.js b/core/misc/progress.js index 26757518e275a9530eb1601591f7c6d919f016c1..a6694892b27023ea3abe56fe53c573c70c23d27a 100644 --- a/core/misc/progress.js +++ b/core/misc/progress.js @@ -11,6 +11,7 @@ * Theme function for the progress bar. * * @param {string} id + * The id for the progress bar. * * @return {string} * The HTML for the progress bar. @@ -38,9 +39,13 @@ * @constructor * * @param {string} id + * The id for the progressbar. * @param {function} updateCallback + * Callback to run on update. * @param {string} method + * HTTP method to use. * @param {function} errorCallback + * Callback to call on error. */ Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) { this.id = id; @@ -61,8 +66,11 @@ * Set the percentage and status message for the progressbar. * * @param {number} percentage + * The progress percentage. * @param {string} message + * The message to show the user. * @param {string} label + * The text for the progressbar label. */ setProgress: function (percentage, message, label) { if (percentage >= 0 && percentage <= 100) { @@ -80,7 +88,9 @@ * Start monitoring progress via Ajax. * * @param {string} uri + * The URI to use for monitoring. * @param {number} delay + * The delay for calling the monitoring URI. */ startMonitoring: function (uri, delay) { this.delay = delay; @@ -144,6 +154,7 @@ * Display errors on the page. * * @param {string} string + * The error message to show the user. */ displayError: function (string) { var error = $('<div class="messages messages--error"></div>').html(string); diff --git a/core/misc/states.js b/core/misc/states.js index 30c938ff00f8e6defffe72ae62da25cc22eae38a..923d0794f569218cf497aa7fdc71104cad5e0ba5 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -27,6 +27,9 @@ * Attaches the states. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches states behaviors. */ Drupal.behaviors.states = { attach: function (context, settings) { @@ -329,6 +332,7 @@ * @memberof Drupal.states.Dependent# * * @return {object} + * An object describing the required triggers. */ getDependees: function () { var cache = {}; @@ -359,6 +363,7 @@ * @constructor Drupal.states.Trigger * * @param {object} args + * Trigger arguments. */ states.Trigger = function (args) { $.extend(this, args); @@ -402,7 +407,9 @@ * @memberof Drupal.states.Trigger# * * @param {jQuery.Event} event + * The event triggered. * @param {function} valueFn + * The function to call. */ defaultTrigger: function (event, valueFn) { var oldValue = valueFn.call(this.element); @@ -498,6 +505,7 @@ * @constructor Drupal.states.State * * @param {string} state + * The name of the state. */ states.State = function (state) { @@ -531,8 +539,10 @@ * @name Drupal.states.State.sanitize * * @param {string|Drupal.states.State} state + * A state object or the name of a state. * * @return {Drupal.states.state} + * A state object. */ states.State.sanitize = function (state) { if (state instanceof states.State) { @@ -577,6 +587,7 @@ * @memberof Drupal.states.State# * * @return {string} + * The name of the state. */ toString: function () { return this.name; @@ -651,9 +662,12 @@ * @function Drupal.states~ternary * * @param {*} a + * Value a. * @param {*} b + * Value b * * @return {bool} + * The result. */ function ternary(a, b) { if (typeof a === 'undefined') { @@ -673,9 +687,12 @@ * @function Drupal.states~invert * * @param {*} a + * The value to maybe invert. * @param {bool} invertState + * Whether to invert state or not. * * @return {bool} + * The result. */ function invert(a, invertState) { return (invertState && typeof a !== 'undefined') ? !a : a; @@ -687,9 +704,12 @@ * @function Drupal.states~compare * * @param {*} a + * Value a. * @param {*} b + * Value b. * * @return {bool} + * The comparison result. */ function compare(a, b) { if (a === b) { diff --git a/core/misc/tabbingmanager.js b/core/misc/tabbingmanager.js index ca4991bc4e2bcc1e1c448e2a2ea62bd7b9052a02..134523f5bf97b320a421dc670a99d2f336650308 100644 --- a/core/misc/tabbingmanager.js +++ b/core/misc/tabbingmanager.js @@ -66,6 +66,7 @@ * be a jQuery-compatible selector string. * * @return {Drupal~TabbingContext} + * The TabbingContext instance. * * @fires event:drupalTabbingConstrained */ diff --git a/core/misc/tableheader.js b/core/misc/tableheader.js index 7d55a0486b71c6e468d478fff5df658433ee95d8..8fc1b048963c90fabad8b08e864e875a51714bc7 100644 --- a/core/misc/tableheader.js +++ b/core/misc/tableheader.js @@ -11,6 +11,9 @@ * Attaches sticky table headers. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches the sticky table header behavior. */ Drupal.behaviors.tableHeader = { attach: function (context) { @@ -215,9 +218,12 @@ * Set absolute position of sticky. * * @param {number} offsetTop + * The top offset for the sticky header. * @param {number} offsetLeft + * The left offset for the sticky header. * * @return {jQuery} + * The sticky table as a jQuery collection. */ stickyPosition: function (offsetTop, offsetLeft) { var css = {}; @@ -234,6 +240,7 @@ * Returns true if sticky is currently visible. * * @return {bool} + * The visibility status. */ checkStickyVisible: function () { var scrollTop = scrollValue('scrollTop'); @@ -256,6 +263,7 @@ * calls. * * @param {jQuery.Event} e + * The scroll event. */ onScroll: function (e) { this.checkStickyVisible(); diff --git a/core/misc/tableresponsive.js b/core/misc/tableresponsive.js index 04965efc468088a77d9c76755d7bc84f9766e306..0127ec88735b3b03fd77996ac3623a26cab5cb90 100644 --- a/core/misc/tableresponsive.js +++ b/core/misc/tableresponsive.js @@ -11,6 +11,9 @@ * Attach the tableResponsive function to {@link Drupal.behaviors}. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches tableResponsive functionality. */ Drupal.behaviors.tableResponsive = { attach: function (context, settings) { @@ -37,6 +40,7 @@ * @constructor Drupal.TableResponsive * * @param {HTMLElement} table + * The table element to initialize the responsive table on. */ function TableResponsive(table) { this.table = table; @@ -82,6 +86,7 @@ /** * @param {jQuery.Event} e + * The event triggered. */ eventhandlerEvaluateColumnVisibility: function (e) { var pegged = parseInt(this.$link.data('pegged'), 10); @@ -105,6 +110,7 @@ * Columns are classed with either 'priority-low' or 'priority-medium'. * * @param {jQuery.Event} e + * The event triggered. */ eventhandlerToggleColumns: function (e) { e.preventDefault(); diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js index 2011374ce9413ecc4e2ec694f81b301a9518b05c..053af05d9bcbc1f891a340ec3ad5e2324966ad49 100644 --- a/core/misc/tableselect.js +++ b/core/misc/tableselect.js @@ -11,6 +11,9 @@ * Initialize tableSelects. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches tableSelect functionality. */ Drupal.behaviors.tableSelect = { attach: function (context, settings) { @@ -117,8 +120,11 @@ /** * @param {HTMLElement} from + * The HTML element representing the "from" part of the range. * @param {HTMLElement} to + * The HTML element representing the "to" part of the range. * @param {bool} state + * The state to set on the range. */ Drupal.tableSelectRange = function (from, to, state) { // We determine the looping mode based on the order of from and to. diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index 2794481d3f4475954363c180aa491fc004693bd8..51038bc28a9fc08f8ad04fdecf6bee92cfc89a60 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -26,6 +26,9 @@ * element inside the tab pane. * * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches behaviors for vertical tabs. */ Drupal.behaviors.verticalTabs = { attach: function (context) { @@ -99,6 +102,7 @@ * @constructor * * @param {object} settings + * Settings object. * @param {string} settings.title * The name of the tab. * @param {jQuery} settings.details @@ -171,6 +175,7 @@ * Shows a vertical tab pane. * * @return {Drupal.verticalTab} + * The verticalTab instance. */ tabShow: function () { // Display the tab. @@ -193,6 +198,7 @@ * Hides a vertical tab pane. * * @return {Drupal.verticalTab} + * The verticalTab instance. */ tabHide: function () { // Hide this tab.