WordPress/wp-includes/js/dist/dom-ready.js

76 lines
2.5 KiB
JavaScript
Raw Normal View History

/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/************************************************************************/
var __webpack_exports__ = {};
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ domReady; }
/* harmony export */ });
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.5.1 -> 2.6.0 @wordpress/annotations: 1.9.0 -> 1.10.0 @wordpress/api-fetch: 3.8.0 -> 3.9.0 @wordpress/blob: 2.5.1 -> 2.6.0 @wordpress/block-directory: 1.2.0 -> 1.3.0 @wordpress/block-editor: 3.4.0 -> 3.5.0 @wordpress/block-library: 2.11.0 -> 2.12.0 @wordpress/blocks: 6.9.0 -> 6.10.0 @wordpress/components: 8.5.0 -> 9.0.0 @wordpress/compose: 3.9.0 -> 3.10.0 @wordpress/core-data: 2.9.0 -> 2.10.0 @wordpress/data: 4.11.0 -> 4.12.0 @wordpress/data-controls: 1.5.0 -> 1.6.0 @wordpress/dom: 2.6.0 -> 2.7.0 @wordpress/dom-ready: 2.5.1 -> 2.6.0 @wordpress/e2e-test-utils: 4.0.0 -> 4.1.0 @wordpress/edit-post: 3.10.0 -> 3.11.0 @wordpress/editor: 9.9.0 -> 9.10.0 @wordpress/format-library: 1.11.0 -> 1.12.0 @wordpress/i18n: 3.7.0 -> 3.8.0 @wordpress/is-shallow-equal: 1.6.1 -> 1.7.0 @wordpress/keycodes: 2.7.0 -> 2.8.0 @wordpress/list-reusable-blocks: 1.10.0 -> 1.11.0 @wordpress/media-utils: 1.4.0 -> 1.5.0 @wordpress/notices: 1.10.0 -> 1.11.0 @wordpress/nux: 3.9.0 -> 3.10.0 @wordpress/plugins: 2.9.0 -> 2.10.0 @wordpress/priority-queue: 1.3.1 -> 1.4.0 @wordpress/rich-text: 3.9.0 -> 3.10.0 @wordpress/scripts: 6.1.1 -> 6.2.0 @wordpress/server-side-render: 1.5.0 -> 1.6.0 @wordpress/viewport: 2.10.0 -> 2.11.0 The following package was added: @wordpress/keyboard-shortcuts Props gziolo. Fixes #49204. Built from https://develop.svn.wordpress.org/trunk@47106 git-svn-id: http://core.svn.wordpress.org/trunk@46906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-22 23:06:21 +01:00
/**
* @typedef {() => void} Callback
*
* TODO: Remove this typedef and inline `() => void` type.
*
* This typedef is used so that a descriptive type is provided in our
* automatically generated documentation.
*
* An in-line type `() => void` would be preferable, but the generated
* documentation is `null` in that case.
*
* @see https://github.com/WordPress/gutenberg/issues/18045
*/
/**
* Specify a function to execute when the DOM is fully loaded.
*
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.5.1 -> 2.6.0 @wordpress/annotations: 1.9.0 -> 1.10.0 @wordpress/api-fetch: 3.8.0 -> 3.9.0 @wordpress/blob: 2.5.1 -> 2.6.0 @wordpress/block-directory: 1.2.0 -> 1.3.0 @wordpress/block-editor: 3.4.0 -> 3.5.0 @wordpress/block-library: 2.11.0 -> 2.12.0 @wordpress/blocks: 6.9.0 -> 6.10.0 @wordpress/components: 8.5.0 -> 9.0.0 @wordpress/compose: 3.9.0 -> 3.10.0 @wordpress/core-data: 2.9.0 -> 2.10.0 @wordpress/data: 4.11.0 -> 4.12.0 @wordpress/data-controls: 1.5.0 -> 1.6.0 @wordpress/dom: 2.6.0 -> 2.7.0 @wordpress/dom-ready: 2.5.1 -> 2.6.0 @wordpress/e2e-test-utils: 4.0.0 -> 4.1.0 @wordpress/edit-post: 3.10.0 -> 3.11.0 @wordpress/editor: 9.9.0 -> 9.10.0 @wordpress/format-library: 1.11.0 -> 1.12.0 @wordpress/i18n: 3.7.0 -> 3.8.0 @wordpress/is-shallow-equal: 1.6.1 -> 1.7.0 @wordpress/keycodes: 2.7.0 -> 2.8.0 @wordpress/list-reusable-blocks: 1.10.0 -> 1.11.0 @wordpress/media-utils: 1.4.0 -> 1.5.0 @wordpress/notices: 1.10.0 -> 1.11.0 @wordpress/nux: 3.9.0 -> 3.10.0 @wordpress/plugins: 2.9.0 -> 2.10.0 @wordpress/priority-queue: 1.3.1 -> 1.4.0 @wordpress/rich-text: 3.9.0 -> 3.10.0 @wordpress/scripts: 6.1.1 -> 6.2.0 @wordpress/server-side-render: 1.5.0 -> 1.6.0 @wordpress/viewport: 2.10.0 -> 2.11.0 The following package was added: @wordpress/keyboard-shortcuts Props gziolo. Fixes #49204. Built from https://develop.svn.wordpress.org/trunk@47106 git-svn-id: http://core.svn.wordpress.org/trunk@46906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-22 23:06:21 +01:00
* @param {Callback} callback A function to execute after the DOM is ready.
*
Block Editor: Update the WordPress Packages from Gutenberg 5.3 - @wordpress/a11y@2.2.0 - @wordpress/annotations@1.2.0 - @wordpress/api-fetch@3.1.0 - @wordpress/autop@2.2.0 - @wordpress/babel-plugin-import-jsx-pragma@2.1.0 - @wordpress/babel-preset-default@4.1.0 - @wordpress/blob@2.3.0 - @wordpress/block-editor@1.1.0 - @wordpress/block-library@2.4.0 - @wordpress/block-serialization-default-parser@3.1.0 - @wordpress/blocks@6.2.0 - @wordpress/components@7.2.0 - @wordpress/compose@3.2.0 - @wordpress/core-data@2.2.0 - @wordpress/data@4.4.0 - @wordpress/date@3.2.0 - @wordpress/deprecated@2.2.0 - @wordpress/docgen@1.1.0 - @wordpress/dom-ready@2.2.0 - @wordpress/dom@2.2.0 - @wordpress/e2e-test-utils@1.1.0 - @wordpress/e2e-tests@1.1.0 - @wordpress/edit-post@3.3.0 - @wordpress/edit-widgets@0.2.0 - @wordpress/editor@9.2.0 - @wordpress/element@2.3.0 - @wordpress/escape-html@1.2.0 - @wordpress/eslint-plugin@2.1.0 - @wordpress/format-library@1.4.0 - @wordpress/hooks@2.2.0 - @wordpress/html-entities@2.2.0 - @wordpress/i18n@3.3.0 - @wordpress/keycodes@2.2.0 - @wordpress/list-reusable-blocks@1.3.0 - @wordpress/notices@1.3.0 - @wordpress/nux@3.2.0 - @wordpress/plugins@2.2.0 - @wordpress/priority-queue@1.1.0 - @wordpress/redux-routine@3.2.0 - @wordpress/rich-text@3.2.0 - @wordpress/scripts@3.1.0 - @wordpress/shortcode@2.2.0 - @wordpress/url@2.5.0 - @wordpress/viewport@2.3.0 - @wordpress/wordcount@2.2.0 Built from https://develop.svn.wordpress.org/trunk@44960 git-svn-id: http://core.svn.wordpress.org/trunk@44791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 13:48:00 +01:00
* @example
* ```js
* import domReady from '@wordpress/dom-ready';
*
* domReady( function() {
* //do something after DOM loads.
* } );
* ```
*
* @return {void}
*/
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.5.1 -> 2.6.0 @wordpress/annotations: 1.9.0 -> 1.10.0 @wordpress/api-fetch: 3.8.0 -> 3.9.0 @wordpress/blob: 2.5.1 -> 2.6.0 @wordpress/block-directory: 1.2.0 -> 1.3.0 @wordpress/block-editor: 3.4.0 -> 3.5.0 @wordpress/block-library: 2.11.0 -> 2.12.0 @wordpress/blocks: 6.9.0 -> 6.10.0 @wordpress/components: 8.5.0 -> 9.0.0 @wordpress/compose: 3.9.0 -> 3.10.0 @wordpress/core-data: 2.9.0 -> 2.10.0 @wordpress/data: 4.11.0 -> 4.12.0 @wordpress/data-controls: 1.5.0 -> 1.6.0 @wordpress/dom: 2.6.0 -> 2.7.0 @wordpress/dom-ready: 2.5.1 -> 2.6.0 @wordpress/e2e-test-utils: 4.0.0 -> 4.1.0 @wordpress/edit-post: 3.10.0 -> 3.11.0 @wordpress/editor: 9.9.0 -> 9.10.0 @wordpress/format-library: 1.11.0 -> 1.12.0 @wordpress/i18n: 3.7.0 -> 3.8.0 @wordpress/is-shallow-equal: 1.6.1 -> 1.7.0 @wordpress/keycodes: 2.7.0 -> 2.8.0 @wordpress/list-reusable-blocks: 1.10.0 -> 1.11.0 @wordpress/media-utils: 1.4.0 -> 1.5.0 @wordpress/notices: 1.10.0 -> 1.11.0 @wordpress/nux: 3.9.0 -> 3.10.0 @wordpress/plugins: 2.9.0 -> 2.10.0 @wordpress/priority-queue: 1.3.1 -> 1.4.0 @wordpress/rich-text: 3.9.0 -> 3.10.0 @wordpress/scripts: 6.1.1 -> 6.2.0 @wordpress/server-side-render: 1.5.0 -> 1.6.0 @wordpress/viewport: 2.10.0 -> 2.11.0 The following package was added: @wordpress/keyboard-shortcuts Props gziolo. Fixes #49204. Built from https://develop.svn.wordpress.org/trunk@47106 git-svn-id: http://core.svn.wordpress.org/trunk@46906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-22 23:06:21 +01:00
function domReady(callback) {
if (typeof document === 'undefined') {
return;
}
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
) {
return void callback();
} // DOMContentLoaded has not fired yet, delay callback until then.
document.addEventListener('DOMContentLoaded', callback);
Block Editor: Update WordPress Packages. The following package versions were changed: @wordpress/a11y: 2.5.1 -> 2.6.0 @wordpress/annotations: 1.9.0 -> 1.10.0 @wordpress/api-fetch: 3.8.0 -> 3.9.0 @wordpress/blob: 2.5.1 -> 2.6.0 @wordpress/block-directory: 1.2.0 -> 1.3.0 @wordpress/block-editor: 3.4.0 -> 3.5.0 @wordpress/block-library: 2.11.0 -> 2.12.0 @wordpress/blocks: 6.9.0 -> 6.10.0 @wordpress/components: 8.5.0 -> 9.0.0 @wordpress/compose: 3.9.0 -> 3.10.0 @wordpress/core-data: 2.9.0 -> 2.10.0 @wordpress/data: 4.11.0 -> 4.12.0 @wordpress/data-controls: 1.5.0 -> 1.6.0 @wordpress/dom: 2.6.0 -> 2.7.0 @wordpress/dom-ready: 2.5.1 -> 2.6.0 @wordpress/e2e-test-utils: 4.0.0 -> 4.1.0 @wordpress/edit-post: 3.10.0 -> 3.11.0 @wordpress/editor: 9.9.0 -> 9.10.0 @wordpress/format-library: 1.11.0 -> 1.12.0 @wordpress/i18n: 3.7.0 -> 3.8.0 @wordpress/is-shallow-equal: 1.6.1 -> 1.7.0 @wordpress/keycodes: 2.7.0 -> 2.8.0 @wordpress/list-reusable-blocks: 1.10.0 -> 1.11.0 @wordpress/media-utils: 1.4.0 -> 1.5.0 @wordpress/notices: 1.10.0 -> 1.11.0 @wordpress/nux: 3.9.0 -> 3.10.0 @wordpress/plugins: 2.9.0 -> 2.10.0 @wordpress/priority-queue: 1.3.1 -> 1.4.0 @wordpress/rich-text: 3.9.0 -> 3.10.0 @wordpress/scripts: 6.1.1 -> 6.2.0 @wordpress/server-side-render: 1.5.0 -> 1.6.0 @wordpress/viewport: 2.10.0 -> 2.11.0 The following package was added: @wordpress/keyboard-shortcuts Props gziolo. Fixes #49204. Built from https://develop.svn.wordpress.org/trunk@47106 git-svn-id: http://core.svn.wordpress.org/trunk@46906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-22 23:06:21 +01:00
}
(window.wp = window.wp || {}).domReady = __webpack_exports__["default"];
/******/ })()
;