Docs: Add file doc @output annotations.

These annotations make it clear to the reader of a JavaScript source
where the build process outputs to. These annotations can later be
integrated in a webpack configuration. This way there is one source of
truth.

The `build` folder is omitted from the paths, because a single JS file
shouldn't not be responsible of knowing where outputs in general will
end up at. A file only knows its output location relative to the
project.

Props adamsilverstein, herregroen, omarreiss, pento.
Fixes #44361.

Built from https://develop.svn.wordpress.org/trunk@43347


git-svn-id: http://core.svn.wordpress.org/trunk@43175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
atimmer
2018-06-28 02:30:15 +00:00
parent 6a9a5e123c
commit bde558be2f
91 changed files with 334 additions and 34 deletions

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/admin-bar.js
*/
/* jshint loopfunc: true */
// use jQuery and hoverIntent if loaded
if ( typeof(jQuery) != 'undefined' ) {

View File

@@ -9,6 +9,7 @@
* - Allows specifying only an endpoint namespace/path instead of a full URL.
*
* @since 4.9.0
* @output wp-includes/js/api-request.js
*/
( function( $ ) {

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/autosave.js
*/
/* global tinymce, wpCookies, autosaveL10n, switchEditors */
// Back-compat
window.autosave = function() {

View File

@@ -2,6 +2,7 @@
* Handles the addition of the comment form.
*
* @since 2.7.0
* @output wp-includes/js/comment-reply.js
*
* @namespace addComment
*

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/customize-base.js
*/
/** @namespace wp */
window.wp = window.wp || {};

View File

@@ -1,4 +1,9 @@
/**
* @output wp-includes/js/customize-loader.js
*/
/* global _wpCustomizeLoaderSettings */
/**
* Expose a public API that allows the customizer to be
* loaded on any page.

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/customize-models.js
*/
/* global _wpCustomizeHeader */
(function( $, wp ) {
var api = wp.customize;

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/customize-preview-nav-menus.js
*/
/* global _wpCustomizePreviewNavMenusExports */
/** @namespace wp.customize.navMenusPreview */

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/customize-preview-widgets.js
*/
/* global _wpWidgetCustomizerPreviewSettings */
/**

View File

@@ -1,5 +1,7 @@
/*
* Script run inside a Customizer preview frame.
*
* @output wp-includes/js/customize-preview.js
*/
(function( exports, $ ){
var api = wp.customize,

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/customize-selective-refresh.js
*/
/* global jQuery, JSON, _customizePartialRefreshExports, console */
/** @namespace wp.customize.selectiveRefresh */

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/customize-views.js
*/
(function( $, wp, _ ) {
if ( ! wp || ! wp.customize ) { return; }

View File

@@ -24,6 +24,7 @@
* - heartbeat-nonces-expired
*
* @since 3.6.0
* @output wp-includes/js/heartbeat.js
*/
( function( $, window, undefined ) {

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/mce-view.js
*/
/* global tinymce */
/*

View File

@@ -74,6 +74,10 @@ module.exports = __webpack_require__(1);
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/**
* @output wp-includes/js/media-audiovideo.js
*/
var media = wp.media,
baseSettings = window._wpmejsSettings || {},
l10n = window._wpMediaViewsL10n || {};

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/media-editor.js
*/
/* global getUserSetting, tinymce, QTags */
// WordPress, TinyMCE, and Media

View File

@@ -85,6 +85,10 @@ module.exports = __webpack_require__(12);
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/**
* @output wp-includes/js/media-grid.js
*/
var media = wp.media;
media.controller.EditAttachmentMetadata = __webpack_require__( 13 );

View File

@@ -76,6 +76,10 @@ module.exports = __webpack_require__(23);
/***/ 23:
/***/ (function(module, exports, __webpack_require__) {
/**
* @output wp-includes/js/media-models.js
*/
var $ = jQuery,
Attachment, Attachments, l10n, media;

View File

@@ -74,6 +74,10 @@ module.exports = __webpack_require__(30);
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
/**
* @output wp-includes/js/media-views.js
*/
var media = wp.media,
$ = jQuery,
l10n;

View File

@@ -1,4 +1,4 @@
/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt */
/*
* Quicktags
*
@@ -16,12 +16,16 @@
*
* quicktags_id string The ID of the textarea that will be the editor canvas
* buttons string Comma separated list of the default buttons names that will be shown in that instance.
*
* @output wp-includes/js/quicktags.js
*/
// new edit toolbar used with permission
// by Alex King
// http://www.alexking.org/
/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt */
var QTags, edCanvas,
edButtons = [];

View File

@@ -1,4 +1,8 @@
// Utility functions for parsing and handling shortcodes in JavaScript.
/**
* Utility functions for parsing and handling shortcodes in JavaScript.
*
* @output wp-includes/js/shortcode.js
*/
/**
* Ensure the global `wp` object exists.

View File

@@ -1,6 +1,11 @@
/**
* Cookie functions.
*
* @output wp-includes/js/utils.js
*/
/* global userSettings */
/* exported getUserSetting, setUserSetting, deleteUserSetting */
// utility functions
var wpCookies = {
// The following functions are from Cookie.js class in TinyMCE 3, Moxiecode, used under LGPL.
@@ -195,4 +200,3 @@ function getAllUserSettings() {
return wpCookies.getHash( 'wp-settings-' + userSettings.uid ) || {};
}

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-a11y.js
*/
/** @namespace wp */
window.wp = window.wp || {};

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-ajax-response.js
*/
var wpAjax = jQuery.extend( {
unserialize: function( s ) {
var r = {}, q, pp, i, p;

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-api.js
*/
(function( window, undefined ) {
'use strict';

View File

@@ -1,5 +1,10 @@
/**
* Interim login dialog.
*
* @output wp-includes/js/wp-auth-check.js
*/
/* global adminpage */
// Interim login dialog
(function($){
var wrap, next;

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-backbone.js
*/
/** @namespace wp */
window.wp = window.wp || {};

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-custom-header.js
*/
/* global YT */
(function( window, settings ) {

View File

@@ -1,3 +1,6 @@
/**
* @output wp-includes/js/wp-embed-template.js
*/
(function ( window, document ) {
'use strict';

View File

@@ -2,6 +2,7 @@
* WordPress inline HTML embed
*
* @since 4.4.0
* @output wp-includes/js/wp-embed.js
*
* This file cannot have ampersands in it. This is to ensure
* it can be embedded in older versions of WordPress.

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-emoji-loader.js
*/
( function( window, document, settings ) {
var src, ready, ii, tests;

View File

@@ -1,3 +1,6 @@
/**
* @output wp-includes/js/wp-emoji.js
*/
( function( window, settings ) {
function wpEmoji() {

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-list-revisions.js
*/
(function(w) {
var init = function() {
var pr = document.getElementById('post-revisions'),

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-lists.js
*/
/* global ajaxurl, wpAjax */
/**

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-pointer.js
*/
/* global wpPointerL10n */
/**

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-sanitize.js
*/
( function () {
window.wp = window.wp || {};

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wp-util.js
*/
/* global _wpUtilSettings */
/** @namespace wp */

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wpdialog.js
*/
/*
* Wrap the jQuery UI Dialog open function remove focus from tinyMCE.
*/

View File

@@ -1,3 +1,7 @@
/**
* @output wp-includes/js/wplink.js
*/
var wpLink;
( function( $, wpLinkL10n, wp ) {

View File

@@ -1,4 +1,9 @@
/**
* @output wp-includes/js/zxcvbn-async.js
*/
/* global _zxcvbnSettings */
/**
* Loads zxcvbn asynchronously by inserting an async script tag before the first
* script tag on the page.