diff --git a/Gruntfile.js b/Gruntfile.js
index 58350bfa5b..0ed08c39b8 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -43,7 +43,7 @@ module.exports = function(grunt) {
// Load tasks.
require('matchdep').filterDev(['grunt-*', '!grunt-legacy-util']).forEach( grunt.loadNpmTasks );
- // Load legacy utils
+ // Load legacy utils.
grunt.util = require('grunt-legacy-util');
// Project configuration.
@@ -144,7 +144,7 @@ module.exports = function(grunt) {
'!assets/**', // Assets is extracted into separate copy tasks.
'!js/**', // JavaScript is extracted into separate copy tasks.
'!.{svn,git}', // Exclude version control folders.
- '!wp-includes/version.php', // Exclude version.php
+ '!wp-includes/version.php', // Exclude version.php.
'!**/*.map', // The build doesn't need .map files.
'!index.php', '!wp-admin/index.php',
'!_index.php', '!wp-admin/_index.php'
@@ -168,7 +168,7 @@ module.exports = function(grunt) {
[ WORKING_DIR + 'wp-includes/js/clipboard.js' ]: [ './node_modules/clipboard/dist/clipboard.js' ],
[ WORKING_DIR + 'wp-includes/js/hoverIntent.js' ]: [ './node_modules/jquery-hoverintent/jquery.hoverIntent.js' ],
- // Renamed to avoid conflict with jQuery hoverIntent.min.js (after minifying)
+ // Renamed to avoid conflict with jQuery hoverIntent.min.js (after minifying).
[ WORKING_DIR + 'wp-includes/js/hoverintent-js.min.js' ]: [ './node_modules/hoverintent/dist/hoverintent.min.js' ],
[ WORKING_DIR + 'wp-includes/js/imagesloaded.min.js' ]: [ './node_modules/imagesloaded/imagesloaded.pkgd.min.js' ],
[ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.js' ],
@@ -448,7 +448,7 @@ module.exports = function(grunt) {
},
rtlcss: {
options: {
- // rtlcss options
+ // rtlcss options.
opts: {
clean: false,
processUrls: { atrule: true, decl: false },
@@ -516,7 +516,7 @@ module.exports = function(grunt) {
'!wp-includes/css/*.min.css',
'!wp-includes/css/dist',
- // Exceptions
+ // Exceptions.
'!wp-includes/css/dashicons.css',
'!wp-includes/css/wp-embed-template.css',
'!wp-includes/css/wp-embed-template-ie.css'
@@ -558,7 +558,7 @@ module.exports = function(grunt) {
src: [
'twenty*/**/*.js',
'!twenty{eleven,twelve,thirteen}/**',
- // Third party scripts
+ // Third party scripts.
'!twenty{fourteen,fifteen,sixteen}/js/html5.js',
'!twentyseventeen/assets/js/html5.js',
'!twentyseventeen/assets/js/jquery.scrollTo.js',
@@ -575,35 +575,36 @@ module.exports = function(grunt) {
cwd: SOURCE_DIR,
src: [
'js/_enqueues/**/*.js',
- // Third party scripts
+ // Third party scripts.
'!js/_enqueues/vendor/**/*.js'
],
- // Remove once other JSHint errors are resolved
+ // Remove once other JSHint errors are resolved.
options: {
curly: false,
eqeqeq: false
},
- // Limit JSHint's run to a single specified file:
- //
- // grunt jshint:core --file=filename.js
- //
- // Optionally, include the file path:
- //
- // grunt jshint:core --file=path/to/filename.js
- //
+ /*
+ * Limit JSHint's run to a single specified file:
+ *
+ * grunt jshint:core --file=filename.js
+ *
+ * Optionally, include the file path:
+ *
+ * grunt jshint:core --file=path/to/filename.js
+ */
filter: function( filepath ) {
var index, file = grunt.option( 'file' );
- // Don't filter when no target file is specified
+ // Don't filter when no target file is specified.
if ( ! file ) {
return true;
}
- // Normalize filepath for Windows
+ // Normalize filepath for Windows.
filepath = filepath.replace( /\\/g, '/' );
index = filepath.lastIndexOf( '/' + file );
- // Match only the filename passed from cli
+ // Match only the filename passed from cli.
if ( filepath === file || ( -1 !== index && index === filepath.length - ( file.length + 1 ) ) ) {
return true;
}
@@ -618,14 +619,15 @@ module.exports = function(grunt) {
'**/*.js',
'!**/*.min.js'
],
- // Limit JSHint's run to a single specified plugin directory:
- //
- // grunt jshint:plugins --dir=foldername
- //
+ /*
+ * Limit JSHint's run to a single specified plugin directory:
+ *
+ * grunt jshint:plugins --dir=foldername
+ */
filter: function( dirpath ) {
var index, dir = grunt.option( 'dir' );
- // Don't filter when no target folder is specified
+ // Don't filter when no target folder is specified.
if ( ! dir ) {
return true;
}
@@ -633,7 +635,7 @@ module.exports = function(grunt) {
dirpath = dirpath.replace( /\\/g, '/' );
index = dirpath.lastIndexOf( '/' + dir );
- // Match only the folder name passed from cli
+ // Match only the folder name passed from cli.
if ( -1 !== index ) {
return true;
}
@@ -703,12 +705,12 @@ module.exports = function(grunt) {
'wp-includes/js/tinymce/plugins/wordpress/plugin.js',
'wp-includes/js/tinymce/plugins/wp*/plugin.js',
- // Exceptions
+ // Exceptions.
'!**/*.min.js',
'!wp-admin/js/custom-header.js', // Why? We should minify this.
'!wp-admin/js/farbtastic.js',
'!wp-includes/js/swfobject.js',
- '!wp-includes/js/wp-embed.js' // We have extra options for this, see uglify:embed
+ '!wp-includes/js/wp-embed.js' // We have extra options for this, see uglify:embed.
]
},
embed: {
@@ -1030,7 +1032,7 @@ module.exports = function(grunt) {
grunt.log.writeln( 'Fetching list of Twemoji files...' );
- // Fetch a list of the files that Twemoji supplies
+ // Fetch a list of the files that Twemoji supplies.
files = spawn( 'svn', [ 'ls', 'https://github.com/twitter/twemoji.git/trunk/assets/svg' ] );
if ( 0 !== files.status ) {
grunt.fatal( 'Unable to fetch Twemoji file list' );
@@ -1038,33 +1040,33 @@ module.exports = function(grunt) {
entities = files.stdout.toString();
- // Tidy up the file list
+ // Tidy up the file list.
entities = entities.replace( /\.svg/g, '' );
entities = entities.replace( /^$/g, '' );
- // Convert the emoji entities to HTML entities
+ // Convert the emoji entities to HTML entities.
partials = entities = entities.replace( /([a-z0-9]+)/g, '$1;' );
- // Remove the hyphens between the HTML entities
+ // Remove the hyphens between the HTML entities.
entities = entities.replace( /-/g, '' );
- // Sort the entities list by length, so the longest emoji will be found first
+ // Sort the entities list by length, so the longest emoji will be found first.
emojiArray = entities.split( '\n' ).sort( function ( a, b ) {
return b.length - a.length;
} );
- // Convert the entities list to PHP array syntax
+ // Convert the entities list to PHP array syntax.
entities = '\'' + emojiArray.filter( function( val ) {
return val.length >= 8 ? val : false ;
} ).join( '\', \'' ) + '\'';
- // Create a list of all characters used by the emoji list
+ // Create a list of all characters used by the emoji list.
partials = partials.replace( /-/g, '\n' );
- // Set automatically removes duplicates
+ // Set automatically removes duplicates.
partialsSet = new Set( partials.split( '\n' ) );
- // Convert the partials list to PHP array syntax
+ // Convert the partials list to PHP array syntax.
partials = '\'' + Array.from( partialsSet ).filter( function( val ) {
return val.length >= 8 ? val : false ;
} ).join( '\', \'' ) + '\'';
@@ -1158,7 +1160,7 @@ module.exports = function(grunt) {
}
});
- // Allow builds to be minimal
+ // Allow builds to be minimal.
if( grunt.option( 'minimal-copy' ) ) {
var copyFilesOptions = grunt.config.get( 'copy.files.files' );
copyFilesOptions[0].src.push( '!wp-content/plugins/**' );
diff --git a/phpcompat.xml.dist b/phpcompat.xml.dist
index 110b19cc63..727796c908 100644
--- a/phpcompat.xml.dist
+++ b/phpcompat.xml.dist
@@ -4,7 +4,7 @@
-
+
@@ -25,7 +25,7 @@
-
+
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index b9dd8c5b99..2d9f152285 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -20,7 +20,7 @@
-
+
.
@@ -48,7 +48,7 @@
-
+
@@ -62,14 +62,14 @@
-
+
-
+
-
+
@@ -77,7 +77,7 @@
-
+
@@ -89,11 +89,11 @@
-
+
-
+
-
+
@@ -102,7 +102,7 @@
^build/*
-
+
/node_modules/*/vendor/*
@@ -140,7 +140,7 @@
/tests/phpunit/includes/speed-trap-listener\.php
-
+
/tests/phpunit/build*/tests/phpunit/data/*
@@ -214,7 +214,7 @@
-
+
@@ -229,7 +229,7 @@
-
+
@@ -238,7 +238,7 @@
-
+
@@ -270,7 +270,7 @@
-
+
*
@@ -283,7 +283,7 @@
/tests/phpunit/tests/*
-
+
/src/wp-admin/includes/class-wp-filesystem-ftpsockets\.php/src/wp-includes/class-wp-oembed\.php
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index eb1a1e7c46..b7da1303c1 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -5,12 +5,12 @@
beStrictAboutTestsThatDoNotTestAnything="true"
>
-
+
tests/phpunit/teststests/phpunit/tests/rest-api/rest-autosaves-controller.php
-
+
tests/phpunit/tests/rest-api/rest-autosaves-controller.php
@@ -44,7 +44,7 @@
src
-
+
src/wp-includes/ID3src/wp-includes/IXRsrc/wp-includes/random_compat
diff --git a/src/index.php b/src/index.php
index 9e8f9ec856..c1be8ac3b0 100644
--- a/src/index.php
+++ b/src/index.php
@@ -29,7 +29,7 @@ require_once( ABSPATH . WPINC . '/version.php' );
wp_check_php_mysql_versions();
wp_load_translations_early();
-// Die with an error message
+// Die with an error message.
$die = sprintf(
'
%s
',
__( 'You are running WordPress without JavaScript and CSS files. These need to be built.' )
diff --git a/src/js/_enqueues/admin/comment.js b/src/js/_enqueues/admin/comment.js
index f1fd2213a0..fd347d448b 100644
--- a/src/js/_enqueues/admin/comment.js
+++ b/src/js/_enqueues/admin/comment.js
@@ -70,7 +70,7 @@ jQuery(document).ready( function($) {
* @param {Event} event The event object.
* @return {void}
*/
- $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
+ $timestampdiv.find('.save-timestamp').click( function( event ) { // Crazyhorse - multiple OK cancels.
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
newD = new Date( aa, mm - 1, jj, hh, mn );
diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js
index 0541c8d0f2..75c77b3bac 100644
--- a/src/js/_enqueues/admin/common.js
+++ b/src/js/_enqueues/admin/common.js
@@ -168,7 +168,7 @@ window.validateForm = function( form ) {
.length;
};
-// stub for doing better warnings
+// Stub for doing better warnings.
/**
* Shows message pop-up notice or confirmation message.
*
@@ -334,13 +334,13 @@ $('.contextual-help-tabs').delegate('a', 'click', function(e) {
if ( link.is('.active a') )
return false;
- // Links
+ // Links.
$('.contextual-help-tabs .active').removeClass('active');
link.parent('li').addClass('active');
panel = $( link.attr('href') );
- // Panels
+ // Panels.
$('.help-tab-content').not( panel ).removeClass('active').hide();
panel.addClass('active').show();
});
@@ -517,7 +517,7 @@ $document.ready( function() {
$( '#collapse-button' ).on( 'click.collapse-menu', function() {
var viewportWidth = getViewportWidth() || 961;
- // reset any compensation for submenus near the bottom of the screen
+ // Reset any compensation for submenus near the bottom of the screen.
$('#adminmenu div.wp-submenu').css('margin-top', '');
if ( viewportWidth < 960 ) {
@@ -582,12 +582,12 @@ $document.ready( function() {
menutop = $menuItem.offset().top;
wintop = $window.scrollTop();
- maxtop = menutop - wintop - 30; // max = make the top of the sub almost touch admin bar
+ maxtop = menutop - wintop - 30; // max = make the top of the sub almost touch admin bar.
- bottomOffset = menutop + $submenu.height() + 1; // Bottom offset of the menu
- pageHeight = $wpwrap.height(); // Height of the entire page
+ bottomOffset = menutop + $submenu.height() + 1; // Bottom offset of the menu.
+ pageHeight = $wpwrap.height(); // Height of the entire page.
adjustment = 60 + bottomOffset - pageHeight;
- theFold = $window.height() + wintop - 50; // The fold
+ theFold = $window.height() + wintop - 50; // The fold.
if ( theFold < ( bottomOffset - adjustment ) ) {
adjustment = bottomOffset - theFold;
@@ -604,8 +604,8 @@ $document.ready( function() {
}
}
- if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // touch screen device
- // iOS Safari works with touchstart, the rest work with click
+ if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // Touch screen device.
+ // iOS Safari works with touchstart, the rest work with click.
mobileEvent = isIOS ? 'touchstart' : 'click';
/**
@@ -639,9 +639,11 @@ $document.ready( function() {
return;
}
- // Show the sub instead of following the link if:
- // - the submenu is not open
- // - the submenu is not shown inline or the menu is not folded
+ /*
+ * Show the sub instead of following the link if:
+ * - the submenu is not open.
+ * - the submenu is not shown inline or the menu is not folded.
+ */
if ( ! $menuItem.hasClass( 'opensub' ) && ( ! $menuItem.hasClass( 'wp-menu-open' ) || $menuItem.width() < 40 ) ) {
event.preventDefault();
adjustSubmenu( $menuItem );
@@ -664,12 +666,12 @@ $document.ready( function() {
$submenu = $menuItem.find( '.wp-submenu' ),
top = parseInt( $submenu.css( 'top' ), 10 );
- if ( isNaN( top ) || top > -5 ) { // the submenu is visible
+ if ( isNaN( top ) || top > -5 ) { // The submenu is visible.
return;
}
if ( $adminmenu.data( 'wp-responsive' ) ) {
- // The menu is in responsive mode, bail
+ // The menu is in responsive mode, bail.
return;
}
@@ -685,7 +687,7 @@ $document.ready( function() {
*/
out: function(){
if ( $adminmenu.data( 'wp-responsive' ) ) {
- // The menu is in responsive mode, bail
+ // The menu is in responsive mode, bail.
return;
}
@@ -705,7 +707,7 @@ $document.ready( function() {
*/
$adminmenu.on( 'focus.adminmenu', '.wp-submenu a', function( event ) {
if ( $adminmenu.data( 'wp-responsive' ) ) {
- // The menu is in responsive mode, bail
+ // The menu is in responsive mode, bail.
return;
}
@@ -759,7 +761,7 @@ $document.ready( function() {
$button = $( '' ),
btnText = commonL10n.dismiss || '';
- // Ensure plain text
+ // Ensure plain text.
$button.find( '.screen-reader-text' ).text( btnText );
$button.on( 'click.wp-dismiss-notice', function( event ) {
event.preventDefault();
@@ -776,7 +778,7 @@ $document.ready( function() {
$document.on( 'wp-updates-notice-added wp-plugin-install-error wp-plugin-update-error wp-plugin-delete-error wp-theme-install-error wp-theme-delete-error', makeNoticesDismissible );
- // Init screen meta
+ // Init screen meta.
screenMeta.init();
/**
@@ -902,7 +904,7 @@ $document.ready( function() {
}
}, '.has-row-actions' );
- // Toggle list table rows on small screens
+ // Toggle list table rows on small screens.
$( 'tbody' ).on( 'click', '.toggle-row', function() {
$( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
});
@@ -925,7 +927,7 @@ $document.ready( function() {
// After pressing escape key (keyCode: 27), the tab key should tab out of the textarea.
if ( e.keyCode == 27 ) {
- // when pressing Escape: Opera 12 and 27 blur form fields, IE 8 clears them
+ // When pressing Escape: Opera 12 and 27 blur form fields, IE 8 clears them.
e.preventDefault();
$(el).data('tab-out', true);
return;
@@ -1276,7 +1278,7 @@ $document.ready( function() {
this.maybeDisableSortables = this.maybeDisableSortables.bind( this );
- // Modify functionality based on custom activate/deactivate event
+ // Modify functionality based on custom activate/deactivate event.
$document.on( 'wp-responsive-activate.wp-responsive', function() {
self.activate();
}).on( 'wp-responsive-deactivate.wp-responsive', function() {
@@ -1289,7 +1291,7 @@ $document.ready( function() {
$( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
event.preventDefault();
- // close any open toolbar submenus.
+ // Close any open toolbar submenus.
$adminbar.find( '.hover' ).removeClass( 'hover' );
$wpwrap.toggleClass( 'wp-responsive-open' );
diff --git a/src/js/_enqueues/admin/edit-comments.js b/src/js/_enqueues/admin/edit-comments.js
index 4391d50fef..1a64268b6a 100644
--- a/src/js/_enqueues/admin/edit-comments.js
+++ b/src/js/_enqueues/admin/edit-comments.js
@@ -192,7 +192,7 @@ var getCount, updateCount, updateCountText, updatePending, updateApproved,
var newTitle, regExMatch, titleCount, commentFrag;
titleRegEx = titleRegEx || new RegExp( adminCommentsL10n.docTitleCommentsCount.replace( '%s', '\\([0-9' + thousandsSeparator + ']+\\)' ) + '?' );
- // count funcs operate on a $'d element
+ // Count funcs operate on a $'d element.
titleDiv = titleDiv || $( '' );
newTitle = adminTitle;
@@ -256,7 +256,7 @@ var getCount, updateCount, updateCountText, updatePending, updateApproved,
return;
}
- // cache selectors to not get dupes
+ // Cache selectors to not get dupes.
pending = $( 'span.' + pendingClass, postSelector );
noPending = $( 'span.' + noClass, postSelector );
@@ -444,7 +444,7 @@ window.setCommentsList = function() {
a.click(function( e ){
e.preventDefault();
- e.stopPropagation(); // ticket #35904
+ e.stopPropagation(); // Ticket #35904.
list.wpList.del(this);
$('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
$(this).remove();
@@ -491,17 +491,19 @@ window.setCommentsList = function() {
unapproved = commentRow.hasClass( 'unapproved' ),
spammed = commentRow.hasClass( 'spam' ),
trashed = commentRow.hasClass( 'trash' ),
- undoing = false; // ticket #35904
+ undoing = false; // Ticket #35904.
updateDashboardText( newTotal );
updateInModerationText( newTotal );
- // the order of these checks is important
- // .unspam can also have .approve or .unapprove
- // .untrash can also have .approve or .unapprove
+ /*
+ * The order of these checks is important.
+ * .unspam can also have .approve or .unapprove.
+ * .untrash can also have .approve or .unapprove.
+ */
if ( targetParent.is( 'span.undo' ) ) {
- // the comment was spammed
+ // The comment was spammed.
if ( targetParent.hasClass( 'unspam' ) ) {
spamDiff = -1;
@@ -513,7 +515,7 @@ window.setCommentsList = function() {
pendingDiff = 1;
}
- // the comment was trashed
+ // The comment was trashed.
} else if ( targetParent.hasClass( 'untrash' ) ) {
trashDiff = -1;
@@ -528,32 +530,32 @@ window.setCommentsList = function() {
undoing = true;
- // user clicked "Spam"
+ // User clicked "Spam".
} else if ( targetParent.is( 'span.spam' ) ) {
- // the comment is currently approved
+ // The comment is currently approved.
if ( approved ) {
approvedDiff = -1;
- // the comment is currently pending
+ // The comment is currently pending.
} else if ( unapproved ) {
pendingDiff = -1;
- // the comment was in the trash
+ // The comment was in the trash.
} else if ( trashed ) {
trashDiff = -1;
}
- // you can't spam an item on the spam screen
+ // You can't spam an item on the Spam screen.
spamDiff = 1;
- // user clicked "Unspam"
+ // User clicked "Unspam".
} else if ( targetParent.is( 'span.unspam' ) ) {
if ( approved ) {
pendingDiff = 1;
} else if ( unapproved ) {
approvedDiff = 1;
} else if ( trashed ) {
- // the comment was previously approved
+ // The comment was previously approved.
if ( targetParent.hasClass( 'approve' ) ) {
approvedDiff = 1;
- // the comment was previously pending
+ // The comment was previously pending.
} else if ( targetParent.hasClass( 'unapprove' ) ) {
pendingDiff = 1;
}
@@ -565,23 +567,23 @@ window.setCommentsList = function() {
pendingDiff = 1;
}
}
- // you can Unspam an item on the spam screen
+ // You can unspam an item on the Spam screen.
spamDiff = -1;
- // user clicked "Trash"
+ // User clicked "Trash".
} else if ( targetParent.is( 'span.trash' ) ) {
if ( approved ) {
approvedDiff = -1;
} else if ( unapproved ) {
pendingDiff = -1;
- // the comment was in the spam queue
+ // The comment was in the spam queue.
} else if ( spammed ) {
spamDiff = -1;
}
- // you can't trash an item on the trash screen
+ // You can't trash an item on the Trash screen.
trashDiff = 1;
- // user clicked "Restore"
+ // User clicked "Restore".
} else if ( targetParent.is( 'span.untrash' ) ) {
if ( approved ) {
pendingDiff = 1;
@@ -594,21 +596,21 @@ window.setCommentsList = function() {
pendingDiff = 1;
}
}
- // you can't go from trash to spam
- // you can untrash on the trash screen
+ // You can't go from Trash to Spam.
+ // You can untrash on the Trash screen.
trashDiff = -1;
- // User clicked "Approve"
+ // User clicked "Approve".
} else if ( targetParent.is( 'span.approve:not(.unspam):not(.untrash)' ) ) {
approvedDiff = 1;
pendingDiff = -1;
- // User clicked "Unapprove"
+ // User clicked "Unapprove".
} else if ( targetParent.is( 'span.unapprove:not(.unspam):not(.untrash)' ) ) {
approvedDiff = -1;
pendingDiff = 1;
- // User clicked "Delete Permanently"
+ // User clicked "Delete Permanently".
} else if ( targetParent.is( 'span.delete' ) ) {
if ( spammed ) {
spamDiff = -1;
@@ -713,17 +715,17 @@ window.setCommentsList = function() {
if (ev) {
theExtraList.empty();
- args.number = Math.min(8, per_page); // see WP_Comments_List_Table::prepare_items() @ class-wp-comments-list-table.php
+ args.number = Math.min(8, per_page); // See WP_Comments_List_Table::prepare_items() in class-wp-comments-list-table.php.
} else {
args.number = 1;
- args.offset = Math.min(8, per_page) - 1; // fetch only the next item on the extra list
+ args.offset = Math.min(8, per_page) - 1; // Fetch only the next item on the extra list.
}
args.no_placeholder = true;
args.paged ++;
- // $.query.get() needs some correction to be sent into an ajax request
+ // $.query.get() needs some correction to be sent into an Ajax request.
if ( true === args.comment_type )
args.comment_type = '';
@@ -781,9 +783,9 @@ window.commentReply = {
/**
* Initializes the comment reply functionality.
*
- * @memberof commentReply
- *
* @since 2.7.0
+ *
+ * @memberof commentReply
*/
init : function() {
var row = $('#replyrow');
@@ -798,7 +800,7 @@ window.commentReply = {
}
});
- // add events
+ // Add events.
$('#the-comment-list .column-comment > p').dblclick(function(){
commentReply.toggle($(this).parent());
});
@@ -911,7 +913,7 @@ window.commentReply = {
.focus();
}
- // reset the Quicktags buttons
+ // Reset the Quicktags buttons.
if ( typeof QTags != 'undefined' )
QTags.closeAllTags('replycontent');
@@ -1029,7 +1031,7 @@ window.commentReply = {
$('#replycontent').focus().keyup(function(e){
if ( e.which == 27 )
- commentReply.revert(); // close on Escape
+ commentReply.revert(); // Close on Escape.
});
}, 600);
@@ -1130,7 +1132,7 @@ window.commentReply = {
updateCountText( 'span.all-count', 1 );
}
- c = $.trim(r.data); // Trim leading whitespaces
+ c = $.trim(r.data); // Trim leading whitespaces.
$(c).hide();
$('#replyrow').after(c);
diff --git a/src/js/_enqueues/admin/inline-edit-post.js b/src/js/_enqueues/admin/inline-edit-post.js
index 85cc742844..70a57e1200 100644
--- a/src/js/_enqueues/admin/inline-edit-post.js
+++ b/src/js/_enqueues/admin/inline-edit-post.js
@@ -29,41 +29,42 @@ window.wp = window.wp || {};
/**
* Initializes the inline and bulk post editor.
*
- * Binds event handlers to the escape key to close the inline editor
+ * Binds event handlers to the Escape key to close the inline editor
* and to the save and close buttons. Changes DOM to be ready for inline
* editing. Adds event handler to bulk edit.
*
- * @memberof inlineEditPost
* @since 2.7.0
*
+ * @memberof inlineEditPost
+ *
* @return {void}
*/
init : function(){
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post';
- // Post id prefix.
+ // Post ID prefix.
t.what = '#post-';
/**
- * Binds the escape key to revert the changes and close the quick editor.
+ * Binds the Escape key to revert the changes and close the quick editor.
*
* @return {boolean} The result of revert.
*/
qeRow.keyup(function(e){
- // Revert changes if escape key is pressed.
+ // Revert changes if Escape key is pressed.
if ( e.which === 27 ) {
return inlineEditPost.revert();
}
});
/**
- * Binds the escape key to revert the changes and close the bulk editor.
+ * Binds the Escape key to revert the changes and close the bulk editor.
*
* @return {boolean} The result of revert.
*/
bulkRow.keyup(function(e){
- // Revert changes if escape key is pressed.
+ // Revert changes if Escape key is pressed.
if ( e.which === 27 ) {
return inlineEditPost.revert();
}
@@ -88,7 +89,7 @@ window.wp = window.wp || {};
});
/**
- * If enter is pressed, and the target is not the cancel button, save the post.
+ * If Enter is pressed, and the target is not the cancel button, save the post.
*
* @return {boolean} The result of save.
*/
@@ -157,9 +158,10 @@ window.wp = window.wp || {};
* Toggles the quick edit window, hiding it when it's active and showing it when
* inactive.
*
- * @memberof inlineEditPost
* @since 2.7.0
*
+ * @memberof inlineEditPost
+ *
* @param {Object} el Element within a post table row.
*/
toggle : function(el){
@@ -170,8 +172,9 @@ window.wp = window.wp || {};
/**
* Creates the bulk editor row to edit multiple posts at once.
*
- * @memberof inlineEditPost
* @since 2.7.0
+ *
+ * @memberof inlineEditPost
*/
setBulk : function(){
var te = '', type = this.type, c = true;
@@ -242,9 +245,10 @@ window.wp = window.wp || {};
/**
* Creates a quick edit window for the post that has been clicked.
*
- * @memberof inlineEditPost
* @since 2.7.0
*
+ * @memberof inlineEditPost
+ *
* @param {number|Object} id The id of the clicked post or an element within a post
* table row.
* @return {boolean} Always returns false at the end of execution.
@@ -409,7 +413,7 @@ window.wp = window.wp || {};
fields = $('#edit-'+id).find(':input').serialize();
params = fields + '&' + $.param(params);
- // Make ajax request.
+ // Make Ajax request.
$.post( ajaxurl, params,
function(r) {
var $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ),
@@ -450,9 +454,10 @@ window.wp = window.wp || {};
/**
* Hides and empties the Quick Edit and/or Bulk Edit windows.
*
- * @memberof inlineEditPost
* @since 2.7.0
*
+ * @memberof inlineEditPost
+ *
* @return {boolean} Always returns false.
*/
revert : function(){
@@ -494,9 +499,10 @@ window.wp = window.wp || {};
* Gets the id for a the post that you want to quick edit from the row in the quick
* edit table.
*
- * @memberof inlineEditPost
* @since 2.7.0
*
+ * @memberof inlineEditPost
+ *
* @param {Object} o DOM row object to get the id for.
* @return {string} The post id extracted from the table row in the object.
*/
@@ -546,7 +552,7 @@ $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
}
}).ready( function() {
- // Set the heartbeat interval to 15 sec.
+ // Set the heartbeat interval to 15 seconds.
if ( typeof wp !== 'undefined' && wp.heartbeat ) {
wp.heartbeat.interval( 15 );
}
diff --git a/src/js/_enqueues/admin/inline-edit-tax.js b/src/js/_enqueues/admin/inline-edit-tax.js
index dcaa8d2bdc..5a3cad885c 100644
--- a/src/js/_enqueues/admin/inline-edit-tax.js
+++ b/src/js/_enqueues/admin/inline-edit-tax.js
@@ -43,12 +43,12 @@ window.inlineEditTax = {
});
/**
- * Cancels inline editing when pressing escape inside the inline editor.
+ * Cancels inline editing when pressing Escape inside the inline editor.
*
* @param {Object} e The keyup event that has been triggered.
*/
row.keyup( function( e ) {
- // 27 = [escape]
+ // 27 = [Escape].
if ( e.which === 27 ) {
return inlineEditTax.revert();
}
@@ -69,10 +69,10 @@ window.inlineEditTax = {
});
/**
- * Saves the inline edits when pressing enter inside the inline editor.
+ * Saves the inline edits when pressing Enter inside the inline editor.
*/
$( 'input, select', row ).keydown( function( e ) {
- // 13 = [enter]
+ // 13 = [Enter].
if ( e.which === 13 ) {
return inlineEditTax.save( this );
}
@@ -184,7 +184,7 @@ window.inlineEditTax = {
fields = $('#edit-'+id).find(':input').serialize();
params = fields + '&' + $.param(params);
- // Do the ajax request to save the data to the server.
+ // Do the Ajax request to save the data to the server.
$.post( ajaxurl, params,
/**
* Handles the response from the server
diff --git a/src/js/_enqueues/admin/link.js b/src/js/_enqueues/admin/link.js
index 076d07c44f..02698e5eea 100644
--- a/src/js/_enqueues/admin/link.js
+++ b/src/js/_enqueues/admin/link.js
@@ -9,7 +9,7 @@ jQuery(document).ready( function($) {
var newCat, noSyncChecks = false, syncChecks, catAddAfter;
$('#link_name').focus();
- // postboxes
+ // Postboxes.
postboxes.add_postbox_toggles('link');
/**
@@ -33,7 +33,7 @@ jQuery(document).ready( function($) {
if ( getUserSetting('cats') )
$('#category-tabs a[href="#categories-pop"]').click();
- // Ajax Cat
+ // Ajax Cat.
newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ); } );
/**
diff --git a/src/js/_enqueues/admin/media-upload.js b/src/js/_enqueues/admin/media-upload.js
index 3f45e2ef80..1a28f36d04 100644
--- a/src/js/_enqueues/admin/media-upload.js
+++ b/src/js/_enqueues/admin/media-upload.js
@@ -43,16 +43,16 @@ window.send_to_editor = function( html ) {
editor = tinymce.get( wpActiveEditor );
}
- // If the editor is set and not hidden, insert the HTML into the content of the
- // editor.
+ // If the editor is set and not hidden,
+ // insert the HTML into the content of the editor.
if ( editor && ! editor.isHidden() ) {
editor.execCommand( 'mceInsertContent', false, html );
} else if ( hasQuicktags ) {
// If quick tags are available, insert the HTML into its content.
QTags.insertContent( html );
} else {
- // If neither the TinyMCE editor and the quick tags are available, add the HTML
- // to the current active editor.
+ // If neither the TinyMCE editor and the quick tags are available,
+ // add the HTML to the current active editor.
document.getElementById( wpActiveEditor ).value += html;
}
diff --git a/src/js/_enqueues/admin/plugin-install.js b/src/js/_enqueues/admin/plugin-install.js
index b6cd1d74e4..f9c2be395d 100644
--- a/src/js/_enqueues/admin/plugin-install.js
+++ b/src/js/_enqueues/admin/plugin-install.js
@@ -183,11 +183,12 @@ jQuery( document ).ready( function( $ ) {
var tab = $( this ).attr( 'name' );
event.preventDefault();
- // Flip the tab
+ // Flip the tab.
$( '#plugin-information-tabs a.current' ).removeClass( 'current' );
$( this ).addClass( 'current' );
- // Only show the fyi box in the description section, on smaller screen, where it's otherwise always displayed at the top.
+ // Only show the fyi box in the description section, on smaller screen,
+ // where it's otherwise always displayed at the top.
if ( 'description' !== tab && $( window ).width() < 772 ) {
$( '#plugin-information-content' ).find( '.fyi' ).hide();
} else {
diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js
index d2e956b4e4..cc7cab1a72 100644
--- a/src/js/_enqueues/admin/post.js
+++ b/src/js/_enqueues/admin/post.js
@@ -91,9 +91,9 @@ window.wp = window.wp || {};
/**
* Load the next batch of comments.
*
- * @param {int} total Total number of comments to load.
- *
* @memberof commentsBox
+ *
+ * @param {int} total Total number of comments to load.
*/
load: function(total){
this.st = jQuery('#the-comment-list tr.comment:visible').length;
@@ -309,24 +309,24 @@ jQuery(document).ready( function($) {
// Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item.
$('#post-lock-dialog .notification-dialog').on( 'keydown', function(e) {
- // Don't do anything when [tab] is pressed.
+ // Don't do anything when [Tab] is pressed.
if ( e.which != 9 )
return;
var target = $(e.target);
- // [shift] + [tab] on first tab cycles back to last tab.
+ // [Shift] + [Tab] on first tab cycles back to last tab.
if ( target.hasClass('wp-tab-first') && e.shiftKey ) {
$(this).find('.wp-tab-last').focus();
e.preventDefault();
- // [tab] on last tab cycles back to first tab.
+ // [Tab] on last tab cycles back to first tab.
} else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) {
$(this).find('.wp-tab-first').focus();
e.preventDefault();
}
}).filter(':visible').find('.wp-tab-first').focus();
- // Set the heartbeat interval to 15 sec. if post lock dialogs are enabled.
+ // Set the heartbeat interval to 15 seconds if post lock dialogs are enabled.
if ( wp.heartbeat && $('#post-lock-dialog').length ) {
wp.heartbeat.interval( 15 );
}
@@ -385,7 +385,7 @@ jQuery(document).ready( function($) {
});
});
- // Submit the form saving a draft or an autosave, and show a preview in a new tab
+ // Submit the form saving a draft or an autosave, and show a preview in a new tab.
$('#post-preview').on( 'click.post-preview', function( event ) {
var $this = $(this),
$form = $('form#post'),
@@ -534,7 +534,7 @@ jQuery(document).ready( function($) {
});
});
- // Multiple Taxonomies.
+ // Multiple taxonomies.
if ( $('#tagsdiv-post_tag').length ) {
window.tagBox && window.tagBox.init();
} else {
@@ -559,7 +559,7 @@ jQuery(document).ready( function($) {
settingName = 'cats';
}
- // TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js
+ // @todo Move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js.
$('a', '#' + taxonomy + '-tabs').click( function( e ) {
e.preventDefault();
var t = $(this).attr('href');
@@ -581,7 +581,7 @@ jQuery(document).ready( function($) {
$( this ).val( '' ).removeClass( 'form-input-tip' );
});
- // On [enter] submit the taxonomy.
+ // On [Enter] submit the taxonomy.
$('#new' + taxonomy).keypress( function(event){
if( 13 === event.keyCode ) {
event.preventDefault();
@@ -654,7 +654,7 @@ jQuery(document).ready( function($) {
$('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
});
- }); // end cats
+ }); // End cats.
// Custom Fields postbox.
if ( $('#postcustom').length ) {
@@ -796,7 +796,8 @@ jQuery(document).ready( function($) {
// Update "Status:" to currently selected status.
$('#post-status-display').text(
- wp.sanitize.stripTagsAndEncodeText( $('option:selected', postStatus).text() ) // Remove any potential tags from post status text.
+ // Remove any potential tags from post status text.
+ wp.sanitize.stripTagsAndEncodeText( $('option:selected', postStatus).text() )
);
// Show or hide the "Save Draft" button.
@@ -838,7 +839,7 @@ jQuery(document).ready( function($) {
});
// Set the selected visibility as current.
- $postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // crazyhorse - multiple ok cancels
+ $postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // Crazyhorse - multiple OK cancels.
$postVisibilitySelect.slideUp('fast');
$('#visibility .edit-visibility').show().focus();
updateText();
@@ -886,7 +887,7 @@ jQuery(document).ready( function($) {
});
// Save the changed timestamp.
- $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
+ $timestampdiv.find('.save-timestamp').click( function( event ) { // Crazyhorse - multiple OK cancels.
if ( updateText() ) {
$timestampdiv.slideUp('fast');
$timestampdiv.siblings('a.edit-timestamp').show().focus();
@@ -1023,12 +1024,12 @@ jQuery(document).ready( function($) {
$el.html( '' ).children( 'input' ).keydown( function( e ) {
var key = e.which;
- // On [enter], just save the new slug, don't save the post.
+ // On [Enter], just save the new slug, don't save the post.
if ( 13 === key ) {
e.preventDefault();
buttons.children( '.save' ).click();
}
- // On [esc] cancel the editing.
+ // On [Esc] cancel the editing.
if ( 27 === key ) {
buttons.children( '.cancel' ).click();
}
@@ -1173,7 +1174,7 @@ jQuery(document).ready( function($) {
}
});
- // When changing page template, change the editor body class
+ // When changing page template, change the editor body class.
$( '#page_template' ).on( 'change.set-editor-class', function() {
var editor, body, pageTemplate = $( this ).val() || '';
@@ -1191,9 +1192,9 @@ jQuery(document).ready( function($) {
}
- // Save on pressing [ctrl]/[command] + [s] in the Text editor.
+ // Save on pressing [Ctrl]/[Command] + [S] in the Text editor.
$textarea.on( 'keydown.wp-autosave', function( event ) {
- // Key [s] has code 83.
+ // Key [S] has code 83.
if ( event.which === 83 ) {
if ( event.shiftKey || event.altKey || ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! isMac && ! event.ctrlKey ) ) {
return;
diff --git a/src/js/_enqueues/admin/postbox.js b/src/js/_enqueues/admin/postbox.js
index 9789518b65..ff144777f9 100644
--- a/src/js/_enqueues/admin/postbox.js
+++ b/src/js/_enqueues/admin/postbox.js
@@ -32,7 +32,9 @@
* if the postbox has been closed.
*
* @since 4.4.0
+ *
* @memberof postboxes
+ *
* @fires postboxes#postbox-toggled
*
* @return {void}
@@ -90,6 +92,7 @@
* Adds event handlers to all postboxes and screen option on the current page.
*
* @since 2.7.0
+ *
* @memberof postboxes
*
* @param {string} page The page we are currently on.
@@ -190,6 +193,7 @@
* Initializes all the postboxes, mainly their sortable behaviour.
*
* @since 2.7.0
+ *
* @memberof postboxes
*
* @param {string} page The page we are currently on.
@@ -272,6 +276,7 @@
* hidden postboxes.
*
* @since 2.7.0
+ *
* @memberof postboxes
*
* @param {string} page The page we are currently on.
@@ -303,6 +308,7 @@
* Sends a list of all postboxes inside a sortable area to the server.
*
* @since 2.8.0
+ *
* @memberof postboxes
*
* @param {string} page The page we are currently on.
@@ -333,9 +339,10 @@
* present.
*
* @since 3.3.0
- * @memberof postboxes
* @access private
*
+ * @memberof postboxes
+ *
* @return {void}
*/
_mark_area : function() {
@@ -365,10 +372,12 @@
* Changes the amount of columns on the post edit page.
*
* @since 3.3.0
- * @memberof postboxes
- * @fires postboxes#postboxes-columnchange
* @access private
*
+ * @memberof postboxes
+ *
+ * @fires postboxes#postboxes-columnchange
+ *
* @param {number} n The amount of columns to divide the post edit page in.
* @return {void}
*/
@@ -395,9 +404,10 @@
* orientation of the browser.
*
* @since 3.3.0
- * @memberof postboxes
* @access private
*
+ * @memberof postboxes
+ *
* @return {void}
*/
_pb_change : function() {
@@ -425,19 +435,20 @@
/**
* @since 2.7.0
- * @memberof postboxes
* @access public
+ *
* @property {Function|boolean} pbshow A callback that is called when a postbox
* is opened.
+ * @memberof postboxes
*/
pbshow : false,
/**
* @since 2.7.0
- * @memberof postboxes
* @access public
* @property {Function|boolean} pbhide A callback that is called when a postbox
* is closed.
+ * @memberof postboxes
*/
pbhide : false
};
diff --git a/src/js/_enqueues/admin/privacy-tools.js b/src/js/_enqueues/admin/privacy-tools.js
index 802ec88f4b..90b3a49233 100644
--- a/src/js/_enqueues/admin/privacy-tools.js
+++ b/src/js/_enqueues/admin/privacy-tools.js
@@ -4,7 +4,7 @@
* @output wp-admin/js/privacy-tools.js
*/
-// Privacy request action handling
+// Privacy request action handling.
jQuery( document ).ready( function( $ ) {
var strings = window.privacyToolsL10n || {};
@@ -111,7 +111,7 @@ jQuery( document ).ready( function( $ ) {
if ( ! response.success ) {
- // e.g. invalid request ID
+ // e.g. invalid request ID.
onExportFailure( response.data );
return;
}
@@ -127,12 +127,12 @@ jQuery( document ).ready( function( $ ) {
}
}).fail( function( jqxhr, textStatus, error ) {
- // e.g. Nonce failure
+ // e.g. Nonce failure.
onExportFailure( error );
});
}
- // And now, let's begin
+ // And now, let's begin.
setActionState( $action, 'export-personal-data-processing' );
doNextExport( 1, 1 );
});
@@ -224,7 +224,7 @@ jQuery( document ).ready( function( $ ) {
});
}
- // And now, let's begin
+ // And now, let's begin.
setActionState( $action, 'remove-personal-data-processing' );
doNextErasure( 1, 1 );
diff --git a/src/js/_enqueues/admin/site-health.js b/src/js/_enqueues/admin/site-health.js
index 015b06c5ec..b0f24c7121 100644
--- a/src/js/_enqueues/admin/site-health.js
+++ b/src/js/_enqueues/admin/site-health.js
@@ -259,9 +259,11 @@ jQuery( document ).ready( function( $ ) {
RecalculateProgression();
if ( delay > 3000 ) {
- // We have announced that we're waiting.
- // Announce that we're ready after giving at least 3 seconds for the first announcement
- // to be read out, or the two may collide.
+ /*
+ * We have announced that we're waiting.
+ * Announce that we're ready after giving at least 3 seconds
+ * for the first announcement to be read out, or the two may collide.
+ */
if ( delay > 6000 ) {
delay = 0;
} else {
diff --git a/src/js/_enqueues/admin/tags-box.js b/src/js/_enqueues/admin/tags-box.js
index c4676f263e..40105e2d38 100644
--- a/src/js/_enqueues/admin/tags-box.js
+++ b/src/js/_enqueues/admin/tags-box.js
@@ -52,6 +52,7 @@
* Cleans up tags by removing redundant characters.
*
* @since 2.9.0
+ *
* @memberOf tagBox
*
* @param {string} tags Comma separated tags that need to be cleaned up.
@@ -76,6 +77,7 @@
* Parses tags and makes them editable.
*
* @since 2.9.0
+ *
* @memberOf tagBox
*
* @param {Object} el The tag element to retrieve the ID from.
@@ -110,6 +112,7 @@
* Creates clickable links, buttons and fields for adding or editing tags.
*
* @since 2.9.0
+ *
* @memberOf tagBox
*
* @param {Object} el The container HTML element.
@@ -134,6 +137,7 @@
* Creates a delete button if tag editing is enabled, before adding it to the tag list.
*
* @since 2.5.0
+ *
* @memberOf tagBox
*
* @param {string} key The index of the current tag.
@@ -209,6 +213,7 @@
* Also ensures that the quick links are properly generated.
*
* @since 2.9.0
+ *
* @memberOf tagBox
*
* @param {Object} el The container HTML element.
@@ -262,6 +267,7 @@
* tagcloud. Clicking a tag will add it.
*
* @since 2.9.0
+ *
* @memberOf tagBox
*
* @param {string} id The ID to extract the taxonomy from.
@@ -350,6 +356,7 @@
* retrieval of tag suggestions.
*
* @since 2.9.0
+ *
* @memberOf tagBox
*
* @return {void}
diff --git a/src/js/_enqueues/admin/tags-suggest.js b/src/js/_enqueues/admin/tags-suggest.js
index 50075a654b..c5ccf16eaf 100644
--- a/src/js/_enqueues/admin/tags-suggest.js
+++ b/src/js/_enqueues/admin/tags-suggest.js
@@ -89,8 +89,8 @@
focus: function( event, ui ) {
$element.attr( 'aria-activedescendant', 'wp-tags-autocomplete-' + ui.item.id );
- // Don't empty the input field when using the arrow keys to
- // highlight items. See api.jqueryui.com/autocomplete/#event-focus
+ // Don't empty the input field when using the arrow keys
+ // to highlight items. See api.jqueryui.com/autocomplete/#event-focus
event.preventDefault();
},
select: function( event, ui ) {
@@ -113,7 +113,7 @@
window.tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
}
- // Do not close Quick Edit / Bulk Edit
+ // Do not close Quick Edit / Bulk Edit.
event.preventDefault();
event.stopPropagation();
}
@@ -175,14 +175,16 @@
.attr( 'role', 'listbox' )
.removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
- // Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
- // The `menufocus` and `menublur` events are the same events used to add and remove
- // the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
+ /*
+ * Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
+ * The `menufocus` and `menublur` events are the same events used to add and remove
+ * the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
+ */
.on( 'menufocus', function( event, ui ) {
ui.item.attr( 'aria-selected', 'true' );
})
.on( 'menublur', function() {
- // The `menublur` event returns an object where the item is `null`
+ // The `menublur` event returns an object where the item is `null`,
// so we need to find the active item with other means.
$( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
});
diff --git a/src/js/_enqueues/admin/tags.js b/src/js/_enqueues/admin/tags.js
index df5b3f7e5d..d87b98174b 100644
--- a/src/js/_enqueues/admin/tags.js
+++ b/src/js/_enqueues/admin/tags.js
@@ -132,10 +132,14 @@ jQuery(document).ready(function($) {
parent = form.find( 'select#parent' ).val();
- if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list.
- $( '.tags #tag-' + parent ).after( res.responses[0].supplemental.noparents ); // As the parent exists, Insert the version with - - - prefixed
- else
- $( '.tags' ).prepend( res.responses[0].supplemental.parents ); // As the parent is not visible, Insert the version with Parent - Child - ThisTerm
+ // If the parent exists on this page, insert it below. Else insert it at the top of the list.
+ if ( parent > 0 && $('#tag-' + parent ).length > 0 ) {
+ // As the parent exists, insert the version with - - - prefixed.
+ $( '.tags #tag-' + parent ).after( res.responses[0].supplemental.noparents );
+ } else {
+ // As the parent is not visible, insert the version with Parent - Child - ThisTerm.
+ $( '.tags' ).prepend( res.responses[0].supplemental.parents );
+ }
$('.tags .no-items').remove();
@@ -143,7 +147,7 @@ jQuery(document).ready(function($) {
// Parents field exists, Add new term to the list.
term = res.responses[1].supplemental;
- // Create an indent for the Parent field
+ // Create an indent for the Parent field.
indent = '';
for ( i = 0; i < res.responses[1].position; i++ )
indent += ' ';
diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js
index f737dde255..ff4830242c 100644
--- a/src/js/_enqueues/admin/user-profile.js
+++ b/src/js/_enqueues/admin/user-profile.js
@@ -196,7 +196,7 @@
resetToggle( false );
if ( $pass1Row.closest( 'form' ).is( '#your-profile' ) ) {
- // Clear password field to prevent update
+ // Clear password field to prevent update.
$pass1.val( '' ).trigger( 'pwupdate' );
$submitButtons.prop( 'disabled', false );
}
@@ -342,7 +342,7 @@
$this.siblings( '.selected' ).removeClass( 'selected' );
$this.addClass( 'selected' ).find( 'input[type="radio"]' ).prop( 'checked', true );
- // Set color scheme
+ // Set color scheme.
if ( user_id === current_user_id ) {
// Load the colors stylesheet.
// The default color scheme won't have one, so we'll need to create an element.
@@ -351,7 +351,7 @@
}
$stylesheet.attr( 'href', $this.children( '.css_url' ).val() );
- // repaint icons
+ // Repaint icons.
if ( typeof wp !== 'undefined' && wp.svgPainter ) {
try {
colors = $.parseJSON( $this.children( '.icon_colors' ).val() );
@@ -363,7 +363,7 @@
}
}
- // update user option
+ // Update user option.
$.post( ajaxurl, {
action: 'save-user-color-scheme',
color_scheme: $this.children( 'input[name="admin_color"]' ).val(),
diff --git a/src/js/_enqueues/admin/widgets.js b/src/js/_enqueues/admin/widgets.js
index 00ae62dbae..3d72db74e2 100644
--- a/src/js/_enqueues/admin/widgets.js
+++ b/src/js/_enqueues/admin/widgets.js
@@ -222,9 +222,9 @@ window.wpWidgets = {
the_id = this.id;
if ( chooser.length ) {
- // Hide the chooser and move it out of the widget
+ // Hide the chooser and move it out of the widget.
$( '#wpbody-content' ).append( chooser.hide() );
- // Delete the cloned chooser from the drag helper
+ // Delete the cloned chooser from the drag helper.
ui.helper.find('.widgets-chooser').remove();
self.clearWidgetSelection();
}
@@ -321,7 +321,7 @@ window.wpWidgets = {
wpWidgets.hoveredSidebar = null;
if ( $widget.hasClass('deleting') ) {
- wpWidgets.save( $widget, 1, 0, 1 ); // delete widget
+ wpWidgets.save( $widget, 1, 0, 1 ); // Delete widget.
$widget.remove();
return;
}
@@ -363,7 +363,7 @@ window.wpWidgets = {
$children = $sidebar.children('.widget');
- // Make sure the dropped widget is at the top
+ // Make sure the dropped widget is at the top.
if ( $children.length > 1 ) {
child = $children.get(0);
item = $widget.get(0);
@@ -386,14 +386,14 @@ window.wpWidgets = {
},
deactivate: function() {
- // Remove all min-height added on "start"
+ // Remove all min-height added on "start".
$(this).css( 'min-height', '' ).parent().removeClass( 'widget-hover' );
},
receive: function( event, ui ) {
var $sender = $( ui.sender );
- // Don't add more widgets to orphaned sidebars
+ // Don't add more widgets to orphaned sidebars.
if ( this.id.indexOf('orphaned_widgets') > -1 ) {
$sender.sortable('cancel');
return;
@@ -431,7 +431,7 @@ window.wpWidgets = {
}
});
- // Area Chooser
+ // Area Chooser.
$( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) {
var $element = $( element ),
name = $element.find( '.sidebar-name h2' ).text(),
@@ -465,7 +465,7 @@ window.wpWidgets = {
toggleButton.attr( 'aria-expanded', 'false' );
self.closeChooser();
} else {
- // Open the chooser
+ // Open the chooser.
self.clearWidgetSelection();
$( '#widgets-left' ).addClass( 'chooser' );
// Add CSS class and insert the chooser after the widget description.
@@ -486,7 +486,7 @@ window.wpWidgets = {
}
});
- // Add event handlers
+ // Add event handlers.
chooser.on( 'click.widgets-chooser', function( event ) {
var $target = $( event.target );
@@ -662,7 +662,7 @@ window.wpWidgets = {
add = widget.find( 'input.add_new' ).val();
n = widget.find( 'input.multi_number' ).val();
- // Remove the cloned chooser from the widget
+ // Remove the cloned chooser from the widget.
widget.find('.widgets-chooser').remove();
if ( 'multi' === add ) {
@@ -689,7 +689,7 @@ window.wpWidgets = {
sidebar.sortable('refresh');
wpWidgets.save( widget, 0, 0, 1 );
- // No longer "new" widget
+ // No longer "new" widget.
widget.find( 'input.add_new' ).val('');
$document.trigger( 'widget-added', [ widget ] );
diff --git a/src/js/_enqueues/lib/accordion.js b/src/js/_enqueues/lib/accordion.js
index 0bec1ce514..7eacbec966 100644
--- a/src/js/_enqueues/lib/accordion.js
+++ b/src/js/_enqueues/lib/accordion.js
@@ -35,11 +35,11 @@
// Expand/Collapse accordion sections on click.
$( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) {
- if ( e.type === 'keydown' && 13 !== e.which ) { // "return" key
+ if ( e.type === 'keydown' && 13 !== e.which ) { // "Return" key.
return;
}
- e.preventDefault(); // Keep this AFTER the key filter above
+ e.preventDefault(); // Keep this AFTER the key filter above.
accordionSwitch( $( this ) );
});
@@ -80,7 +80,7 @@
section.toggleClass( 'open' );
}
- // We have to wait for the animations to finish
+ // We have to wait for the animations to finish.
setTimeout(function(){
container.removeClass( 'opening' );
}, 150);
diff --git a/src/js/_enqueues/lib/admin-bar.js b/src/js/_enqueues/lib/admin-bar.js
index 3e4292f36a..537df2d98f 100644
--- a/src/js/_enqueues/lib/admin-bar.js
+++ b/src/js/_enqueues/lib/admin-bar.js
@@ -264,7 +264,7 @@
return;
}
- // (Old) IE doesn't support preventDefault, and does support returnValue
+ // (Old) IE doesn't support preventDefault, and does support returnValue.
if ( event.preventDefault ) {
event.preventDefault();
}
@@ -451,7 +451,7 @@
};
}
- // Get the closest matching elent
+ // Get the closest matching elent.
for ( ; el && el !== document; el = el.parentNode ) {
if ( el.matches( selector ) ) {
return el;
diff --git a/src/js/_enqueues/lib/ajax-response.js b/src/js/_enqueues/lib/ajax-response.js
index fd71ff3702..f2eedf3732 100644
--- a/src/js/_enqueues/lib/ajax-response.js
+++ b/src/js/_enqueues/lib/ajax-response.js
@@ -17,7 +17,7 @@ window.wpAjax = jQuery.extend( {
}
return r;
},
- parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission
+ parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission.
var parsed = {}, re = jQuery('#' + r).empty(), err = '';
if ( x && typeof x == 'object' && x.getElementsByTagName('wp_ajax') ) {
@@ -64,7 +64,7 @@ window.wpAjax = jQuery.extend( {
}
}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } );
-// Basic form validation
+// Basic form validation.
jQuery(document).ready( function($){
$('form.validate').submit( function() { return wpAjax.validateForm( $(this) ); } );
});
diff --git a/src/js/_enqueues/lib/auth-check.js b/src/js/_enqueues/lib/auth-check.js
index 158b6e1750..ef6d861de0 100644
--- a/src/js/_enqueues/lib/auth-check.js
+++ b/src/js/_enqueues/lib/auth-check.js
@@ -51,8 +51,8 @@
else
parent.css( 'max-height', height + 40 + 'px' );
} else if ( ! body || ! body.length ) {
- // Catch "silent" iframe origin exceptions in WebKit after another page is
- // loaded in the iframe.
+ // Catch "silent" iframe origin exceptions in WebKit
+ // after another page is loaded in the iframe.
wrap.addClass('fallback');
parent.css( 'max-height', '' );
form.remove();
@@ -68,9 +68,11 @@
if ( frame ) {
frame.focus();
- // WebKit doesn't throw an error if the iframe fails to load because of
- // "X-Frame-Options: DENY" header.
- // Wait for 10 sec. and switch to the fallback text.
+ /*
+ * WebKit doesn't throw an error if the iframe fails to load
+ * because of "X-Frame-Options: DENY" header.
+ * Wait for 10 seconds and switch to the fallback text.
+ */
setTimeout( function() {
if ( ! loaded ) {
wrap.addClass('fallback');
@@ -92,8 +94,8 @@
function hide() {
$(window).off( 'beforeunload.wp-auth-check' );
- // When on the Edit Post screen, speed up heartbeat after the user logs in to
- // quickly refresh nonces.
+ // When on the Edit Post screen, speed up heartbeat
+ // after the user logs in to quickly refresh nonces.
if ( typeof adminpage !== 'undefined' && ( adminpage === 'post-php' || adminpage === 'post-new-php' ) &&
typeof wp !== 'undefined' && wp.heartbeat ) {
diff --git a/src/js/_enqueues/lib/color-picker.js b/src/js/_enqueues/lib/color-picker.js
index 0a99ae00cc..18f2bc26dc 100644
--- a/src/js/_enqueues/lib/color-picker.js
+++ b/src/js/_enqueues/lib/color-picker.js
@@ -36,7 +36,6 @@
* Creates a color picker that only allows you to adjust the hue.
*
* @since 3.5.0
- *
* @access private
*
* @return {void}
@@ -80,7 +79,6 @@
* Creates the color picker, sets default values, css classes and wraps it all in HTML.
*
* @since 3.5.0
- *
* @access private
*
* @return {void}
@@ -209,7 +207,6 @@
* Binds event listeners to the color picker.
*
* @since 3.5.0
- *
* @access private
*
* @return {void}
diff --git a/src/js/_enqueues/lib/comment-reply.js b/src/js/_enqueues/lib/comment-reply.js
index ea973f41e8..1ba9498f11 100644
--- a/src/js/_enqueues/lib/comment-reply.js
+++ b/src/js/_enqueues/lib/comment-reply.js
@@ -95,7 +95,7 @@ window.addComment = ( function( window ) {
cancelElement.addEventListener( 'touchstart', cancelEvent );
cancelElement.addEventListener( 'click', cancelEvent );
- // Submit the comment form when the user types CTRL or CMD + 'Enter'.
+ // Submit the comment form when the user types [Ctrl] or [Cmd] + [Enter].
var submitFormHandler = function( e ) {
if ( ( e.metaKey || e.ctrlKey ) && e.keyCode === 13 ) {
commentFormElement.removeEventListener( 'keydown', submitFormHandler );
diff --git a/src/js/_enqueues/lib/cookies.js b/src/js/_enqueues/lib/cookies.js
index ac74bdb3a8..66d920affa 100644
--- a/src/js/_enqueues/lib/cookies.js
+++ b/src/js/_enqueues/lib/cookies.js
@@ -115,7 +115,7 @@ window.wpCookies = {
if ( typeof( expires ) === 'object' && expires.toGMTString ) {
expires = expires.toGMTString();
} else if ( parseInt( expires, 10 ) ) {
- d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) ); // time must be in milliseconds
+ d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) ); // Time must be in milliseconds.
expires = d.toGMTString();
} else {
expires = '';
@@ -153,9 +153,11 @@ window.getUserSetting = function( name, def ) {
return '';
};
-// Both name and value must be only ASCII letters, numbers or underscore
-// and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text.
-// The value is converted and stored as string.
+/*
+ * Both name and value must be only ASCII letters, numbers or underscore
+ * and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text.
+ * The value is converted and stored as string.
+ */
window.setUserSetting = function( name, value, _del ) {
if ( 'object' !== typeof userSettings ) {
return false;
@@ -192,7 +194,7 @@ window.deleteUserSetting = function( name ) {
return setUserSetting( name, '', 1 );
};
-// Returns all settings as js object.
+// Returns all settings as JS object.
window.getAllUserSettings = function() {
if ( 'object' !== typeof userSettings ) {
return {};
diff --git a/src/js/_enqueues/lib/gallery.js b/src/js/_enqueues/lib/gallery.js
index 36cb08636b..dda3e33408 100644
--- a/src/js/_enqueues/lib/gallery.js
+++ b/src/js/_enqueues/lib/gallery.js
@@ -15,7 +15,7 @@ jQuery(document).ready(function($) {
distance: 2,
handle: 'div.filename',
stop: function() {
- // When an update has occurred, adjust the order for each item
+ // When an update has occurred, adjust the order for each item.
var all = $('#media-items').sortable('toArray'), len = all.length;
$.each(all, function(i, id) {
var order = desc ? (len - i) : (1 + i);
@@ -71,7 +71,7 @@ jQuery(document).ready(function($) {
$('img.pinkynail').toggle(true);
});
- // initialize sortable
+ // Initialize sortable.
gallerySortableInit();
clearAll();
@@ -88,7 +88,7 @@ jQuery(document).ready(function($) {
}
});
-jQuery(window).unload( function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup
+jQuery(window).unload( function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup.
/* gallery settings */
window.tinymce = null;
@@ -122,7 +122,7 @@ window.wpgallery = {
document.domain = q.mce_rdomain;
}
- // Find window & API
+ // Find window & API.
window.tinymce = w.tinymce;
window.tinyMCE = w.tinyMCE;
t.editor = tinymce.EditorManager.activeEditor;
diff --git a/src/js/_enqueues/lib/image-edit.js b/src/js/_enqueues/lib/image-edit.js
index 756d2e4da1..d2b0139bc1 100644
--- a/src/js/_enqueues/lib/image-edit.js
+++ b/src/js/_enqueues/lib/image-edit.js
@@ -48,8 +48,9 @@
/**
* Converts a value to an integer.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} f The float value that should be converted.
*
@@ -66,8 +67,9 @@
/**
* Adds the disabled attribute and class to a single form element or a field set.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {jQuery} el The element that should be modified.
* @param {bool|number} s The state for the element. If set to true
@@ -95,8 +97,9 @@
/**
* Initializes the image editor.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
*
@@ -121,12 +124,12 @@
$('input[type="text"]', '#imgedit-panel-' + postid).keypress(function(e) {
var k = e.keyCode;
- // Key codes 37 thru 40 are the arrow keys.
+ // Key codes 37 through 40 are the arrow keys.
if ( 36 < k && k < 41 ) {
$(this).blur();
}
- // The key code 13 is the enter key.
+ // The key code 13 is the Enter key.
if ( 13 === k ) {
e.preventDefault();
e.stopPropagation();
@@ -138,8 +141,9 @@
/**
* Toggles the wait/load icon in the editor.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {number} toggle Is 0 or 1, fades the icon in then 1 and out when 0.
@@ -159,8 +163,9 @@
/**
* Shows or hides the image edit help box.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {HTMLElement} el The element to create the help window in.
*
@@ -181,8 +186,9 @@
* The image edit target contains the image sizes where the (possible) changes
* have to be applied to.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
*
@@ -198,8 +204,9 @@
*
* If the original image size is exceeded a red exclamation mark is shown.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The current post id.
* @param {number} x Is 0 when it applies the y-axis
@@ -234,8 +241,9 @@
/**
* Gets the selected aspect ratio.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
*
@@ -261,8 +269,9 @@
* Removes the last action from the image edit history.
* The history consist of (edit) actions performed on the image.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {number} setSize 0 or 1, when 1 the image resets to its original size.
@@ -295,13 +304,13 @@
// Restore original 'o'.
o = history[history.length - 1];
- // c = 'crop', r = 'rotate', f = 'flip'
+ // c = 'crop', r = 'rotate', f = 'flip'.
o = o.c || o.r || o.f || false;
if ( o ) {
- // fw = Full image width
+ // fw = Full image width.
this.hold.w = o.fw;
- // fh = Full image height
+ // fh = Full image height.
this.hold.h = o.fh;
}
}
@@ -326,8 +335,9 @@
*
* When the image source is reloaded the image will be reloaded.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {string} nonce The nonce to verify the request.
@@ -371,7 +381,7 @@
parent.empty().append(img);
- // w, h are the new full size dims
+ // w, h are the new full size dimensions.
max1 = Math.max( t.hold.w, t.hold.h );
max2 = Math.max( $(img).width(), $(img).height() );
t.hold.sizer = max1 > max2 ? max2 / max1 : 1;
@@ -399,8 +409,9 @@
/**
* Performs an image edit action.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {string} nonce The nonce to verify the request.
@@ -456,7 +467,7 @@
$.post(ajaxurl, data, function(r) {
$('#image-editor-' + postid).empty().append(r);
t.toggleEditor(postid, 0);
- // refresh the attachment model so that changes propagate
+ // Refresh the attachment model so that changes propagate.
if ( t._view ) {
t._view.refresh();
}
@@ -466,8 +477,9 @@
/**
* Stores the changes that are made to the image.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id to get the image from the database.
* @param {string} nonce The nonce to verify the request.
@@ -531,8 +543,9 @@
/**
* Creates the image edit window.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id for the image.
* @param {string} nonce The nonce to verify the request.
@@ -588,8 +601,9 @@
/**
* Initializes the cropping tool and sets a default cropping selection.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
*
@@ -614,8 +628,9 @@
/**
* Initializes the cropping tool.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {HTMLElement} image The preview image.
@@ -645,8 +660,8 @@
* @param {jQuery} img The preview image.
*/
onInit: function( img ) {
- // Ensure that the imgAreaSelect wrapper elements are position:absolute.
- // (even if we're in a position:fixed modal)
+ // Ensure that the imgAreaSelect wrapper elements are position:absolute
+ // (even if we're in a position:fixed modal).
$img = $( img );
$img.next().css( 'position', 'absolute' )
.nextAll( '.imgareaselect-outer' ).css( 'position', 'absolute' );
@@ -715,8 +730,9 @@
/**
* Stores the current crop selection.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {object} c The selection.
@@ -746,8 +762,9 @@
/**
* Closes the image editor.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {bool} warn Warning message.
@@ -764,13 +781,14 @@
this.iasapi = {};
this.hold = {};
- // If we've loaded the editor in the context of a Media Modal, then switch to the previous view,
- // whatever that might have been.
+ // If we've loaded the editor in the context of a Media Modal,
+ // then switch to the previous view, whatever that might have been.
if ( this._view ){
this._view.back();
}
- // In case we are not accessing the image editor in the context of a View, close the editor the old-skool way
+ // In case we are not accessing the image editor in the context of a View,
+ // close the editor the old-school way.
else {
$('#image-editor-' + postid).fadeOut('fast', function() {
$( '#media-head-' + postid ).fadeIn( 'fast', function() {
@@ -787,8 +805,9 @@
/**
* Checks if the image edit history is saved.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
*
@@ -811,8 +830,9 @@
/**
* Adds an image edit action to the history.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {object} op The original position.
* @param {number} postid The post id.
@@ -830,7 +850,7 @@
history.pop();
pop--;
}
- undone.val(0); // reset
+ undone.val(0); // Reset.
history.push(op);
elem.val( JSON.stringify(history) );
@@ -844,8 +864,9 @@
/**
* Rotates the image.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {string} angle The angle the image is rotated with.
* @param {number} postid The post id.
@@ -865,8 +886,9 @@
/**
* Flips the image.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} axis The axle the image is flipped on.
* @param {number} postid The post id.
@@ -886,8 +908,9 @@
/**
* Crops the image.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {string} nonce The nonce.
@@ -915,8 +938,9 @@
/**
* Undoes an image edit action.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {string} nonce The nonce.
@@ -948,8 +972,9 @@
/**
* Reverts a undo action.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {string} nonce The nonce.
@@ -978,8 +1003,9 @@
/**
* Sets the selection for the height and width in pixels.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {jQuery} el The element containing the values.
@@ -1035,8 +1061,9 @@
/**
* Rounds a number to a whole.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} num The number.
*
@@ -1064,8 +1091,9 @@
/**
* Sets a locked aspect ratio for the selection.
*
+ * @since 2.9.0
+ *
* @memberof imageEdit
- * @since 2.9.0
*
* @param {number} postid The post id.
* @param {number} n The ratio to set.
@@ -1108,8 +1136,9 @@
/**
* Validates if a value in a jQuery.HTMLElement is numeric.
*
+ * @since 4.6.0
+ *
* @memberof imageEdit
- * @since 4.6
*
* @param {jQuery} el The html element.
*
diff --git a/src/js/_enqueues/lib/link.js b/src/js/_enqueues/lib/link.js
index 954d211131..1dfc1204e1 100644
--- a/src/js/_enqueues/lib/link.js
+++ b/src/js/_enqueues/lib/link.js
@@ -36,24 +36,24 @@
inputs.submit = $( '#wp-link-submit' );
inputs.close = $( '#wp-link-close' );
- // Input
+ // Input.
inputs.text = $( '#wp-link-text' );
inputs.url = $( '#wp-link-url' );
inputs.nonce = $( '#_ajax_linking_nonce' );
inputs.openInNewTab = $( '#wp-link-target' );
inputs.search = $( '#wp-link-search' );
- // Build Rivers
+ // Build rivers.
rivers.search = new River( $( '#search-results' ) );
rivers.recent = new River( $( '#most-recent-results' ) );
rivers.elements = inputs.dialog.find( '.query-results' );
- // Get search notice text
+ // Get search notice text.
inputs.queryNotice = $( '#query-notice-message' );
inputs.queryNoticeTextDefault = inputs.queryNotice.find( '.query-notice-default' );
inputs.queryNoticeTextHint = inputs.queryNotice.find( '.query-notice-hint' );
- // Bind event handlers
+ // Bind event handlers.
inputs.dialog.keydown( wpLink.keydown );
inputs.dialog.keyup( wpLink.keyup );
inputs.submit.click( function( event ) {
@@ -68,7 +68,7 @@
rivers.elements.on( 'river-select', wpLink.updateFields );
- // Display 'hint' message when search field or 'query-results' box are focused
+ // Display 'hint' message when search field or 'query-results' box are focused.
inputs.search.on( 'focus.wplink', function() {
inputs.queryNoticeTextDefault.hide();
inputs.queryNoticeTextHint.removeClass( 'screen-reader-text' ).show();
@@ -91,7 +91,7 @@
inputs.url.on( 'blur', wpLink.correctURL );
},
- // If URL wasn't corrected last time and doesn't start with http:, https:, ? # or /, prepend http://
+ // If URL wasn't corrected last time and doesn't start with http:, https:, ? # or /, prepend http://.
correctURL: function () {
var url = $.trim( inputs.url.val() );
@@ -154,24 +154,24 @@
refresh: function( url, text ) {
var linkText = '';
- // Refresh rivers (clear links, check visibility)
+ // Refresh rivers (clear links, check visibility).
rivers.search.refresh();
rivers.recent.refresh();
if ( wpLink.isMCE() ) {
wpLink.mceRefresh( url, text );
} else {
- // For the Text editor the "Link text" field is always shown
+ // For the Text editor the "Link text" field is always shown.
if ( ! inputs.wrap.hasClass( 'has-text-field' ) ) {
inputs.wrap.addClass( 'has-text-field' );
}
if ( document.selection ) {
- // Old IE
+ // Old IE.
linkText = document.selection.createRange().text || text || '';
} else if ( typeof this.textarea.selectionStart !== 'undefined' &&
( this.textarea.selectionStart !== this.textarea.selectionEnd ) ) {
- // W3C
+ // W3C.
text = this.textarea.value.substring( this.textarea.selectionStart, this.textarea.selectionEnd ) || text || '';
}
@@ -180,12 +180,14 @@
}
if ( isTouch ) {
- // Close the onscreen keyboard
+ // Close the onscreen keyboard.
inputs.url.focus().blur();
} else {
- // Focus the URL field and highlight its contents.
- // If this is moved above the selection changes,
- // IE will show a flashing cursor over the dialog.
+ /*
+ * Focus the URL field and highlight its contents.
+ * If this is moved above the selection changes,
+ * IE will show a flashing cursor over the dialog.
+ */
window.setTimeout( function() {
inputs.url[0].select();
inputs.url.focus();
@@ -203,7 +205,7 @@
hasSelectedText: function( linkNode ) {
var node, nodes, i, html = editor.selection.getContent();
- // Partial html and not a fully selected anchor element
+ // Partial html and not a fully selected anchor element.
if ( /]+>[^<]+<\/a>$/.test( html ) || html.indexOf('href=') === -1 ) ) {
return false;
}
@@ -259,7 +261,7 @@
inputs.search.val( '' );
}
- // Always reset the search
+ // Always reset the search.
window.setTimeout( function() {
wpLink.searchInternalLinks();
} );
@@ -358,11 +360,11 @@
html = wpLink.buildHtml(attrs);
- // Insert HTML
+ // Insert HTML.
if ( document.selection && wpLink.range ) {
- // IE
+ // IE.
// Note: If no text is selected, IE will not place the cursor
- // inside the closing tag.
+ // inside the closing tag.
textarea.focus();
wpLink.range.text = html + ( text || wpLink.range.text ) + '';
wpLink.range.moveToBookmark( wpLink.range.getBookmark() );
@@ -370,7 +372,7 @@
wpLink.range = null;
} else if ( typeof textarea.selectionStart !== 'undefined' ) {
- // W3C
+ // W3C.
begin = textarea.selectionStart;
end = textarea.selectionEnd;
selection = text || textarea.value.substring( begin, end );
@@ -388,7 +390,7 @@
textarea.value.substring( end, textarea.value.length )
);
- // Update cursor position
+ // Update cursor position.
textarea.selectionStart = textarea.selectionEnd = cursor;
}
@@ -484,10 +486,10 @@
selection = $.trim( selection );
if ( selection && emailRegexp.test( selection ) ) {
- // Selection is email address
+ // Selection is email address.
return 'mailto:' + selection;
} else if ( selection && urlRegexp.test( selection ) ) {
- // Selection is URL
+ // Selection is URL.
return selection.replace( /&|?38;/gi, '&' );
}
@@ -553,7 +555,7 @@
id = event.target.id;
// wp-link-submit must always be the last focusable element in the dialog.
- // following focusable elements will be skipped on keyboard navigation.
+ // Following focusable elements will be skipped on keyboard navigation.
if ( id === 'wp-link-submit' && ! event.shiftKey ) {
inputs.close.focus();
event.preventDefault();
@@ -656,18 +658,18 @@
this.deselect();
this.selected = li.addClass( 'selected' );
- // Make sure the element is visible
+ // Make sure the element is visible.
liHeight = li.outerHeight();
elHeight = this.element.height();
liTop = li.position().top;
elTop = this.element.scrollTop();
- if ( liTop < 0 ) // Make first visible element
+ if ( liTop < 0 ) // Make first visible element.
this.element.scrollTop( elTop + liTop );
- else if ( liTop + liHeight > elHeight ) // Make last visible element
+ else if ( liTop + liHeight > elHeight ) // Make last visible element.
this.element.scrollTop( elTop + liTop - elHeight + liHeight );
- // Trigger the river-select event
+ // Trigger the river-select event.
this.element.trigger( 'river-select', [ li, event, this ] );
},
deselect: function() {
diff --git a/src/js/_enqueues/lib/nav-menu.js b/src/js/_enqueues/lib/nav-menu.js
index 95b66c1a42..3a0bd642ef 100644
--- a/src/js/_enqueues/lib/nav-menu.js
+++ b/src/js/_enqueues/lib/nav-menu.js
@@ -69,7 +69,7 @@
},
jQueryExtensions : function() {
- // jQuery extensions
+ // jQuery extensions.
$.fn.extend({
menuItemDepth : function() {
var margin = api.isRTL ? this.eq(0).css('margin-right') : this.eq(0).css('margin-left');
@@ -114,7 +114,7 @@
depth = t.menuItemDepth(),
newDepth = depth + dir;
- // Change .menu-item-depth-n class
+ // Change .menu-item-depth-n class.
t.moveHorizontally( newDepth, depth );
});
},
@@ -125,10 +125,10 @@
diff = newDepth - depth,
subItemText = t.find('.is-submenu');
- // Change .menu-item-depth-n class
+ // Change .menu-item-depth-n class.
t.updateDepthClass( newDepth, depth ).updateParentMenuItemDBId();
- // If it has children, move those too
+ // If it has children, move those too.
if ( children ) {
children.each(function() {
var t = $(this),
@@ -138,7 +138,7 @@
});
}
- // Show "Sub item" helper text
+ // Show "Sub item" helper text.
if (0 === newDepth)
subItemText.hide();
else
@@ -153,7 +153,7 @@
parentDepth = depth - 1,
parent = item.prevAll( '.menu-item-depth-' + parentDepth ).first();
- if ( 0 === depth ) { // Item is on the top level, has no parent
+ if ( 0 === depth ) { // Item is on the top level, has no parent.
input.val(0);
} else { // Find the parent item, and retrieve its object id.
input.val( parent.find( '.menu-item-data-db-id' ).val() );
@@ -191,10 +191,10 @@
if ( !checkboxes.length )
return false;
- // Show the ajax spinner
+ // Show the Ajax spinner.
t.find( '.button-controls .spinner' ).addClass( 'is-active' );
- // Retrieve menu item data
+ // Retrieve menu item data.
$(checkboxes).each(function(){
var t = $(this),
listItemDBIDMatch = re.exec( t.attr('name') ),
@@ -205,9 +205,9 @@
menuItems[listItemDBID] = t.closest('li').getItemData( 'add-menu-item', listItemDBID );
});
- // Add the items
+ // Add the items.
api.addItemToMenu(menuItems, processMethod, function(){
- // Deselect the items and hide the ajax spinner
+ // Deselect the items and hide the Ajax spinner.
checkboxes.prop( 'checked', false );
t.find( '.button-controls .select-all' ).prop( 'checked', false );
t.find( '.button-controls .spinner' ).removeClass( 'is-active' );
@@ -312,22 +312,22 @@
case 'up':
newItemPosition = thisItemPosition - 1;
- // Already at top
+ // Already at top.
if ( 0 === thisItemPosition )
break;
- // If a sub item is moved to top, shift it to 0 depth
+ // If a sub item is moved to top, shift it to 0 depth.
if ( 0 === newItemPosition && 0 !== thisItemDepth )
thisItem.moveHorizontally( 0, thisItemDepth );
- // If prev item is sub item, shift to match depth
+ // If prev item is sub item, shift to match depth.
if ( 0 !== prevItemDepth )
thisItem.moveHorizontally( prevItemDepth, thisItemDepth );
// Does this item have sub items?
if ( thisItemChildren ) {
items = thisItem.add( thisItemChildren );
- // Move the entire block
+ // Move the entire block.
items.detach().insertBefore( menuItems.eq( newItemPosition ) ).updateParentMenuItemDBId();
} else {
thisItem.detach().insertBefore( menuItems.eq( newItemPosition ) ).updateParentMenuItemDBId();
@@ -351,40 +351,40 @@
items.detach().insertAfter( menuItems.eq( thisItemPosition + items.length ) ).updateParentMenuItemDBId();
} else {
- // If next item has sub items, shift depth
+ // If next item has sub items, shift depth.
if ( 0 !== nextItemChildren.length )
thisItem.moveHorizontally( nextItemDepth, thisItemDepth );
- // Have we reached the bottom
+ // Have we reached the bottom?
if ( menuItemsCount === thisItemPosition + 1 )
break;
thisItem.detach().insertAfter( menuItems.eq( thisItemPosition + 1 ) ).updateParentMenuItemDBId();
}
break;
case 'top':
- // Already at top
+ // Already at top.
if ( 0 === thisItemPosition )
break;
// Does this item have sub items?
if ( thisItemChildren ) {
items = thisItem.add( thisItemChildren );
- // Move the entire block
+ // Move the entire block.
items.detach().insertBefore( menuItems.eq( 0 ) ).updateParentMenuItemDBId();
} else {
thisItem.detach().insertBefore( menuItems.eq( 0 ) ).updateParentMenuItemDBId();
}
break;
case 'left':
- // As far left as possible
+ // As far left as possible.
if ( 0 === thisItemDepth )
break;
thisItem.shiftHorizontally( -1 );
break;
case 'right':
- // Can't be sub item at top
+ // Can't be sub item at top.
if ( 0 === thisItemPosition )
break;
- // Already sub item of prevItem
+ // Already sub item of prevItem.
if ( thisItemData['menu-item-parent-id'] === prevItemId )
break;
thisItem.shiftHorizontally( 1 );
@@ -402,7 +402,7 @@
api.refreshKeyboardAccessibility();
api.refreshAdvancedAccessibility();
- // Refresh the accessibility when the user comes close to the item in any way
+ // Refresh the accessibility when the user comes close to the item in any way.
menu.on( 'mouseenter.refreshAccessibility focus.refreshAccessibility touchstart.refreshAccessibility' , '.menu-item' , function(){
api.refreshAdvancedAccessibilityOfItem( $( this ).find( 'a.item-edit' ) );
} );
@@ -412,7 +412,7 @@
api.refreshAdvancedAccessibilityOfItem( $( this ) );
} );
- // Links for moving items
+ // Links for moving items.
menu.on( 'click', '.menus-move', function () {
var $this = $( this ),
dir = $this.data( 'dir' );
@@ -433,7 +433,7 @@
*/
refreshAdvancedAccessibilityOfItem : function( itemToRefresh ) {
- // Only refresh accessibility when necessary
+ // Only refresh accessibility when necessary.
if ( true !== $( itemToRefresh ).data( 'needs_accessibility_refresh' ) ) {
return;
}
@@ -494,7 +494,7 @@
itemPosition = primaryItems.index( menuItem ) + 1,
totalMenuItems = primaryItems.length,
- // String together help text for primary menu items
+ // String together help text for primary menu items.
title = menus.menuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$d', totalMenuItems );
} else {
parentItem = menuItem.prevAll( '.menu-item-depth-' + parseInt( depth - 1, 10 ) ).first(),
@@ -503,13 +503,13 @@
subItems = $( '.menu-item .menu-item-data-parent-id[value="' + parentItemId + '"]' ),
itemPosition = $( subItems.parents('.menu-item').get().reverse() ).index( menuItem ) + 1;
- // String together help text for sub menu items
+ // String together help text for sub menu items.
title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName );
}
$this.attr( 'aria-label', title );
- // Mark this item's accessibility as refreshed
+ // Mark this item's accessibility as refreshed.
$this.data( 'needs_accessibility_refresh', false );
},
@@ -523,10 +523,10 @@
// Hide all the move buttons by default.
$( '.menu-item-settings .field-move .menus-move' ).hide();
- // Mark all menu items as unprocessed
+ // Mark all menu items as unprocessed.
$( 'a.item-edit' ).data( 'needs_accessibility_refresh', true );
- // All open items have to be refreshed or they will show no links
+ // All open items have to be refreshed or they will show no links.
$( '.menu-item-edit-active a.item-edit' ).each( function() {
api.refreshAdvancedAccessibilityOfItem( this );
} );
@@ -541,18 +541,18 @@
thisItem = $this.parents( 'li.menu-item' ),
thisItemData = thisItem.getItemData();
- // Bail if it's not an arrow key
+ // Bail if it's not an arrow key.
if ( 37 != e.which && 38 != e.which && 39 != e.which && 40 != e.which )
return;
- // Avoid multiple keydown events
+ // Avoid multiple keydown events.
$this.off('keydown');
- // Bail if there is only one menu item
+ // Bail if there is only one menu item.
if ( 1 === $('#menu-to-edit li').length )
return;
- // If RTL, swap left/right arrows
+ // If RTL, swap left/right arrows.
arrows = { '38': 'up', '40': 'down', '37': 'left', '39': 'right' };
if ( $('body').hasClass('rtl') )
arrows = { '38' : 'up', '40' : 'down', '39' : 'left', '37' : 'right' };
@@ -571,7 +571,7 @@
api.moveMenuItem( $this, 'right' );
break;
}
- // Put focus back on same menu item
+ // Put focus back on same menu item.
$( '#edit-' + thisItemData['menu-item-db-id'] ).focus();
return false;
});
@@ -594,10 +594,10 @@
},
initToggles : function() {
- // init postboxes
+ // Init postboxes.
postboxes.add_postbox_toggles('nav-menus');
- // adjust columns functions for menus UI
+ // Adjust columns functions for menus UI.
columns.useCheckboxesForHidden();
columns.checked = function(field) {
$('.field-' + field).removeClass('hidden-field');
@@ -605,7 +605,7 @@
columns.unchecked = function(field) {
$('.field-' + field).addClass('hidden-field');
};
- // hide fields
+ // Hide fields.
api.menuList.hideAdvancedMenuItemFields();
$('.hide-postbox-tog').click(function () {
@@ -639,7 +639,7 @@
start: function(e, ui) {
var height, width, parent, children, tempHolder;
- // handle placement for rtl orientation
+ // Handle placement for RTL orientation.
if ( api.isRTL )
ui.item[0].style.right = 'auto';
@@ -649,19 +649,19 @@
originalDepth = ui.item.menuItemDepth();
updateCurrentDepth(ui, originalDepth);
- // Attach child elements to parent
- // Skip the placeholder
+ // Attach child elements to parent.
+ // Skip the placeholder.
parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item;
children = parent.childMenuItems();
transport.append( children );
// Update the height of the placeholder to match the moving item.
height = transport.outerHeight();
- // If there are children, account for distance between top of children and parent
+ // If there are children, account for distance between top of children and parent.
height += ( height > 0 ) ? (ui.placeholder.css('margin-top').slice(0, -2) * 1) : 0;
height += ui.helper.outerHeight();
helperHeight = height;
- height -= 2; // Subtract 2 for borders
+ height -= 2; // Subtract 2 for borders.
ui.placeholder.height(height);
// Update the width of the placeholder to match the moving item.
@@ -670,18 +670,18 @@
var depth = $(this).menuItemDepth();
maxChildDepth = (depth > maxChildDepth) ? depth : maxChildDepth;
});
- width = ui.helper.find('.menu-item-handle').outerWidth(); // Get original width
- width += api.depthToPx(maxChildDepth - originalDepth); // Account for children
- width -= 2; // Subtract 2 for borders
+ width = ui.helper.find('.menu-item-handle').outerWidth(); // Get original width.
+ width += api.depthToPx(maxChildDepth - originalDepth); // Account for children.
+ width -= 2; // Subtract 2 for borders.
ui.placeholder.width(width);
// Update the list of menu items.
tempHolder = ui.placeholder.next( '.menu-item' );
- tempHolder.css( 'margin-top', helperHeight + 'px' ); // Set the margin to absorb the placeholder
- ui.placeholder.detach(); // detach or jQuery UI will think the placeholder is a menu item
- $(this).sortable( 'refresh' ); // The children aren't sortable. We should let jQ UI know.
- ui.item.after( ui.placeholder ); // reattach the placeholder.
- tempHolder.css('margin-top', 0); // reset the margin
+ tempHolder.css( 'margin-top', helperHeight + 'px' ); // Set the margin to absorb the placeholder.
+ ui.placeholder.detach(); // Detach or jQuery UI will think the placeholder is a menu item.
+ $(this).sortable( 'refresh' ); // The children aren't sortable. We should let jQuery UI know.
+ ui.item.after( ui.placeholder ); // Reattach the placeholder.
+ tempHolder.css('margin-top', 0); // Reset the margin.
// Now that the element is complete, we can update...
updateSharedVars(ui);
@@ -690,31 +690,31 @@
var children, subMenuTitle,
depthChange = currentDepth - originalDepth;
- // Return child elements to the list
+ // Return child elements to the list.
children = transport.children().insertAfter(ui.item);
- // Add "sub menu" description
+ // Add "sub menu" description.
subMenuTitle = ui.item.find( '.item-title .is-submenu' );
if ( 0 < currentDepth )
subMenuTitle.show();
else
subMenuTitle.hide();
- // Update depth classes
+ // Update depth classes.
if ( 0 !== depthChange ) {
ui.item.updateDepthClass( currentDepth );
children.shiftDepthClass( depthChange );
updateMenuMaxDepth( depthChange );
}
- // Register a change
+ // Register a change.
api.registerChange();
// Update the item data.
ui.item.updateParentMenuItemDBId();
- // address sortable's incorrectly-calculated top in opera
+ // Address sortable's incorrectly-calculated top in Opera.
ui.item[0].style.top = 0;
- // handle drop placement for rtl orientation
+ // Handle drop placement for rtl orientation.
if ( api.isRTL ) {
ui.item[0].style.left = 'auto';
ui.item[0].style.right = 0;
@@ -736,9 +736,11 @@
edge = api.isRTL ? offset.left + ui.helper.width() : offset.left,
depth = api.negateIfRTL * api.pxToDepth( edge - menuEdge );
- // Check and correct if depth is not within range.
- // Also, if the dragged element is dragged upwards over
- // an item, shift the placeholder to a child position.
+ /*
+ * Check and correct if depth is not within range.
+ * Also, if the dragged element is dragged upwards over an item,
+ * shift the placeholder to a child position.
+ */
if ( depth > maxDepth || offset.top < ( prevBottom - api.options.targetTolerance ) ) {
depth = maxDepth;
} else if ( depth < minDepth ) {
@@ -748,7 +750,7 @@
if( depth != currentDepth )
updateCurrentDepth(ui, depth);
- // If we overlap the next element, manually shift downwards
+ // If we overlap the next element, manually shift downwards.
if( nextThreshold && offset.top + helperHeight > nextThreshold ) {
next.after( ui.placeholder );
updateSharedVars( ui );
@@ -955,12 +957,12 @@
return false;
}
- // Show the ajax spinner
+ // Show the Ajax spinner.
$( '.customlinkdiv .spinner' ).addClass( 'is-active' );
this.addLinkToMenu( url, label, processMethod, function() {
- // Remove the ajax spinner
+ // Remove the Ajax spinner.
$( '.customlinkdiv .spinner' ).removeClass( 'is-active' );
- // Set custom link form back to defaults
+ // Set custom link form back to defaults.
$('#custom-menu-item-name').val('').blur();
$( '#custom-menu-item-url' ).val( '' ).attr( 'placeholder', 'https://' );
});
@@ -997,10 +999,10 @@
$.post( ajaxurl, params, function(menuMarkup) {
var ins = $('#menu-instructions');
- menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces
+ menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces.
processMethod(menuMarkup, params);
- // Make it stand out a bit more visually, by adding a fadeIn
+ // Make it stand out a bit more visually, by adding a fadeIn.
$( 'li.pending' ).hide().fadeIn('slow');
$( '.drag-instructions' ).show();
if( ! ins.hasClass( 'menu-instructions-inactive' ) && ins.siblings().length )
@@ -1051,7 +1053,7 @@
return navMenuL10n.saveAlert;
};
} else {
- // Make the post boxes read-only, as they can't be used yet
+ // Make the post boxes read-only, as they can't be used yet.
$( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ).unbind( 'click' );
}
},
@@ -1071,7 +1073,7 @@
wrapper = target.parents('.accordion-section-content').first();
- // upon changing tabs, we want to uncheck all checkboxes
+ // Upon changing tabs, we want to uncheck all checkboxes.
$( 'input', wrapper ).prop( 'checked', false );
$('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
@@ -1080,7 +1082,7 @@
$('.tabs', wrapper).removeClass('tabs');
target.parent().addClass('tabs');
- // select the search bar
+ // Select the search bar.
$('.quick-search', wrapper).focus();
// Hide controls in the search tab if no items found.
@@ -1193,17 +1195,17 @@
var locs = '',
menuName = $('#menu-name'),
menuNameVal = menuName.val();
- // Cancel and warn if invalid menu name
+ // Cancel and warn if invalid menu name.
if ( ! menuNameVal || ! menuNameVal.replace( /\s+/, '' ) ) {
menuName.parent().addClass( 'form-invalid' );
return false;
}
- // Copy menu theme locations
+ // Copy menu theme locations.
$('#nav-menu-theme-locations select').each(function() {
locs += '';
});
$('#update-nav-menu').append( locs );
- // Update menu item position data
+ // Update menu item position data.
api.menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } );
window.onbeforeunload = null;
@@ -1211,7 +1213,7 @@
},
eventOnClickMenuDelete : function() {
- // Delete warning AYS
+ // Delete warning AYS.
if ( window.confirm( navMenuL10n.warnDeleteMenu ) ) {
window.onbeforeunload = null;
return true;
@@ -1253,7 +1255,7 @@
$items.each(function(){
$item = $(this);
- // make a unique DB ID number
+ // Make a unique DB ID number.
matched = pattern.exec($item.html());
if ( matched && matched[1] ) {
diff --git a/src/js/_enqueues/lib/pointer.js b/src/js/_enqueues/lib/pointer.js
index f841f82308..52524922c1 100644
--- a/src/js/_enqueues/lib/pointer.js
+++ b/src/js/_enqueues/lib/pointer.js
@@ -90,11 +90,11 @@
var o = this.options,
tip = this.pointer;
- // Handle document transfer
+ // Handle document transfer.
if ( key === 'document' && value !== o.document ) {
tip.detach().appendTo( value.body );
- // Handle class change
+ // Handle class change.
} else if ( key === 'pointerClass' ) {
tip.removeClass( o.pointerClass ).addClass( value );
}
@@ -102,11 +102,11 @@
// Call super method.
$.Widget.prototype._setOption.apply( this, arguments );
- // Reposition automatically
+ // Reposition automatically.
if ( key === 'position' ) {
this.reposition();
- // Update content automatically if pointer is open
+ // Update content automatically if pointer is open.
} else if ( key === 'content' && this.active ) {
this.update();
}
@@ -234,7 +234,7 @@
}).show().position($.extend({
of: this.element,
collision: 'fit none'
- }, position )); // the object comes before this.options.position so the user can override position.of.
+ }, position )); // The object comes before this.options.position so the user can override position.of.
this.repoint();
},
diff --git a/src/js/_enqueues/lib/quicktags.js b/src/js/_enqueues/lib/quicktags.js
index f7bc488691..2224cbed84 100644
--- a/src/js/_enqueues/lib/quicktags.js
+++ b/src/js/_enqueues/lib/quicktags.js
@@ -20,7 +20,7 @@
* @output wp-includes/js/quicktags.js
*/
-// new edit toolbar used with permission
+// New edit toolbar used with permission
// by Alex King
// http://www.alexking.org/
@@ -52,7 +52,7 @@ window.edToolbar = function(){};
/* jshint ignore:end */
(function(){
- // private stuff is prefixed with an underscore
+ // Private stuff is prefixed with an underscore.
var _domReady = function(func) {
var t, i, DOMContentLoaded, _tryReady;
@@ -150,7 +150,7 @@ window.edToolbar = function(){};
t.settings = settings;
if ( id === 'content' && typeof(adminpage) === 'string' && ( adminpage === 'post-new-php' || adminpage === 'post-php' ) ) {
- // back compat hack :-(
+ // Back compat hack :-(
window.edCanvas = canvas;
toolbar_id = 'ed_toolbar';
} else {
@@ -168,19 +168,19 @@ window.edToolbar = function(){};
canvas.parentNode.insertBefore(tb, canvas);
t.toolbar = tb;
- // listen for click events
+ // Listen for click events.
onclick = function(e) {
e = e || window.event;
var target = e.target || e.srcElement, visible = target.clientWidth || target.offsetWidth, i;
- // don't call the callback on pressing the accesskey when the button is not visible
+ // Don't call the callback on pressing the accesskey when the button is not visible.
if ( !visible ) {
return;
}
- // as long as it has the class ed_button, execute the callback
+ // As long as it has the class ed_button, execute the callback.
if ( / ed_button /.test(' ' + target.className + ' ') ) {
- // we have to reassign canvas here
+ // We have to reassign canvas here.
t.canvas = canvas = document.getElementById(id);
i = target.id.replace(name + '_', '');
@@ -261,7 +261,7 @@ window.edToolbar = function(){};
theButtons = {};
use = '';
- // set buttons
+ // Set buttons.
if ( settings.buttons ) {
use = ','+settings.buttons+',';
}
@@ -361,7 +361,7 @@ window.edToolbar = function(){};
return;
}
- if ( priority === -1 ) { // back-compat
+ if ( priority === -1 ) { // Back-compat.
return btn;
}
@@ -376,7 +376,7 @@ window.edToolbar = function(){};
}
if ( this.buttonsInitDone ) {
- this._buttonsInit(); // add the button HTML to all instances toolbars if addButton() was called too late
+ this._buttonsInit(); // Add the button HTML to all instances toolbars if addButton() was called too late.
}
};
@@ -387,12 +387,12 @@ window.edToolbar = function(){};
return false;
}
- if ( document.selection ) { //IE
+ if ( document.selection ) { // IE.
canvas.focus();
sel = document.selection.createRange();
sel.text = content;
canvas.focus();
- } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera
+ } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera.
text = canvas.value;
startPos = canvas.selectionStart;
endPos = canvas.selectionEnd;
@@ -420,7 +420,7 @@ window.edToolbar = function(){};
return true;
};
- // a plain, dumb button
+ // A plain, dumb button.
qt.Button = function( id, display, access, title, instance, attr ) {
this.id = id;
this.display = display;
@@ -450,7 +450,7 @@ window.edToolbar = function(){};
};
qt.Button.prototype.callback = function(){};
- // a button that inserts HTML tag
+ // A button that inserts HTML tag.
qt.TagButton = function( id, display, tagStart, tagEnd, access, title, instance, attr ) {
var t = this;
qt.Button.call( t, id, display, access, title, instance, attr );
@@ -485,7 +485,7 @@ window.edToolbar = function(){};
element.setAttribute( 'aria-label', this.attr.ariaLabel );
}
};
- // whether a tag is open or not. Returns false if not open, or current open depth of the tag
+ // Whether a tag is open or not. Returns false if not open, or current open depth of the tag.
qt.TagButton.prototype.isOpen = function (ed) {
var t = this, i = 0, ret = false;
if ( ed.openTags ) {
@@ -501,7 +501,7 @@ window.edToolbar = function(){};
qt.TagButton.prototype.callback = function(element, canvas, ed) {
var t = this, startPos, endPos, cursorPos, scrollTop, v = canvas.value, l, r, i, sel, endTag = v ? t.tagEnd : '', event;
- if ( document.selection ) { // IE
+ if ( document.selection ) { // IE.
canvas.focus();
sel = document.selection.createRange();
if ( sel.text.length > 0 ) {
@@ -522,7 +522,7 @@ window.edToolbar = function(){};
}
}
canvas.focus();
- } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera
+ } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera.
startPos = canvas.selectionStart;
endPos = canvas.selectionEnd;
@@ -532,12 +532,12 @@ window.edToolbar = function(){};
cursorPos = endPos;
scrollTop = canvas.scrollTop;
- l = v.substring(0, startPos); // left of the selection
- r = v.substring(endPos, v.length); // right of the selection
- i = v.substring(startPos, endPos); // inside the selection
+ l = v.substring(0, startPos); // Left of the selection.
+ r = v.substring(endPos, v.length); // Right of the selection.
+ i = v.substring(startPos, endPos); // Inside the selection.
if ( startPos !== endPos ) {
if ( !t.tagEnd ) {
- canvas.value = l + i + t.tagStart + r; // insert self closing tags after the selection
+ canvas.value = l + i + t.tagStart + r; // Insert self-closing tags after the selection.
cursorPos += t.tagStart.length;
} else {
canvas.value = l + t.tagStart + i + endTag + r;
@@ -562,7 +562,7 @@ window.edToolbar = function(){};
canvas.selectionEnd = cursorPos;
canvas.scrollTop = scrollTop;
canvas.focus();
- } else { // other browsers?
+ } else { // Other browsers?
if ( !endTag ) {
canvas.value += t.tagStart;
} else if ( t.isOpen(ed) !== false ) {
@@ -584,10 +584,10 @@ window.edToolbar = function(){};
}
};
- // removed
+ // Removed.
qt.SpellButton = function() {};
- // the close tags button
+ // The close tags button.
qt.CloseButton = function() {
qt.Button.call( this, 'close', quicktagsL10n.closeTags, '', quicktagsL10n.closeAllOpenTags );
};
@@ -621,7 +621,7 @@ window.edToolbar = function(){};
}
};
- // the link button
+ // The link button.
qt.LinkButton = function() {
var attr = {
ariaLabel: quicktagsL10n.link
@@ -653,7 +653,7 @@ window.edToolbar = function(){};
}
};
- // the img button
+ // The img button.
qt.ImgButton = function() {
var attr = {
ariaLabel: quicktagsL10n.image
@@ -704,14 +704,14 @@ window.edToolbar = function(){};
c.focus();
};
- // ensure backward compatibility
+ // Ensure backward compatibility.
edButtons[10] = new qt.TagButton( 'strong', 'b', '', '', '', '', '', { ariaLabel: quicktagsL10n.strong, ariaLabelClose: quicktagsL10n.strongClose } );
edButtons[20] = new qt.TagButton( 'em', 'i', '', '', '', '', '', { ariaLabel: quicktagsL10n.em, ariaLabelClose: quicktagsL10n.emClose } );
- edButtons[30] = new qt.LinkButton(); // special case
+ edButtons[30] = new qt.LinkButton(); // Special case.
edButtons[40] = new qt.TagButton( 'block', 'b-quote', '\n\n
', '
\n\n', '', '', '', { ariaLabel: quicktagsL10n.blockquote, ariaLabelClose: quicktagsL10n.blockquoteClose } );
edButtons[50] = new qt.TagButton( 'del', 'del', '', '', '', '', '', { ariaLabel: quicktagsL10n.del, ariaLabelClose: quicktagsL10n.delClose } );
edButtons[60] = new qt.TagButton( 'ins', 'ins', '', '', '', '', '', { ariaLabel: quicktagsL10n.ins, ariaLabelClose: quicktagsL10n.insClose } );
- edButtons[70] = new qt.ImgButton(); // special case
+ edButtons[70] = new qt.ImgButton(); // Special case.
edButtons[80] = new qt.TagButton( 'ul', 'ul', '
' ).text( ' ' + fileObj.name ) )
.appendTo( jQuery( '#media-items' ) );
- // Disable submit
+ // Disable submit.
jQuery( '#insert-gallery' ).prop( 'disabled', true );
}
@@ -40,27 +40,27 @@ function uploadProgress( up, file ) {
jQuery( '.percent', item ).html( file.percent + '%' );
}
-// check to see if a large file failed to upload
+// Check to see if a large file failed to upload.
function fileUploading( up, file ) {
var hundredmb = 100 * 1024 * 1024,
max = parseInt( up.settings.max_file_size, 10 );
if ( max > hundredmb && file.size > hundredmb ) {
setTimeout( function() {
- if ( file.status < 3 && file.loaded === 0 ) { // not uploading
+ if ( file.status < 3 && file.loaded === 0 ) { // Not uploading.
wpFileError( file, pluploadL10n.big_upload_failed.replace( '%1$s', '' ).replace( '%2$s', '' ) );
- up.stop(); // stops the whole queue
+ up.stop(); // Stop the whole queue.
up.removeFile( file );
- up.start(); // restart the queue
+ up.start(); // Restart the queue.
}
- }, 10000 ); // wait for 10 sec. for the file to start uploading
+ }, 10000 ); // Wait for 10 seconds for the file to start uploading.
}
}
function updateMediaForm() {
var items = jQuery( '#media-items' ).children();
- // Just one file, no need for collapsible part
+ // Just one file, no need for collapsible part.
if ( items.length == 1 ) {
items.addClass( 'open' ).find( '.slidetoggle' ).show();
jQuery( '.insert-gallery' ).hide();
@@ -80,11 +80,12 @@ function updateMediaForm() {
function uploadSuccess( fileObj, serverData ) {
var item = jQuery( '#media-item-' + fileObj.id );
- // on success serverData should be numeric, fix bug in html4 runtime returning the serverData wrapped in a
tag
+ // On success serverData should be numeric,
+ // fix bug in html4 runtime returning the serverData wrapped in a
(\d+)<\/pre>$/, '$1' );
- // if async-upload returned an error message, place it in the media item div and return
+ // If async-upload returned an error message, place it in the media item div and return.
if ( /media-upload-error|error-div/.test( serverData ) ) {
item.html( serverData );
return;
@@ -129,25 +130,27 @@ function prepareMediaItem( fileObj, serverData ) {
topWin.jQuery( '#TB_overlay' ).click( topWin.tb_remove );
} catch( e ){}
- if ( isNaN( serverData ) || !serverData ) { // Old style: Append the HTML returned by the server -- thumbnail and form inputs
+ if ( isNaN( serverData ) || !serverData ) {
+ // Old style: Append the HTML returned by the server -- thumbnail and form inputs.
item.append( serverData );
prepareMediaItemInit( fileObj );
- } else { // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server
+ } else {
+ // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server.
item.load( 'async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit( fileObj );updateMediaForm();});
}
}
function prepareMediaItemInit( fileObj ) {
var item = jQuery( '#media-item-' + fileObj.id );
- // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename
+ // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename.
jQuery( '.thumbnail', item ).clone().attr( 'class', 'pinkynail toggle' ).prependTo( item );
- // Replace the original filename with the new (unique) one assigned during upload
+ // Replace the original filename with the new (unique) one assigned during upload.
jQuery( '.filename.original', item ).replaceWith( jQuery( '.filename.new', item ) );
- // Bind AJAX to the new Delete button
+ // Bind AJAX to the new Delete button.
jQuery( 'a.delete', item ).click( function(){
- // Tell the server to delete it. TODO: handle exceptions
+ // Tell the server to delete it. TODO: Handle exceptions.
jQuery.ajax({
url: ajaxurl,
type: 'post',
@@ -163,9 +166,9 @@ function prepareMediaItemInit( fileObj ) {
return false;
});
- // Bind AJAX to the new Undo button
+ // Bind AJAX to the new Undo button.
jQuery( 'a.undo', item ).click( function(){
- // Tell the server to untrash it. TODO: handle exceptions
+ // Tell the server to untrash it. TODO: Handle exceptions.
jQuery.ajax({
url: ajaxurl,
type: 'post',
@@ -195,16 +198,16 @@ function prepareMediaItemInit( fileObj ) {
return false;
});
- // Open this item if it says to start open (e.g. to display an error)
+ // Open this item if it says to start open (e.g. to display an error).
jQuery( '#media-item-' + fileObj.id + '.startopen' ).removeClass( 'startopen' ).addClass( 'open' ).find( 'slidetoggle' ).fadeIn();
}
-// generic error message
+// Generic error message.
function wpQueueError( message ) {
jQuery( '#media-upload-error' ).show().html( '
' + message + '
' );
}
-// file-specific error messages
+// File-specific error messages.
function wpFileError( fileObj, message ) {
itemAjaxError( fileObj.id, message );
}
@@ -212,7 +215,7 @@ function wpFileError( fileObj, message ) {
function itemAjaxError( id, message ) {
var item = jQuery( '#media-item-' + id ), filename = item.find( '.filename' ).text(), last_err = item.data( 'last-err' );
- if ( last_err == id ) // prevent firing an error for the same file twice
+ if ( last_err == id ) // Prevent firing an error for the same file twice.
return;
item.html( '
' +
@@ -274,7 +277,7 @@ function switchUploader( s ) {
if ( typeof( uploader ) == 'object' )
uploader.refresh();
} else {
- setUserSetting( 'uploader', '1' ); // 1 == html uploader
+ setUserSetting( 'uploader', '1' ); // 1 == html uploader.
jQuery( '.media-upload-form' ).addClass( 'html-uploader' );
}
}
@@ -365,7 +368,7 @@ jQuery( document ).ready( function( $ ) {
$( '.media-upload-form' ).bind( 'click.uploader', function( e ) {
var target = $( e.target ), tr, c;
- if ( target.is( 'input[type="radio"]' ) ) { // remember the last used image size and alignment
+ if ( target.is( 'input[type="radio"]' ) ) { // Remember the last used image size and alignment.
tr = target.closest( 'tr' );
if ( tr.hasClass( 'align' ) )
@@ -373,7 +376,7 @@ jQuery( document ).ready( function( $ ) {
else if ( tr.hasClass( 'image-size' ) )
setUserSetting( 'imgsize', target.val() );
- } else if ( target.is( 'button.button' ) ) { // remember the last used image link url
+ } else if ( target.is( 'button.button' ) ) { // Remember the last used image link url.
c = e.target.className || '';
c = c.match( /url([^ '"]+)/ );
@@ -385,15 +388,15 @@ jQuery( document ).ready( function( $ ) {
target.parents( '.media-item' ).fadeOut( 200, function() {
$( this ).remove();
} );
- } else if ( target.is( '.upload-flash-bypass a' ) || target.is( 'a.uploader-html' ) ) { // switch uploader to html4
+ } else if ( target.is( '.upload-flash-bypass a' ) || target.is( 'a.uploader-html' ) ) { // Switch uploader to html4.
$( '#media-items, p.submit, span.big-file-warning' ).css( 'display', 'none' );
switchUploader( 0 );
e.preventDefault();
- } else if ( target.is( '.upload-html-bypass a' ) ) { // switch uploader to multi-file
+ } else if ( target.is( '.upload-html-bypass a' ) ) { // Switch uploader to multi-file.
$( '#media-items, p.submit, span.big-file-warning' ).css( 'display', '' );
switchUploader( 1 );
e.preventDefault();
- } else if ( target.is( 'a.describe-toggle-on' ) ) { // Show
+ } else if ( target.is( 'a.describe-toggle-on' ) ) { // Show.
target.parent().addClass( 'open' );
target.siblings( '.slidetoggle' ).fadeIn( 250, function() {
var S = $( window ).scrollTop(),
@@ -417,7 +420,7 @@ jQuery( document ).ready( function( $ ) {
} );
e.preventDefault();
- } else if ( target.is( 'a.describe-toggle-off' ) ) { // Hide
+ } else if ( target.is( 'a.describe-toggle-off' ) ) { // Hide.
target.siblings( '.slidetoggle' ).fadeOut( 250, function() {
target.parent().removeClass( 'open' );
} );
@@ -450,9 +453,11 @@ jQuery( document ).ready( function( $ ) {
times = tryAgainCount[ file.id ];
if ( times && times > 4 ) {
- // The file may have been uploaded and attachment post created,
- // but post-processing and resizing failed...
- // Do a cleanup then tell the user to scale down the image and upload it again.
+ /*
+ * The file may have been uploaded and attachment post created,
+ * but post-processing and resizing failed...
+ * Do a cleanup then tell the user to scale down the image and upload it again.
+ */
$.ajax({
type: 'post',
url: ajaxurl,
@@ -514,7 +519,7 @@ jQuery( document ).ready( function( $ ) {
});
}
- // init and set the uploader
+ // Init and set the uploader.
uploader_init = function() {
uploader = new plupload.Uploader( wpUploaderInit );
diff --git a/src/js/_enqueues/vendor/plupload/wp-plupload.js b/src/js/_enqueues/vendor/plupload/wp-plupload.js
index ea32444c7e..e42288fbe4 100644
--- a/src/js/_enqueues/vendor/plupload/wp-plupload.js
+++ b/src/js/_enqueues/vendor/plupload/wp-plupload.js
@@ -33,7 +33,7 @@ window.wp = window.wp || {};
*/
Uploader = function( options ) {
var self = this,
- isIE, // not used, back-compat
+ isIE, // Not used, back-compat.
elements = {
container: 'container',
browser: 'browse_button',
@@ -60,10 +60,12 @@ window.wp = window.wp || {};
this.plupload = $.extend( true, { multipart_params: {} }, Uploader.defaults );
this.container = document.body; // Set default container.
- // Extend the instance with options.
- //
- // Use deep extend to allow options.plupload to override individual
- // default plupload keys.
+ /*
+ * Extend the instance with options.
+ *
+ * Use deep extend to allow options.plupload to override individual
+ * default plupload keys.
+ */
$.extend( true, this, options );
// Proxy all methods so this always refers to the current instance.
@@ -138,9 +140,11 @@ window.wp = window.wp || {};
times = tryAgainCount[ file.id ];
if ( times && times > 4 ) {
- // The file may have been uploaded and attachment post created,
- // but post-processing and resizing failed...
- // Do a cleanup then tell the user to scale down the image and upload it again.
+ /*
+ * The file may have been uploaded and attachment post created,
+ * but post-processing and resizing failed...
+ * Do a cleanup then tell the user to scale down the image and upload it again.
+ */
$.ajax({
type: 'post',
url: ajaxurl,
@@ -238,7 +242,7 @@ window.wp = window.wp || {};
fileUploaded = function( up, file, response ) {
var complete;
- // Remove the "uploading" UI elements
+ // Remove the "uploading" UI elements.
_.each( ['file','loaded','size','percent'], function( key ) {
file.attachment.unset( key );
} );
@@ -295,11 +299,13 @@ window.wp = window.wp || {};
});
dropzone.bind('dragleave.wp-uploader, drop.wp-uploader', function() {
- // Using an instant timer prevents the drag-over class from
- // being quickly removed and re-added when elements inside the
- // dropzone are repositioned.
- //
- // @see https://core.trac.wordpress.org/ticket/21705
+ /*
+ * Using an instant timer prevents the drag-over class
+ * from being quickly removed and re-added when elements
+ * inside the dropzone are repositioned.
+ *
+ * @see https://core.trac.wordpress.org/ticket/21705
+ */
timer = setTimeout( function() {
active = false;
dropzone.trigger('dropzone:leave').removeClass('drag-over');
@@ -513,9 +519,11 @@ window.wp = window.wp || {};
node = node.parentNode;
}
- // If the browser node is not attached to the DOM, use a
- // temporary container to house it, as the browser button
- // shims require the button to exist in the DOM at all times.
+ /*
+ * If the browser node is not attached to the DOM,
+ * use a temporary container to house it, as the browser button shims
+ * require the button to exist in the DOM at all times.
+ */
if ( ! attached ) {
id = 'wp-uploader-browser-' + this.uploader.id;
diff --git a/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js
index 92d433edcd..9be24f3e1a 100644
--- a/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js
+++ b/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js
@@ -44,7 +44,7 @@
this.add = function (callback, scope, prepend) {
log('.on' + newEventName + ".add(..)");
- // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
+ // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2).
function patchedEventCallback(e) {
var callbackArgs = [];
diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js
index b7848cd987..cbb320b146 100644
--- a/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js
+++ b/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js
@@ -1,6 +1,6 @@
/* global getUserSetting, setUserSetting */
( function( tinymce ) {
-// Set the minimum value for the modals z-index higher than #wpadminbar (100000)
+// Set the minimum value for the modals z-index higher than #wpadminbar (100000).
if ( ! tinymce.ui.FloatPanel.zIndex || tinymce.ui.FloatPanel.zIndex < 100100 ) {
tinymce.ui.FloatPanel.zIndex = 100100;
}
@@ -88,7 +88,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
});
- // Hide the toolbars after loading
+ // Hide the toolbars after loading.
editor.on( 'PostRender', function() {
if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) {
toggleToolbars( 'hide' );
@@ -191,7 +191,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
});
- // Display the tag name instead of img in element path
+ // Display the tag name instead of img in element path.
editor.on( 'ResolveName', function( event ) {
var attr;
@@ -200,7 +200,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
});
- // Register commands
+ // Register commands.
editor.addCommand( 'WP_More', function( tag ) {
var parent, html, title,
classname = 'wp-more-tag',
@@ -215,13 +215,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
html = '';
- // Most common case
+ // Most common case.
if ( node === rootNode || ( node.nodeName === 'P' && node.parentNode === rootNode ) ) {
editor.insertContent( html );
return;
}
- // Get the top level parent node
+ // Get the top level parent node.
parent = dom.getParent( node, function( found ) {
if ( found.parentNode && found.parentNode === rootNode ) {
return true;
@@ -328,7 +328,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
html = '
';
- // Main section, default and additional shortcuts
+ // Main section, default and additional shortcuts.
html = html +
'
';
if ( editor.plugins.wptextpattern && ( ! tinymce.Env.ie || tinymce.Env.ie > 8 ) ) {
- // Text pattern section
+ // Text pattern section.
html = html +
'
' + __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ) + '
\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi, '<$1$2>' )
@@ -554,21 +554,21 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
if ( editor.getParam( 'wp_paste_filters', true ) ) {
editor.on( 'PastePreProcess', function( event ) {
- // Remove trailing added by WebKit browsers to the clipboard
+ // Remove trailing added by WebKit browsers to the clipboard.
event.content = event.content.replace( / /gi, '' );
- // In WebKit this is handled by removeWebKitStyles()
+ // In WebKit this is handled by removeWebKitStyles().
if ( ! tinymce.Env.webkit ) {
- // Remove all inline styles
+ // Remove all inline styles.
event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
- // Put back the internal styles
+ // Put back the internal styles.
event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
}
});
editor.on( 'PastePostProcess', function( event ) {
- // Remove empty paragraphs
+ // Remove empty paragraphs.
editor.$( 'p', event.node ).each( function( i, node ) {
if ( dom.isEmpty( node ) ) {
dom.remove( node );
@@ -585,7 +585,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
});
editor.on( 'SaveContent', function( event ) {
- // If editor is hidden, we just want the textarea's value to be saved
+ // If editor is hidden, we just want the textarea's value to be saved.
if ( ! editor.inline && editor.isHidden() ) {
event.content = event.element.value;
return;
@@ -700,7 +700,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
wpTooltips = {};
- // For MacOS: ctrl = \u2303, cmd = \u2318, alt = \u2325
+ // For MacOS: ctrl = \u2303, cmd = \u2318, alt = \u2325.
if ( tinymce.Env.mac ) {
access = '\u2303\u2325';
meta = '\u2318';
@@ -761,7 +761,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
function addShortcutsToListbox() {
- // listbox for the "blocks" drop-down
+ // listbox for the "blocks" drop-down.
each( editor.theme.panel.find( 'listbox' ), function( listbox ) {
if ( listbox && listbox.settings.text === 'Paragraph' ) {
each( listbox.settings.values, function( item ) {
@@ -1118,9 +1118,11 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
event.type === 'resize' ||
event.type === 'scroll'
) && ! activeToolbar.blockHide ) {
- // Showing a tooltip may trigger a `resize` event in Chromium browsers.
- // That results in a flicketing inline menu; tooltips are shown on hovering over a button,
- // which then hides the toolbar on `resize`, then it repeats as soon as the toolbar is shown again.
+ /*
+ * Showing a tooltip may trigger a `resize` event in Chromium browsers.
+ * That results in a flicketing inline menu; tooltips are shown on hovering over a button,
+ * which then hides the toolbar on `resize`, then it repeats as soon as the toolbar is shown again.
+ */
if ( event.type === 'resize' || event.type === 'resizewindow' ) {
win = editor.getWin();
size = win.innerHeight + win.innerWidth;
@@ -1187,7 +1189,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
function noop() {}
- // Expose some functions (back-compat)
+ // Expose some functions (back-compat).
return {
_showButtons: noop,
_hideButtons: noop,
diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wpautoresize/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wpautoresize/plugin.js
index 98905f6478..6e0a1a8d82 100644
--- a/src/js/_enqueues/vendor/tinymce/plugins/wpautoresize/plugin.js
+++ b/src/js/_enqueues/vendor/tinymce/plugins/wpautoresize/plugin.js
@@ -61,13 +61,13 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
if ( ! body || ( e && e.type === 'setcontent' && e.initial ) || isFullscreen() ) {
if ( body && docElm ) {
body.style.overflowY = 'auto';
- docElm.style.overflowY = 'auto'; // Old IE
+ docElm.style.overflowY = 'auto'; // Old IE.
}
return;
}
- // Calculate outer height of the body element using CSS styles
+ // Calculate outer height of the body element using CSS styles.
marginTop = editor.dom.getStyle( body, 'margin-top', true );
marginBottom = editor.dom.getStyle( body, 'margin-bottom', true );
paddingTop = editor.dom.getStyle( body, 'padding-top', true );
@@ -83,36 +83,36 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
myHeight = docElm.offsetHeight;
}
- // Make sure we have a valid height
+ // Make sure we have a valid height.
if ( isNaN( myHeight ) || myHeight <= 0 ) {
- // Get height differently depending on the browser used
+ // Get height differently depending on the browser used.
myHeight = tinymce.Env.ie ? body.scrollHeight : ( tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight );
}
- // Don't make it smaller than the minimum height
+ // Don't make it smaller than the minimum height.
if ( myHeight > settings.autoresize_min_height ) {
resizeHeight = myHeight;
}
- // If a maximum height has been defined don't exceed this height
+ // If a maximum height has been defined don't exceed this height.
if ( settings.autoresize_max_height && myHeight > settings.autoresize_max_height ) {
resizeHeight = settings.autoresize_max_height;
body.style.overflowY = 'auto';
- docElm.style.overflowY = 'auto'; // Old IE
+ docElm.style.overflowY = 'auto'; // Old IE.
} else {
body.style.overflowY = 'hidden';
- docElm.style.overflowY = 'hidden'; // Old IE
+ docElm.style.overflowY = 'hidden'; // Old IE.
body.scrollTop = 0;
}
- // Resize content element
+ // Resize content element.
if (resizeHeight !== oldSize) {
deltaSize = resizeHeight - oldSize;
DOM.setStyle( editor.iframeElement, 'height', resizeHeight + 'px' );
oldSize = resizeHeight;
- // WebKit doesn't decrease the size of the body element until the iframe gets resized
- // So we need to continue to resize the iframe down until the size gets fixed
+ // WebKit doesn't decrease the size of the body element until the iframe gets resized.
+ // So we need to continue to resize the iframe down until the size gets fixed.
if ( tinymce.isWebKit && deltaSize < 0 ) {
resize( e );
}
@@ -137,17 +137,17 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
}, interval );
}
- // Define minimum height
+ // Define minimum height.
settings.autoresize_min_height = parseInt(editor.getParam( 'autoresize_min_height', editor.getElement().offsetHeight), 10 );
- // Define maximum height
+ // Define maximum height.
settings.autoresize_max_height = parseInt(editor.getParam( 'autoresize_max_height', 0), 10 );
function on() {
if ( ! editor.dom.hasClass( editor.getBody(), 'wp-autoresize' ) ) {
isActive = true;
editor.dom.addClass( editor.getBody(), 'wp-autoresize' );
- // Add appropriate listeners for resizing the content area
+ // Add appropriate listeners for resizing the content area.
editor.on( 'nodechange setcontent keyup FullscreenStateChanged', resize );
resize();
}
@@ -156,20 +156,20 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
function off() {
var doc;
- // Don't turn off if the setting is 'on'
+ // Don't turn off if the setting is 'on'.
if ( ! settings.wp_autoresize_on ) {
isActive = false;
doc = editor.getDoc();
editor.dom.removeClass( editor.getBody(), 'wp-autoresize' );
editor.off( 'nodechange setcontent keyup FullscreenStateChanged', resize );
doc.body.style.overflowY = 'auto';
- doc.documentElement.style.overflowY = 'auto'; // Old IE
+ doc.documentElement.style.overflowY = 'auto'; // Old IE.
oldSize = 0;
}
}
if ( settings.wp_autoresize_on ) {
- // Turn resizing on when the editor loads
+ // Turn resizing on when the editor loads.
isActive = true;
editor.on( 'init', function() {
@@ -184,24 +184,24 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
if ( editor.getParam( 'autoresize_on_init', true ) ) {
editor.on( 'init', function() {
- // Hit it 10 times in 200 ms intervals
+ // Hit it 10 times in 200 ms intervals.
wait( 10, 200, function() {
- // Hit it 5 times in 1 sec intervals
+ // Hit it 5 times in 1 sec intervals.
wait( 5, 1000 );
});
});
}
}
- // Reset the stored size
+ // Reset the stored size.
editor.on( 'show', function() {
oldSize = 0;
});
- // Register the command
+ // Register the command.
editor.addCommand( 'wpAutoResize', resize );
- // On/off
+ // On/off.
editor.addCommand( 'wpAutoResizeOn', on );
editor.addCommand( 'wpAutoResizeOff', off );
});
diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wpdialogs/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wpdialogs/plugin.js
index 8b9229fdbc..11c8d5fdc4 100644
--- a/src/js/_enqueues/vendor/tinymce/plugins/wpdialogs/plugin.js
+++ b/src/js/_enqueues/vendor/tinymce/plugins/wpdialogs/plugin.js
@@ -30,7 +30,7 @@ tinymce.WPWindowManager = tinymce.InlineWindowManager = function( editor ) {
}
if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) {
- // wpdialog.js is not loaded
+ // wpdialog.js is not loaded.
if ( window.console && window.console.error ) {
window.console.error('wpdialog.js is not loaded. Please set "wpdialogs" as dependency for your script when calling wp_enqueue_script(). You may also want to enqueue the "wp-jquery-ui-dialog" stylesheet.');
}
@@ -54,7 +54,7 @@ tinymce.WPWindowManager = tinymce.InlineWindowManager = function( editor ) {
// Store selection. Takes a snapshot in the FocusManager of the selection before focus is moved to the dialog.
editor.nodeChanged();
- // Create the dialog if necessary
+ // Create the dialog if necessary.
if ( ! $element.data('wpdialog') ) {
$element.wpdialog({
title: args.title,
@@ -85,7 +85,7 @@ tinymce.WPWindowManager = tinymce.InlineWindowManager = function( editor ) {
};
tinymce.PluginManager.add( 'wpdialogs', function( editor ) {
- // Replace window manager
+ // Replace window manager.
editor.on( 'init', function() {
editor.windowManager = new tinymce.WPWindowManager( editor );
});
diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wpeditimage/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wpeditimage/plugin.js
index 9142ed5717..ac6c83b427 100644
--- a/src/js/_enqueues/vendor/tinymce/plugins/wpeditimage/plugin.js
+++ b/src/js/_enqueues/vendor/tinymce/plugins/wpeditimage/plugin.js
@@ -18,7 +18,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
} );
editor.addButton( 'wp_img_edit', {
- tooltip: 'Edit|button', // '|button' is not displayed, only used for context
+ tooltip: 'Edit|button', // '|button' is not displayed, only used for context.
icon: 'dashicon dashicons-edit',
onclick: function() {
editImage( editor.selection.getNode() );
@@ -146,7 +146,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
caption = trim( img[2] );
img = trim( img[1] );
} else {
- // old captions shortcode style
+ // Old captions shortcode style.
caption = trim( b ).replace( /caption=['"]/, '' ).replace( /['"]$/, '' );
img = c;
}
@@ -214,18 +214,18 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
}
caption = caption.replace( /\r\n|\r/g, '\n' ).replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( a ) {
- // no line breaks inside HTML tags
+ // No line breaks inside HTML tags.
return a.replace( /[\r\n\t]+/, ' ' );
});
- // convert remaining line breaks to
+ // Convert remaining line breaks to .
caption = caption.replace( /\s*\n\s*/g, ' ' );
return '[caption id="' + id + '" align="' + align + '" width="' + width + '"' + classes + ']' + c + ' ' + caption + '[/caption]';
});
if ( out.indexOf('[caption') === -1 ) {
- // the caption html seems broken, try to find the image that may be wrapped in a link
+ // The caption html seems broken, try to find the image that may be wrapped in a link
// and may be followed by
';
}
-endif; // twentyeleven_continue_reading_link
+endif; // twentyeleven_continue_reading_link()
/**
* Replace "[...]" in the Read More link with an ellipsis.
@@ -609,7 +609,7 @@ if ( ! function_exists( 'twentyeleven_content_nav' ) ) :
-
+
-
- 'primary' ) ); ?>
+ 'primary' ) );
+ ?>
diff --git a/src/wp-content/themes/twentyeleven/image.php b/src/wp-content/themes/twentyeleven/image.php
index 980bc3a002..8625991dda 100644
--- a/src/wp-content/themes/twentyeleven/image.php
+++ b/src/wp-content/themes/twentyeleven/image.php
@@ -75,32 +75,34 @@ get_header(); ?>
}
}
- // If there is more than 1 attachment in a gallery
+ // If there is more than 1 attachment in a gallery...
if ( count( $attachments ) > 1 ) {
$k++;
if ( isset( $attachments[ $k ] ) ) {
- // get the URL of the next image attachment
+ // ...get the URL of the next image attachment.
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
- } else { // or get the URL of the first image attachment
+ } else {
+ // ...or get the URL of the first image attachment.
$next_attachment_url = get_attachment_link( $attachments[0]->ID );
}
} else {
- // or, if there's only 1 image, get the URL of the image
+ // Or, if there's only 1 image, get the URL of the image.
$next_attachment_url = wp_get_attachment_url();
}
?>
- ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
- ?>
+ ID, array( $attachment_size, 1024 ) );
+ ?>
post_excerpt ) ) : ?>
@@ -130,7 +132,7 @@ get_header(); ?>
-
+
diff --git a/src/wp-content/themes/twentyeleven/inc/theme-customizer.js b/src/wp-content/themes/twentyeleven/inc/theme-customizer.js
index 002fc97950..70cb6d8a7f 100644
--- a/src/wp-content/themes/twentyeleven/inc/theme-customizer.js
+++ b/src/wp-content/themes/twentyeleven/inc/theme-customizer.js
@@ -10,7 +10,7 @@
} );
} );
- // Header text color
+ // Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
diff --git a/src/wp-content/themes/twentyeleven/inc/theme-options.php b/src/wp-content/themes/twentyeleven/inc/theme-options.php
index 012eb326f3..cb0556d006 100644
--- a/src/wp-content/themes/twentyeleven/inc/theme-options.php
+++ b/src/wp-content/themes/twentyeleven/inc/theme-options.php
@@ -37,26 +37,26 @@ add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_ad
function twentyeleven_theme_options_init() {
register_setting(
- 'twentyeleven_options', // Options group, see settings_fields() call in twentyeleven_theme_options_render_page()
- 'twentyeleven_theme_options', // Database option, see twentyeleven_get_theme_options()
- 'twentyeleven_theme_options_validate' // The sanitization callback, see twentyeleven_theme_options_validate()
+ 'twentyeleven_options', // Options group, see settings_fields() call in twentyeleven_theme_options_render_page().
+ 'twentyeleven_theme_options', // Database option, see twentyeleven_get_theme_options().
+ 'twentyeleven_theme_options_validate' // The sanitization callback, see twentyeleven_theme_options_validate().
);
- // Register our settings field group
+ // Register our settings field group.
add_settings_section(
- 'general', // Unique identifier for the settings section
- '', // Section title (we don't want one)
- '__return_false', // Section callback (we don't want anything)
- 'theme_options' // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
+ 'general', // Unique identifier for the settings section.
+ '', // Section title (we don't want one).
+ '__return_false', // Section callback (we don't want anything).
+ 'theme_options' // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page().
);
- // Register our individual settings fields
+ // Register our individual settings fields.
add_settings_field(
- 'color_scheme', // Unique identifier for the field for this section
- __( 'Color Scheme', 'twentyeleven' ), // Setting field label
- 'twentyeleven_settings_field_color_scheme', // Function that renders the settings field
- 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
- 'general' // Settings section. Same as the first argument in the add_settings_section() above
+ 'color_scheme', // Unique identifier for the field for this section.
+ __( 'Color Scheme', 'twentyeleven' ), // Setting field label.
+ 'twentyeleven_settings_field_color_scheme', // Function that renders the settings field.
+ 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page().
+ 'general' // Settings section. Same as the first argument in the add_settings_section() above.
);
add_settings_field( 'link_color', __( 'Link Color', 'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' );
@@ -92,11 +92,11 @@ add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_
*/
function twentyeleven_theme_options_add_page() {
$theme_page = add_theme_page(
- __( 'Theme Options', 'twentyeleven' ), // Name of page
- __( 'Theme Options', 'twentyeleven' ), // Label in menu
- 'edit_theme_options', // Capability required
- 'theme_options', // Menu slug, used to uniquely identify the page
- 'twentyeleven_theme_options_render_page' // Function that renders the options page
+ __( 'Theme Options', 'twentyeleven' ), // Name of page.
+ __( 'Theme Options', 'twentyeleven' ), // Label in menu.
+ 'edit_theme_options', // Capability required.
+ 'theme_options', // Menu slug, used to uniquely identify the page.
+ 'twentyeleven_theme_options_render_page' // Function that renders the options page.
);
if ( ! $theme_page ) {
@@ -124,7 +124,7 @@ function twentyeleven_theme_options_help() {
$screen = get_current_screen();
if ( method_exists( $screen, 'add_help_tab' ) ) {
- // WordPress 3.3.0
+ // WordPress 3.3.0.
$screen->add_help_tab(
array(
'title' => __( 'Overview', 'twentyeleven' ),
@@ -135,7 +135,7 @@ function twentyeleven_theme_options_help() {
$screen->set_help_sidebar( $sidebar );
} else {
- // WordPress 3.2.0
+ // WordPress 3.2.0.
add_contextual_help( $screen, $help . $sidebar );
}
}
@@ -378,7 +378,7 @@ function twentyeleven_theme_options_validate( $input ) {
$defaults = twentyeleven_get_default_theme_options();
$output = $defaults;
- // Color scheme must be in our array of color scheme options
+ // Color scheme must be in our array of color scheme options.
if ( isset( $input['color_scheme'] ) && array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) ) {
$output['color_scheme'] = $input['color_scheme'];
}
@@ -387,12 +387,12 @@ function twentyeleven_theme_options_validate( $input ) {
$defaults['link_color'] = twentyeleven_get_default_link_color( $output['color_scheme'] );
$output['link_color'] = $defaults['link_color'];
- // Link color must be 3 or 6 hexadecimal characters
+ // Link color must be 3 or 6 hexadecimal characters.
if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) ) {
$output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
}
- // Theme layout must be in our array of theme layout options
+ // Theme layout must be in our array of theme layout options.
if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) {
$output['theme_layout'] = $input['theme_layout'];
}
@@ -582,7 +582,7 @@ function twentyeleven_customize_register( $wp_customize ) {
)
);
- // Link Color (added to Color Scheme section in Customizer)
+ // Link Color (added to Color Scheme section in Customizer).
$wp_customize->add_setting(
'twentyeleven_theme_options[link_color]',
array(
@@ -605,7 +605,7 @@ function twentyeleven_customize_register( $wp_customize ) {
)
);
- // Default Layout
+ // Default Layout.
$wp_customize->add_section(
'twentyeleven_layout',
array(
diff --git a/src/wp-content/themes/twentyeleven/inc/widgets.php b/src/wp-content/themes/twentyeleven/inc/widgets.php
index ba4b4487d7..ec1ad74243 100644
--- a/src/wp-content/themes/twentyeleven/inc/widgets.php
+++ b/src/wp-content/themes/twentyeleven/inc/widgets.php
@@ -137,10 +137,10 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
echo $args['after_widget'];
- // Reset the post globals as this query will have stomped on it
+ // Reset the post globals as this query will have stomped on it.
wp_reset_postdata();
- // end check for ephemeral posts
+ // End check for ephemeral posts.
endif;
$cache[ $args['widget_id'] ] = ob_get_flush();
diff --git a/src/wp-content/themes/twentyeleven/index.php b/src/wp-content/themes/twentyeleven/index.php
index a7e3c141db..a4a7c04f18 100644
--- a/src/wp-content/themes/twentyeleven/index.php
+++ b/src/wp-content/themes/twentyeleven/index.php
@@ -21,8 +21,8 @@ get_header(); ?>
-
diff --git a/src/wp-content/themes/twentyeleven/page.php b/src/wp-content/themes/twentyeleven/page.php
index 4b322e84fa..eed2f13034 100644
--- a/src/wp-content/themes/twentyeleven/page.php
+++ b/src/wp-content/themes/twentyeleven/page.php
@@ -26,7 +26,7 @@ get_header(); ?>
-
+
diff --git a/src/wp-content/themes/twentyeleven/search.php b/src/wp-content/themes/twentyeleven/search.php
index 8ea996223d..f7902d35f0 100644
--- a/src/wp-content/themes/twentyeleven/search.php
+++ b/src/wp-content/themes/twentyeleven/search.php
@@ -25,8 +25,8 @@ get_header(); ?>
-
diff --git a/src/wp-content/themes/twentyeleven/showcase.php b/src/wp-content/themes/twentyeleven/showcase.php
index d986182596..2931b4073e 100644
--- a/src/wp-content/themes/twentyeleven/showcase.php
+++ b/src/wp-content/themes/twentyeleven/showcase.php
@@ -15,7 +15,7 @@
* @since Twenty Eleven 1.0
*/
-// Enqueue showcase script for the slider
+// Enqueue showcase script for the slider.
wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '20110429' );
get_header(); ?>
@@ -62,7 +62,7 @@ get_header(); ?>
// The Featured Posts query.
$featured = new WP_Query( $featured_args );
- // Proceed only if published posts exist
+ // Proceed only if published posts exist.
if ( $featured->have_posts() ) :
/*
@@ -91,13 +91,13 @@ get_header(); ?>
$counter_slider++;
/*
- * We're going to add a class to our featured post for featured images
- * by default it'll have the feature-text class.
+ * We're going to add a class to our featured post for featured images.
+ * By default it will have the feature-text class.
*/
$feature_class = 'feature-text';
if ( has_post_thumbnail() ) {
- // ... but if it has a featured image let's add some class
+ // ...but if it has a featured image let's add some class.
$feature_class = 'feature-image small';
// Hang on. Let's check this here image out.
@@ -144,10 +144,10 @@ get_header(); ?>
// Our new query for the Recent Posts section.
$recent = new WP_Query( $recent_args );
- // The first Recent post is displayed normally
+ // The first Recent post is displayed normally.
if ( $recent->have_posts() ) :
$recent->the_post();
@@ -224,7 +224,7 @@ get_header(); ?>
+ // If we had some posts, close the .
if ( $recent->post_count > 0 ) {
echo '';
}
@@ -245,7 +245,7 @@ get_header(); ?>
);
?>
-
+
diff --git a/src/wp-content/themes/twentyeleven/sidebar-page.php b/src/wp-content/themes/twentyeleven/sidebar-page.php
index a12f1a233f..4ed5cd6ca7 100644
--- a/src/wp-content/themes/twentyeleven/sidebar-page.php
+++ b/src/wp-content/themes/twentyeleven/sidebar-page.php
@@ -23,7 +23,7 @@ get_header(); ?>
-
+
diff --git a/src/wp-content/themes/twentyeleven/sidebar.php b/src/wp-content/themes/twentyeleven/sidebar.php
index 67fb7e5f11..df543cf73a 100644
--- a/src/wp-content/themes/twentyeleven/sidebar.php
+++ b/src/wp-content/themes/twentyeleven/sidebar.php
@@ -31,6 +31,6 @@ if ( 'content' != $current_layout ) :
-
+
diff --git a/src/wp-content/themes/twentyeleven/single.php b/src/wp-content/themes/twentyeleven/single.php
index b1ebd8a674..186bb378d8 100644
--- a/src/wp-content/themes/twentyeleven/single.php
+++ b/src/wp-content/themes/twentyeleven/single.php
@@ -27,7 +27,7 @@ get_header(); ?>
-
+
diff --git a/src/wp-content/themes/twentyeleven/tag.php b/src/wp-content/themes/twentyeleven/tag.php
index ab69a8c0ec..5d9e833a3c 100644
--- a/src/wp-content/themes/twentyeleven/tag.php
+++ b/src/wp-content/themes/twentyeleven/tag.php
@@ -39,8 +39,8 @@ get_header(); ?>
-
diff --git a/src/wp-content/themes/twentyfifteen/archive.php b/src/wp-content/themes/twentyfifteen/archive.php
index 26a9a4b4ca..425a74ac71 100644
--- a/src/wp-content/themes/twentyfifteen/archive.php
+++ b/src/wp-content/themes/twentyfifteen/archive.php
@@ -31,14 +31,14 @@ get_header(); ?>
diff --git a/src/wp-content/themes/twentyfifteen/content-link.php b/src/wp-content/themes/twentyfifteen/content-link.php
index e3b260fd3c..2d442a1588 100644
--- a/src/wp-content/themes/twentyfifteen/content-link.php
+++ b/src/wp-content/themes/twentyfifteen/content-link.php
@@ -49,7 +49,7 @@
@@ -77,7 +77,7 @@ get_header(); ?>
1 || is_preview() ) {
- // This blog has more than 1 category so twentyfifteen_categorized_blog should return true.
+ // This blog has more than 1 category so twentyfifteen_categorized_blog() should return true.
return true;
} else {
- // This blog has only 1 category so twentyfifteen_categorized_blog should return false.
+ // This blog has only 1 category so twentyfifteen_categorized_blog() should return false.
return false;
}
}
@@ -213,7 +213,7 @@ if ( ! function_exists( 'twentyfifteen_post_thumbnail' ) ) :
the_post();
/*
- * Include the Post-Format-specific template for the content.
- * If you want to override this in a child theme, then include a file
- * called content-___.php (where ___ is the Post Format name) and that will be used instead.
+ * Include the post format-specific template for the content. If you want
+ * to use this in a child theme, then include a file called content-___.php
+ * (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
diff --git a/src/wp-content/themes/twentyfifteen/js/functions.js b/src/wp-content/themes/twentyfifteen/js/functions.js
index f968885829..f554ceefd1 100644
--- a/src/wp-content/themes/twentyfifteen/js/functions.js
+++ b/src/wp-content/themes/twentyfifteen/js/functions.js
@@ -79,6 +79,7 @@
*
* Uses jQuery's width() function to determine the size of the window and add
* the default ARIA attributes for the menu toggle if it's visible.
+ *
* @since Twenty Fifteen 1.1
*/
function onResizeARIA() {
diff --git a/src/wp-content/themes/twentyfifteen/single.php b/src/wp-content/themes/twentyfifteen/single.php
index 4de3a493ad..2a4bb89366 100644
--- a/src/wp-content/themes/twentyfifteen/single.php
+++ b/src/wp-content/themes/twentyfifteen/single.php
@@ -18,8 +18,8 @@ get_header(); ?>
the_post();
/*
- * Include the post format-specific template for the content. If you want to
- * use this in a child theme, then include a file called content-___.php
+ * Include the post format-specific template for the content. If you want
+ * to use this in a child theme, then include a file called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
diff --git a/src/wp-content/themes/twentyfourteen/archive.php b/src/wp-content/themes/twentyfourteen/archive.php
index 82b79c0868..f11a57ff1a 100644
--- a/src/wp-content/themes/twentyfourteen/archive.php
+++ b/src/wp-content/themes/twentyfourteen/archive.php
@@ -44,13 +44,13 @@ get_header(); ?>
" >
@@ -72,7 +72,7 @@ get_header();
-
+
diff --git a/src/wp-content/themes/twentyfourteen/inc/custom-header.php b/src/wp-content/themes/twentyfourteen/inc/custom-header.php
index 92382eaa5e..a459c0b003 100644
--- a/src/wp-content/themes/twentyfourteen/inc/custom-header.php
+++ b/src/wp-content/themes/twentyfourteen/inc/custom-header.php
@@ -91,7 +91,7 @@ if ( ! function_exists( 'twentyfourteen_header_style' ) ) :
1,
)
);
- // Count the number of categories that are attached to the posts
+ // Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'twentyfourteen_category_count', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 || is_preview() ) {
- // This blog has more than 1 category so twentyfourteen_categorized_blog should return true
+ // This blog has more than 1 category so twentyfourteen_categorized_blog() should return true.
return true;
} else {
- // This blog has only 1 category so twentyfourteen_categorized_blog should return false
+ // This blog has only 1 category so twentyfourteen_categorized_blog() should return false.
return false;
}
}
@@ -208,7 +208,7 @@ if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) :
\s*', '><', $svg ); // Remove white space between SVG tags.
+ $svg = preg_replace( '/>\s*', '><', $svg ); // Remove whitespace between SVG tags.
return $svg;
}
return null;
diff --git a/src/wp-content/themes/twentynineteen/comments.php b/src/wp-content/themes/twentynineteen/comments.php
index d72ae857c8..d00ac46118 100644
--- a/src/wp-content/themes/twentynineteen/comments.php
+++ b/src/wp-content/themes/twentynineteen/comments.php
@@ -56,7 +56,7 @@ $discussion = twentynineteen_get_discussion_data();
?>
diff --git a/src/wp-content/themes/twentynineteen/inc/template-functions.php b/src/wp-content/themes/twentynineteen/inc/template-functions.php
index 4ec88c42ca..6c5153f01b 100644
--- a/src/wp-content/themes/twentynineteen/inc/template-functions.php
+++ b/src/wp-content/themes/twentynineteen/inc/template-functions.php
@@ -238,7 +238,7 @@ add_filter( 'wp_nav_menu', 'twentynineteen_add_ellipses_to_nav', 10, 2 );
*/
function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) {
- // Add [aria-haspopup] and [aria-expanded] to menu items that have children
+ // Add [aria-haspopup] and [aria-expanded] to menu items that have children.
$item_has_children = in_array( 'menu-item-has-children', $item->classes );
if ( $item_has_children ) {
$atts['aria-haspopup'] = 'true';
@@ -274,7 +274,7 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
twentynineteen_get_icon_svg( 'chevron_left', 24 )
);
- // replace opening with .
$output = preg_replace(
'##i',
'',
diff --git a/src/wp-content/themes/twentynineteen/inc/template-tags.php b/src/wp-content/themes/twentynineteen/inc/template-tags.php
index a77f731122..ae3e3b17a5 100644
--- a/src/wp-content/themes/twentynineteen/inc/template-tags.php
+++ b/src/wp-content/themes/twentynineteen/inc/template-tags.php
@@ -76,10 +76,10 @@ if ( ! function_exists( 'twentynineteen_entry_footer' ) ) :
// Hide author, post date, category and tag text for pages.
if ( 'post' === get_post_type() ) {
- // Posted by
+ // Posted by.
twentynineteen_posted_by();
- // Posted on
+ // Posted on.
twentynineteen_posted_on();
/* translators: Used between list items, there is a space after the comma. */
@@ -243,7 +243,7 @@ if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
*
- * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
+ * Added for backward compatibility to support pre-5.2.0 WordPress versions.
*
* @since Twenty Nineteen 1.4
*/
diff --git a/src/wp-content/themes/twentynineteen/js/customize-preview.js b/src/wp-content/themes/twentynineteen/js/customize-preview.js
index 91b91f3e0c..260c3d42f8 100644
--- a/src/wp-content/themes/twentynineteen/js/customize-preview.js
+++ b/src/wp-content/themes/twentynineteen/js/customize-preview.js
@@ -18,10 +18,10 @@
color;
if( 'custom' === to ){
- // If a custom primary color is selected, use the currently set primary_color_hue
+ // If a custom primary color is selected, use the currently set primary_color_hue.
color = wp.customize.get().primary_color_hue;
} else {
- // If the "default" option is selected, get the default primary_color_hue
+ // If the "default" option is selected, get the default primary_color_hue.
color = 199;
}
diff --git a/src/wp-content/themes/twentynineteen/js/priority-menu.js b/src/wp-content/themes/twentynineteen/js/priority-menu.js
index 7cd6bb066b..85449b0e24 100644
--- a/src/wp-content/themes/twentynineteen/js/priority-menu.js
+++ b/src/wp-content/themes/twentynineteen/js/priority-menu.js
@@ -1,7 +1,7 @@
(function() {
/**
- * Debounce
+ * Debounce.
*
* @param {Function} func
* @param {number} wait
@@ -56,7 +56,7 @@
* @param {Element} element
*/
function showButton(element) {
- // classList.remove is not supported in IE11
+ // classList.remove is not supported in IE11.
element.className = element.className.replace('is-empty', '');
}
@@ -66,7 +66,7 @@
* @param {Element} element
*/
function hideButton(element) {
- // classList.add is not supported in IE11
+ // classList.add is not supported in IE11.
if (!element.classList.contains('is-empty')) {
element.className += ' is-empty';
}
@@ -91,25 +91,25 @@
}
/**
- * Set menu container variable
+ * Set menu container variable.
*/
var navContainer = document.querySelector('.main-navigation');
var breaks = [];
/**
- * Let’s bail if we our menu doesn't exist
+ * Let’s bail if we our menu doesn't exist.
*/
if ( ! navContainer ) {
return;
}
/**
- * Refreshes the list item from the menu depending on the menu size
+ * Refreshes the list item from the menu depending on the menu size.
*/
function updateNavigationMenu( container ) {
/**
- * Let’s bail if our menu is empty
+ * Let’s bail if our menu is empty.
*/
if ( ! container.parentNode.querySelector('.main-menu[id]') ) {
return;
@@ -122,42 +122,42 @@
if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) {
- // Record the width of the list
+ // Record the width of the list.
breaks.push( visibleList.offsetWidth );
- // Move last item to the hidden list
+ // Move last item to the hidden list.
prependElement( hiddenList, ! visibleList.lastChild || null === visibleList.lastChild ? visibleList.previousElementSibling : visibleList.lastChild );
- // Show the toggle button
+ // Show the toggle button.
showButton( toggleButton );
} else {
- // There is space for another item in the nav
+ // There is space for another item in the nav.
if ( getAvailableSpace( toggleButton, container ) > breaks[breaks.length - 1] ) {
- // Move the item to the visible list
+ // Move the item to the visible list.
visibleList.appendChild( hiddenList.firstChild.nextSibling );
breaks.pop();
}
- // Hide the dropdown btn if hidden list is empty
+ // Hide the dropdown btn if hidden list is empty.
if (breaks.length < 2) {
hideButton( toggleButton );
}
}
- // Recur if the visible list is still overflowing the nav
+ // Recur if the visible list is still overflowing the nav.
if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) {
updateNavigationMenu( container );
}
}
/**
- * Run our priority+ function as soon as the document is `ready`
+ * Run our priority+ function as soon as the document is `ready`.
*/
document.addEventListener( 'DOMContentLoaded', function() {
updateNavigationMenu( navContainer );
- // Also, run our priority+ function on selective refresh in the customizer
+ // Also, run our priority+ function on selective refresh in the customizer.
var hasSelectiveRefresh = (
'undefined' !== typeof wp &&
wp.customize &&
@@ -166,7 +166,7 @@
);
if ( hasSelectiveRefresh ) {
- // Re-run our priority+ function on Nav Menu partial refreshes
+ // Re-run our priority+ function on Nav Menu partial refreshes.
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) {
var isNewNavMenu = (
@@ -184,14 +184,14 @@
});
/**
- * Run our priority+ function on load
+ * Run our priority+ function on load.
*/
window.addEventListener( 'load', function() {
updateNavigationMenu( navContainer );
});
/**
- * Run our priority+ function every time the window resizes
+ * Run our priority+ function every time the window resizes.
*/
var isResizing = false;
window.addEventListener( 'resize',
@@ -209,7 +209,7 @@
);
/**
- * Run our priority+ function
+ * Run our priority+ function.
*/
updateNavigationMenu( navContainer );
diff --git a/src/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js b/src/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js
index 2fa1905624..c8d1dd02e6 100644
--- a/src/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js
+++ b/src/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js
@@ -7,7 +7,7 @@
(function() {
/**
- * Debounce
+ * Debounce.
*
* @param {Function} func
* @param {number} wait
@@ -43,7 +43,7 @@
}
/**
- * Add class
+ * Add class.
*
* @param {Object} el
* @param {string} cls
@@ -55,7 +55,7 @@
}
/**
- * Delete class
+ * Delete class.
*
* @param {Object} el
* @param {string} cls
@@ -80,7 +80,7 @@
}
/**
- * Toggle Aria Expanded state for screenreaders
+ * Toggle Aria Expanded state for screenreaders.
*
* @param {Object} ariaItem
*/
@@ -99,24 +99,24 @@
}
/**
- * Open sub-menu
+ * Open sub-menu.
*
* @param {Object} currentSubMenu
*/
function openSubMenu( currentSubMenu ) {
'use strict';
- // Update classes
- // classList.add is not supported in IE11
+ // Update classes.
+ // classList.add is not supported in IE11.
currentSubMenu.parentElement.className += ' off-canvas';
currentSubMenu.parentElement.lastElementChild.className += ' expanded-true';
- // Update aria-expanded state
+ // Update aria-expanded state.
toggleAriaExpandedState( currentSubMenu );
}
/**
- * Close sub-menu
+ * Close sub-menu.
*
* @param {Object} currentSubMenu
*/
@@ -127,32 +127,32 @@
var menuItemAria = menuItem.querySelector('a[aria-expanded]');
var subMenu = currentSubMenu.closest('.sub-menu');
- // If this is in a sub-sub-menu, go back to parent sub-menu
+ // If this is in a sub-sub-menu, go back to parent sub-menu.
if ( getCurrentParent( currentSubMenu, 'ul' ).classList.contains( 'sub-menu' ) ) {
- // Update classes
- // classList.remove is not supported in IE11
+ // Update classes.
+ // classList.remove is not supported in IE11.
menuItem.className = menuItem.className.replace( 'off-canvas', '' );
subMenu.className = subMenu.className.replace( 'expanded-true', '' );
- // Update aria-expanded and :focus states
+ // Update aria-expanded and :focus states.
toggleAriaExpandedState( menuItemAria );
- // Or else close all sub-menus
+ // Or else close all sub-menus.
} else {
- // Update classes
- // classList.remove is not supported in IE11
+ // Update classes.
+ // classList.remove is not supported in IE11.
menuItem.className = menuItem.className.replace( 'off-canvas', '' );
menuItem.lastElementChild.className = menuItem.lastElementChild.className.replace( 'expanded-true', '' );
- // Update aria-expanded and :focus states
+ // Update aria-expanded and :focus states.
toggleAriaExpandedState( menuItemAria );
}
}
/**
- * Find first ancestor of an element by selector
+ * Find first ancestor of an element by selector.
*
* @param {Object} child
* @param {String} selector
@@ -181,7 +181,7 @@
}
/**
- * Remove all off-canvas states
+ * Remove all off-canvas states.
*/
function removeAllFocusStates() {
'use strict';
@@ -202,7 +202,7 @@
}
/**
- * Matches polyfill for IE11
+ * Matches polyfill for IE11.
*/
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector;
@@ -219,31 +219,31 @@
var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : '';
- // Open submenu if url is #
+ // Open submenu if URL is #.
if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) {
openSubMenu( event.target );
}
}
- // Check if .submenu-expand is touched
+ // Check if .submenu-expand is touched.
if ( event.target.matches('.submenu-expand') ) {
openSubMenu(event.target);
- // Check if child of .submenu-expand is touched
+ // Check if child of .submenu-expand is touched.
} else if ( null != getCurrentParent( event.target, '.submenu-expand' ) &&
getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) ) {
openSubMenu( getCurrentParent( event.target, '.submenu-expand' ) );
- // Check if .menu-item-link-return is touched
+ // Check if .menu-item-link-return is touched.
} else if ( event.target.matches('.menu-item-link-return') ) {
closeSubMenu( event.target );
- // Check if child of .menu-item-link-return is touched
+ // Check if child of .menu-item-link-return is touched.
} else if ( null != getCurrentParent( event.target, '.menu-item-link-return' ) && getCurrentParent( event.target, '.menu-item-link-return' ).matches( '.menu-item-link-return' ) ) {
closeSubMenu( event.target );
}
- // Prevent default mouse/focus events
+ // Prevent default mouse/focus events.
removeAllFocusStates();
}, false);
@@ -253,7 +253,7 @@
var mainNav = getCurrentParent( event.target, '.main-navigation' );
if ( null != mainNav && hasClass( mainNav, '.main-navigation' ) ) {
- // Prevent default mouse events
+ // Prevent default mouse events.
event.preventDefault();
} else if (
@@ -263,11 +263,11 @@
event.target.matches('.menu-item-link-return') ||
null != getCurrentParent( event.target, '.menu-item-link-return' ) &&
getCurrentParent( event.target, '.menu-item-link-return' ).matches( '.menu-item-link-return' ) ) {
- // Prevent default mouse events
+ // Prevent default mouse events.
event.preventDefault();
}
- // Prevent default mouse/focus events
+ // Prevent default mouse/focus events.
removeAllFocusStates();
}, false);
@@ -276,7 +276,7 @@
if ( event.target.matches('.main-navigation > div > ul > li a') ) {
- // Remove Focused elements in sibling div
+ // Remove Focused elements in sibling div.
var currentDiv = getCurrentParent( event.target, 'div', '.main-navigation' );
var currentDivSibling = currentDiv.previousElementSibling === null ? currentDiv.nextElementSibling : currentDiv.previousElementSibling;
var focusedElement = currentDivSibling.querySelector( '.is-focused' );
@@ -288,17 +288,17 @@
deleteClass( focusedElement, focusedClass );
}
- // Add .is-focused class to top-level li
+ // Add .is-focused class to top-level li.
if ( getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ) ) {
addClass( getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ), focusedClass );
}
- // Check for previous li
+ // Check for previous li.
if ( prevLi && hasClass( prevLi, focusedClass ) ) {
deleteClass( prevLi, focusedClass );
}
- // Check for next li
+ // Check for next li.
if ( nextLi && hasClass( nextLi, focusedClass ) ) {
deleteClass( nextLi, focusedClass );
}
@@ -308,25 +308,25 @@
document.addEventListener('click', function(event) {
- // Remove all focused menu states when clicking outside site branding
+ // Remove all focused menu states when clicking outside site branding.
if ( event.target !== document.getElementsByClassName( 'site-branding' )[0] ) {
removeAllFocusStates();
} else {
- // nothing
+ // Nothing.
}
}, false);
}
/**
- * Run our sub-menu function as soon as the document is `ready`
+ * Run our sub-menu function as soon as the document is `ready`.
*/
document.addEventListener( 'DOMContentLoaded', function() {
toggleSubmenuDisplay();
});
/**
- * Run our sub-menu function on selective refresh in the customizer
+ * Run our sub-menu function on selective refresh in the customizer.
*/
document.addEventListener( 'customize-preview-menu-refreshed', function( e, params ) {
if ( 'menu-1' === params.wpNavMenuArgs.theme_location ) {
@@ -335,7 +335,7 @@
});
/**
- * Run our sub-menu function every time the window resizes
+ * Run our sub-menu function every time the window resizes.
*/
var isResizing = false;
window.addEventListener( 'resize', function() {
diff --git a/src/wp-content/themes/twentynineteen/page.php b/src/wp-content/themes/twentynineteen/page.php
index 16abcb2399..757e049e5b 100644
--- a/src/wp-content/themes/twentynineteen/page.php
+++ b/src/wp-content/themes/twentynineteen/page.php
@@ -17,7 +17,7 @@ get_header();
diff --git a/src/wp-content/themes/twentynineteen/search.php b/src/wp-content/themes/twentynineteen/search.php
index 25ab5c245d..af9d26540c 100644
--- a/src/wp-content/themes/twentynineteen/search.php
+++ b/src/wp-content/themes/twentynineteen/search.php
@@ -32,7 +32,8 @@ get_header();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
- * called content-___.php (where ___ is the Post Format name) and that will be used instead.
+ * called content-___.php (where ___ is the Post Format name) and that
+ * will be used instead.
*/
get_template_part( 'template-parts/content/content', 'excerpt' );
diff --git a/src/wp-content/themes/twentynineteen/single.php b/src/wp-content/themes/twentynineteen/single.php
index 830850ef7d..a2d7eac00e 100644
--- a/src/wp-content/themes/twentynineteen/single.php
+++ b/src/wp-content/themes/twentynineteen/single.php
@@ -17,7 +17,7 @@ get_header();
diff --git a/src/wp-content/themes/twentynineteen/template-parts/header/entry-header.php b/src/wp-content/themes/twentynineteen/template-parts/header/entry-header.php
index 77491f0285..163436d4b1 100644
--- a/src/wp-content/themes/twentynineteen/template-parts/header/entry-header.php
+++ b/src/wp-content/themes/twentynineteen/template-parts/header/entry-header.php
@@ -24,7 +24,7 @@ $discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentyni
if ( have_posts() ) :
?>
';
- // Make sure there's more than one category before displaying.
+ // Make sure there's more than one category before displaying.
if ( $categories_list && twentyseventeen_categorized_blog() ) {
echo '' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '' . __( 'Categories', 'twentyseventeen' ) . '' . $categories_list . '';
}
@@ -133,7 +133,9 @@ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
if ( is_a( $partial, 'WP_Customize_Partial' ) ) {
// Find out the id and set it up during a selective refresh.
global $twentyseventeencounter;
- $id = str_replace( 'panel_', '', $partial->id );
+
+ $id = str_replace( 'panel_', '', $partial->id );
+
$twentyseventeencounter = $id;
}
@@ -148,8 +150,13 @@ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
wp_reset_postdata();
} elseif ( is_customize_preview() ) {
// The output placeholder anchor.
- /* translators: %s: The section ID. */
- echo '' . sprintf( __( 'Front Page Section %s Placeholder', 'twentyseventeen' ), $id ) . '';
+ printf(
+ '' .
+ '%2$s',
+ $id,
+ /* translators: %s: The section ID. */
+ sprintf( __( 'Front Page Section %s Placeholder', 'twentyseventeen' ), $id )
+ );
}
}
@@ -204,7 +211,7 @@ if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
*
- * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
+ * Added for backward compatibility to support pre-5.2.0 WordPress versions.
*
* @since Twenty Seventeen 2.2
*/
diff --git a/src/wp-content/themes/twentyseventeen/index.php b/src/wp-content/themes/twentyseventeen/index.php
index 1b6375545f..5df8f0231f 100644
--- a/src/wp-content/themes/twentyseventeen/index.php
+++ b/src/wp-content/themes/twentyseventeen/index.php
@@ -34,14 +34,15 @@ get_header(); ?>
comments_template();
endif;
- endwhile; // End of the loop.
+ endwhile; // End the loop.
?>
diff --git a/src/wp-content/themes/twentyseventeen/search.php b/src/wp-content/themes/twentyseventeen/search.php
index a1fd451a4d..ee62b22112 100644
--- a/src/wp-content/themes/twentyseventeen/search.php
+++ b/src/wp-content/themes/twentyseventeen/search.php
@@ -32,7 +32,7 @@ get_header(); ?>
*/
get_template_part( 'template-parts/post/content', 'excerpt' );
- endwhile; // End of the loop.
+ endwhile; // End the loop.
the_posts_pagination(
array(
diff --git a/src/wp-content/themes/twentyseventeen/single.php b/src/wp-content/themes/twentyseventeen/single.php
index ec68d5f4eb..541e2d24a9 100644
--- a/src/wp-content/themes/twentyseventeen/single.php
+++ b/src/wp-content/themes/twentyseventeen/single.php
@@ -17,7 +17,7 @@ get_header(); ?>
)
);
- endwhile; // End of the loop.
+ endwhile; // End the loop.
?>
diff --git a/src/wp-content/themes/twentysixteen/archive.php b/src/wp-content/themes/twentysixteen/archive.php
index 079730f314..68a97fc537 100644
--- a/src/wp-content/themes/twentysixteen/archive.php
+++ b/src/wp-content/themes/twentysixteen/archive.php
@@ -31,14 +31,15 @@ get_header(); ?>
diff --git a/src/wp-content/themes/twentysixteen/inc/customizer.php b/src/wp-content/themes/twentysixteen/inc/customizer.php
index 370935802f..41f52667bc 100644
--- a/src/wp-content/themes/twentysixteen/inc/customizer.php
+++ b/src/wp-content/themes/twentysixteen/inc/customizer.php
@@ -103,7 +103,7 @@ if ( ! function_exists( 'twentysixteen_header_style' ) ) :
1 || is_preview() ) {
- // This blog has more than 1 category so twentysixteen_categorized_blog should return true.
+ // This blog has more than 1 category so twentysixteen_categorized_blog() should return true.
return true;
} else {
- // This blog has only 1 category so twentysixteen_categorized_blog should return false.
+ // This blog has only 1 category so twentysixteen_categorized_blog() should return false.
return false;
}
}
@@ -271,7 +271,7 @@ if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
*
- * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
+ * Added for backward compatibility to support pre-5.2.0 WordPress versions.
*
* @since Twenty Sixteen 2.0
*/
diff --git a/src/wp-content/themes/twentysixteen/index.php b/src/wp-content/themes/twentysixteen/index.php
index f6ec56c1db..0a1a3e0173 100644
--- a/src/wp-content/themes/twentysixteen/index.php
+++ b/src/wp-content/themes/twentysixteen/index.php
@@ -35,7 +35,8 @@ get_header(); ?>
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
- * called content-___.php (where ___ is the Post Format name) and that will be used instead.
+ * called content-___.php (where ___ is the Post Format name) and that
+ * will be used instead.
*/
get_template_part( 'template-parts/content', get_post_format() );
diff --git a/src/wp-content/themes/twentysixteen/page.php b/src/wp-content/themes/twentysixteen/page.php
index a232c9fce1..f5d6b7adb9 100644
--- a/src/wp-content/themes/twentysixteen/page.php
+++ b/src/wp-content/themes/twentysixteen/page.php
@@ -28,7 +28,7 @@ get_header(); ?>
comments_template();
}
- // End of the loop.
+ // End the loop.
endwhile;
?>
diff --git a/src/wp-content/themes/twentysixteen/single.php b/src/wp-content/themes/twentysixteen/single.php
index 3454170335..77a44d8692 100644
--- a/src/wp-content/themes/twentysixteen/single.php
+++ b/src/wp-content/themes/twentysixteen/single.php
@@ -45,7 +45,7 @@ get_header(); ?>
);
}
- // End of the loop.
+ // End the loop.
endwhile;
?>
diff --git a/src/wp-content/themes/twentyten/404.php b/src/wp-content/themes/twentyten/404.php
index 914ef01089..c67f6ca502 100644
--- a/src/wp-content/themes/twentyten/404.php
+++ b/src/wp-content/themes/twentyten/404.php
@@ -23,7 +23,7 @@ get_header(); ?>
-
+
-
+
diff --git a/src/wp-content/themes/twentyten/functions.php b/src/wp-content/themes/twentyten/functions.php
index 97f018d4ab..96629d1074 100644
--- a/src/wp-content/themes/twentyten/functions.php
+++ b/src/wp-content/themes/twentyten/functions.php
@@ -27,7 +27,7 @@
*
* add_action( 'after_setup_theme', 'my_child_theme_setup' );
* function my_child_theme_setup() {
- * // We are providing our own filter for excerpt_length (or using the unfiltered value)
+ * // We are providing our own filter for excerpt_length (or using the unfiltered value).
* remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
* ...
* }
@@ -119,15 +119,15 @@ if ( ! function_exists( 'twentyten_setup' ) ) :
// Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
- // This theme uses post thumbnails
+ // This theme uses post thumbnails.
add_theme_support( 'post-thumbnails' );
- // Add default posts and comments RSS feed links to head
+ // Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Make theme available for translation.
- * Translations can be filed in the /languages/ directory
+ * Translations can be filed in the /languages/ directory.
*/
load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
@@ -200,7 +200,7 @@ if ( ! function_exists( 'twentyten_setup' ) ) :
*/
set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
- // ... and thus ends the custom header business.
+ // ...and thus ends the custom header business.
// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
register_default_headers(
@@ -394,7 +394,7 @@ add_filter( 'use_default_gallery_style', '__return_false' );
function twentyten_remove_gallery_css( $css ) {
return preg_replace( "##s", '', $css );
}
-// Backwards compatibility with WordPress 3.0.
+// Backward compatibility with WordPress 3.0.
if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) {
add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
}
@@ -740,7 +740,7 @@ if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
*
- * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
+ * Added for backward compatibility to support pre-5.2.0 WordPress versions.
*
* @since Twenty Ten 2.9
*/
diff --git a/src/wp-content/themes/twentyten/header.php b/src/wp-content/themes/twentyten/header.php
index 6f3330796e..0349d0489c 100644
--- a/src/wp-content/themes/twentyten/header.php
+++ b/src/wp-content/themes/twentyten/header.php
@@ -86,7 +86,7 @@ if ( is_singular() && get_option( 'thread_comments' ) ) {
$header_image_width = HEADER_IMAGE_WIDTH;
}
- // Check if this is a post or page, if it has a thumbnail, and if it's a big one
+ // Check if this is a post or page, if it has a thumbnail, and if it's a big one.
if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
if ( $image && $image[1] >= $header_image_width ) {
@@ -105,15 +105,19 @@ if ( is_singular() && get_option( 'thread_comments' ) ) {
?>
-
+
-
'menu-header',
diff --git a/src/wp-content/themes/twentyten/loop-attachment.php b/src/wp-content/themes/twentyten/loop-attachment.php
index 235c7dcc1c..bf1af53c54 100644
--- a/src/wp-content/themes/twentyten/loop-attachment.php
+++ b/src/wp-content/themes/twentyten/loop-attachment.php
@@ -105,40 +105,42 @@ if ( have_posts() ) {
}
}
- // If there is more than 1 image attachment in a gallery
+ // If there is more than 1 image attachment in a gallery...
if ( count( $attachments ) > 1 ) {
$k++;
if ( isset( $attachments[ $k ] ) ) {
- // get the URL of the next image attachment
+ // ...get the URL of the next image attachment.
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
- } else { // or get the URL of the first image attachment
+ } else {
+ // ...or get the URL of the first image attachment.
$next_attachment_url = get_attachment_link( $attachments[0]->ID );
}
} else {
- // or, if there's only 1 image attachment, get the URL of the image
+ // Or, if there's only 1 image attachment, get the URL of the image.
$next_attachment_url = wp_get_attachment_url();
}
?>
-
diff --git a/src/wp-content/themes/twentytwelve/category.php b/src/wp-content/themes/twentytwelve/category.php
index 5d68df5454..ec8ce43f94 100644
--- a/src/wp-content/themes/twentytwelve/category.php
+++ b/src/wp-content/themes/twentytwelve/category.php
@@ -25,18 +25,19 @@ get_header(); ?>
?>
-
+
- 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
+ 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
-
+
-
+
@@ -58,7 +58,10 @@
diff --git a/src/wp-content/themes/twentytwelve/inc/custom-header.php b/src/wp-content/themes/twentytwelve/inc/custom-header.php
index 636309b7c9..c985246f8b 100644
--- a/src/wp-content/themes/twentytwelve/inc/custom-header.php
+++ b/src/wp-content/themes/twentytwelve/inc/custom-header.php
@@ -70,7 +70,7 @@ add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_cu
function twentytwelve_header_style() {
$text_color = get_header_textcolor();
- // If no custom options for text are set, let's bail
+ // If no custom options for text are set, let's bail.
if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) {
return;
}
diff --git a/src/wp-content/themes/twentytwelve/index.php b/src/wp-content/themes/twentytwelve/index.php
index c8bdc64a54..98649a8413 100644
--- a/src/wp-content/themes/twentytwelve/index.php
+++ b/src/wp-content/themes/twentytwelve/index.php
@@ -20,8 +20,8 @@ get_header(); ?>
-
@@ -63,11 +63,11 @@ get_header(); ?>
-
+
-
+
diff --git a/src/wp-content/themes/twentytwelve/js/theme-customizer.js b/src/wp-content/themes/twentytwelve/js/theme-customizer.js
index 8bf094be54..c388997da9 100644
--- a/src/wp-content/themes/twentytwelve/js/theme-customizer.js
+++ b/src/wp-content/themes/twentytwelve/js/theme-customizer.js
@@ -18,7 +18,7 @@
} );
} );
- // Header text color
+ // Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
diff --git a/src/wp-content/themes/twentytwelve/page-templates/front-page.php b/src/wp-content/themes/twentytwelve/page-templates/front-page.php
index 72efd0102b..28ce766b90 100644
--- a/src/wp-content/themes/twentytwelve/page-templates/front-page.php
+++ b/src/wp-content/themes/twentytwelve/page-templates/front-page.php
@@ -29,7 +29,7 @@ get_header(); ?>
-
+
diff --git a/src/wp-content/themes/twentytwelve/page-templates/full-width.php b/src/wp-content/themes/twentytwelve/page-templates/full-width.php
index 13a1b39be9..370e76eaf8 100644
--- a/src/wp-content/themes/twentytwelve/page-templates/full-width.php
+++ b/src/wp-content/themes/twentytwelve/page-templates/full-width.php
@@ -25,7 +25,7 @@ get_header(); ?>
?>
-
+
diff --git a/src/wp-content/themes/twentytwelve/page.php b/src/wp-content/themes/twentytwelve/page.php
index cf75606bd2..7107a61ce5 100644
--- a/src/wp-content/themes/twentytwelve/page.php
+++ b/src/wp-content/themes/twentytwelve/page.php
@@ -23,7 +23,7 @@ get_header(); ?>
?>
-
+
diff --git a/src/wp-content/themes/twentytwelve/search.php b/src/wp-content/themes/twentytwelve/search.php
index 51c84522a3..99acfe4034 100644
--- a/src/wp-content/themes/twentytwelve/search.php
+++ b/src/wp-content/themes/twentytwelve/search.php
@@ -25,8 +25,8 @@ get_header(); ?>
-
diff --git a/src/wp-content/themes/twentytwelve/single.php b/src/wp-content/themes/twentytwelve/single.php
index 10165cec39..4cc6a43a4b 100644
--- a/src/wp-content/themes/twentytwelve/single.php
+++ b/src/wp-content/themes/twentytwelve/single.php
@@ -27,7 +27,7 @@ get_header(); ?>
-
+
diff --git a/src/wp-content/themes/twentytwelve/tag.php b/src/wp-content/themes/twentytwelve/tag.php
index 6d42da5bc3..041427729d 100644
--- a/src/wp-content/themes/twentytwelve/tag.php
+++ b/src/wp-content/themes/twentytwelve/tag.php
@@ -25,19 +25,19 @@ get_header(); ?>
?>
-
+
+// for interaction media features. Adapted from .
twentytwenty.touchEnabled = {
init: function() {
@@ -95,21 +95,21 @@ twentytwenty.coverModals = {
init: function() {
if ( document.querySelector( '.cover-modal' ) ) {
- // Handle cover modals when they're toggled
+ // Handle cover modals when they're toggled.
this.onToggle();
- // When toggled, untoggle if visitor clicks on the wrapping element of the modal
+ // When toggled, untoggle if visitor clicks on the wrapping element of the modal.
this.outsideUntoggle();
- // Close on escape key press
+ // Close on escape key press.
this.closeOnEscape();
- // Hide and show modals before and after their animations have played out
+ // Hide and show modals before and after their animations have played out.
this.hideAndShowModals();
}
},
- // Handle cover modals when they're toggled
+ // Handle cover modals when they're toggled.
onToggle: function() {
document.querySelectorAll( '.cover-modal' ).forEach( function( element ) {
element.addEventListener( 'toggled', function( event ) {
@@ -122,7 +122,7 @@ twentytwenty.coverModals = {
body.classList.remove( 'showing-modal' );
body.classList.add( 'hiding-modal' );
- // Remove the hiding class after a delay, when animations have been run
+ // Remove the hiding class after a delay, when animations have been run.
setTimeout( function() {
body.classList.remove( 'hiding-modal' );
}, 500 );
@@ -131,7 +131,7 @@ twentytwenty.coverModals = {
} );
},
- // Close modal on outside click
+ // Close modal on outside click.
outsideUntoggle: function() {
document.addEventListener( 'click', function( event ) {
var target = event.target;
@@ -143,7 +143,7 @@ twentytwenty.coverModals = {
}.bind( this ) );
},
- // Close modal on escape key press
+ // Close modal on escape key press.
closeOnEscape: function() {
document.addEventListener( 'keydown', function( event ) {
if ( event.keyCode === 27 ) {
@@ -155,7 +155,7 @@ twentytwenty.coverModals = {
}.bind( this ) );
},
- // Hide and show modals before and after their animations have played out
+ // Hide and show modals before and after their animations have played out.
hideAndShowModals: function() {
var _doc = document,
_win = window,
@@ -188,7 +188,7 @@ twentytwenty.coverModals = {
};
}
- // Show the modal
+ // Show the modal.
modals.forEach( function( modal ) {
modal.addEventListener( 'toggle-target-before-inactive', function( event ) {
var styles = htmlStyles(),
@@ -221,7 +221,7 @@ twentytwenty.coverModals = {
modal.classList.add( 'show-modal' );
} );
- // Hide the modal after a delay, so animations have time to play out
+ // Hide the modal after a delay, so animations have time to play out.
modal.addEventListener( 'toggle-target-after-inactive', function( event ) {
if ( event.target !== modal ) {
return;
@@ -254,24 +254,24 @@ twentytwenty.coverModals = {
} );
},
- // Untoggle a modal
+ // Untoggle a modal.
untoggleModal: function( modal ) {
var modalTargetClass,
modalToggle = false;
- // If the modal has specified the string (ID or class) used by toggles to target it, untoggle the toggles with that target string
- // The modal-target-string must match the string toggles use to target the modal
+ // If the modal has specified the string (ID or class) used by toggles to target it, untoggle the toggles with that target string.
+ // The modal-target-string must match the string toggles use to target the modal.
if ( modal.dataset.modalTargetString ) {
modalTargetClass = modal.dataset.modalTargetString;
modalToggle = document.querySelector( '*[data-toggle-target="' + modalTargetClass + '"]' );
}
- // If a modal toggle exists, trigger it so all of the toggle options are included
+ // If a modal toggle exists, trigger it so all of the toggle options are included.
if ( modalToggle ) {
modalToggle.click();
- // If one doesn't exist, just hide the modal
+ // If one doesn't exist, just hide the modal.
} else {
modal.classList.remove( 'active' );
}
@@ -298,23 +298,23 @@ twentytwenty.intrinsicRatioVideos = {
var ratio, iTargetWidth,
container = video.parentNode;
- // Skip videos we want to ignore
+ // Skip videos we want to ignore.
if ( video.classList.contains( 'intrinsic-ignore' ) || video.parentNode.classList.contains( 'intrinsic-ignore' ) ) {
return true;
}
if ( ! video.dataset.origwidth ) {
- // Get the video element proportions
+ // Get the video element proportions.
video.setAttribute( 'data-origwidth', video.width );
video.setAttribute( 'data-origheight', video.height );
}
iTargetWidth = container.offsetWidth;
- // Get ratio from proportions
+ // Get ratio from proportions.
ratio = iTargetWidth / video.dataset.origwidth;
- // Scale based on ratio, thus retaining proportions
+ // Scale based on ratio, thus retaining proportions.
video.style.width = iTargetWidth + 'px';
video.style.height = ( video.dataset.origheight * ratio ) + 'px';
} );
@@ -328,7 +328,7 @@ twentytwenty.intrinsicRatioVideos = {
twentytwenty.modalMenu = {
init: function() {
- // If the current menu item is in a sub level, expand all the levels higher up on load
+ // If the current menu item is in a sub level, expand all the levels higher up on load.
this.expandLevel();
this.keepFocusInModal();
},
@@ -462,13 +462,13 @@ twentytwenty.toggles = {
clickedEl: false,
init: function() {
- // Do the toggle
+ // Do the toggle.
this.toggle();
- // Check for toggle/untoggle on resize
+ // Check for toggle/untoggle on resize.
this.resizeCheck();
- // Check for untoggle on escape key press
+ // Check for untoggle on escape key press.
this.untoggleOnEscapeKeyPress();
},
@@ -476,12 +476,12 @@ twentytwenty.toggles = {
var target, timeOutTime, classToToggle,
self = this,
_doc = document,
- // Get our targets
+ // Get our targets.
toggle = element,
targetString = toggle.dataset.toggleTarget,
activeClass = 'active';
- // Elements to focus after modals are closed
+ // Elements to focus after modals are closed.
if ( ! _doc.querySelectorAll( '.show-modal' ).length ) {
self.clickedEl = _doc.activeElement;
}
@@ -492,17 +492,17 @@ twentytwenty.toggles = {
target = _doc.querySelector( targetString );
}
- // Trigger events on the toggle targets before they are toggled
+ // Trigger events on the toggle targets before they are toggled.
if ( target.classList.contains( activeClass ) ) {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-before-active' ) );
} else {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-before-inactive' ) );
}
- // Get the class to toggle, if specified
+ // Get the class to toggle, if specified.
classToToggle = toggle.dataset.classToToggle ? toggle.dataset.classToToggle : activeClass;
- // For cover modals, set a short timeout duration so the class animations have time to play out
+ // For cover modals, set a short timeout duration so the class animations have time to play out.
timeOutTime = 0;
if ( target.classList.contains( 'cover-modal' ) ) {
@@ -515,36 +515,36 @@ twentytwenty.toggles = {
newTarget = subMenued ? toggle.closest( '.menu-item' ).querySelector( '.sub-menu' ) : target,
duration = toggle.dataset.toggleDuration;
- // Toggle the target of the clicked toggle
+ // Toggle the target of the clicked toggle.
if ( toggle.dataset.toggleType === 'slidetoggle' && ! instantly && duration !== '0' ) {
twentytwentyMenuToggle( newTarget, duration );
} else {
newTarget.classList.toggle( classToToggle );
}
- // If the toggle target is 'next', only give the clicked toggle the active class
+ // If the toggle target is 'next', only give the clicked toggle the active class.
if ( targetString === 'next' ) {
toggle.classList.toggle( activeClass );
} else if ( target.classList.contains( 'sub-menu' ) ) {
toggle.classList.toggle( activeClass );
} else {
- // If not, toggle all toggles with this toggle target
+ // If not, toggle all toggles with this toggle target.
_doc.querySelector( '*[data-toggle-target="' + targetString + '"]' ).classList.toggle( activeClass );
}
- // Toggle aria-expanded on the toggle
+ // Toggle aria-expanded on the toggle.
twentytwentyToggleAttribute( toggle, 'aria-expanded', 'true', 'false' );
if ( self.clickedEl && -1 !== toggle.getAttribute( 'class' ).indexOf( 'close-' ) ) {
twentytwentyToggleAttribute( self.clickedEl, 'aria-expanded', 'true', 'false' );
}
- // Toggle body class
+ // Toggle body class.
if ( toggle.dataset.toggleBodyClass ) {
_doc.body.classList.toggle( toggle.dataset.toggleBodyClass );
}
- // Check whether to set focus
+ // Check whether to set focus.
if ( toggle.dataset.setFocus ) {
focusElement = _doc.querySelector( toggle.dataset.setFocus );
@@ -557,10 +557,10 @@ twentytwenty.toggles = {
}
}
- // Trigger the toggled event on the toggle target
+ // Trigger the toggled event on the toggle target.
target.dispatchEvent( twentytwenty.createEvent( 'toggled' ) );
- // Trigger events on the toggle targets after they are toggled
+ // Trigger events on the toggle targets after they are toggled.
if ( target.classList.contains( activeClass ) ) {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-after-active' ) );
} else {
@@ -569,7 +569,7 @@ twentytwenty.toggles = {
}, timeOutTime );
},
- // Do the toggle
+ // Do the toggle.
toggle: function() {
var self = this;
@@ -581,7 +581,7 @@ twentytwenty.toggles = {
} );
},
- // Check for toggle/untoggle on screen resize
+ // Check for toggle/untoggle on screen resize.
resizeCheck: function() {
if ( document.querySelectorAll( '*[data-untoggle-above], *[data-untoggle-below], *[data-toggle-above], *[data-toggle-below]' ).length ) {
window.addEventListener( 'resize', function() {
@@ -594,12 +594,12 @@ twentytwenty.toggles = {
toggleAbove = toggle.dataset.toggleAbove,
toggleBelow = toggle.dataset.toggleBelow;
- // If no width comparison is set, continue
+ // If no width comparison is set, continue.
if ( ! unToggleAbove && ! unToggleBelow && ! toggleAbove && ! toggleBelow ) {
return;
}
- // If the toggle width comparison is true, toggle the toggle
+ // If the toggle width comparison is true, toggle the toggle.
if (
( ( ( unToggleAbove && winWidth > unToggleAbove ) ||
( unToggleBelow && winWidth < unToggleBelow ) ) &&
@@ -615,7 +615,7 @@ twentytwenty.toggles = {
}
},
- // Close toggle on escape key press
+ // Close toggle on escape key press.
untoggleOnEscapeKeyPress: function() {
document.addEventListener( 'keyup', function( event ) {
if ( event.key === 'Escape' ) {
@@ -631,9 +631,9 @@ twentytwenty.toggles = {
}; // twentytwenty.toggles
/**
- * Is the DOM ready
+ * Is the DOM ready?
*
- * this implementation is coming from https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/
+ * This implementation is coming from https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/
*
* @param {Function} fn Callback function to run.
*/
@@ -650,12 +650,12 @@ function twentytwentyDomReady( fn ) {
}
twentytwentyDomReady( function() {
- twentytwenty.toggles.init(); // Handle toggles
- twentytwenty.coverModals.init(); // Handle cover modals
- twentytwenty.intrinsicRatioVideos.init(); // Retain aspect ratio of videos on window resize
- twentytwenty.modalMenu.init(); // Modal Menu
- twentytwenty.primaryMenu.init(); // Primary Menu
- twentytwenty.touchEnabled.init(); // Add class to body if device is touch-enabled
+ twentytwenty.toggles.init(); // Handle toggles.
+ twentytwenty.coverModals.init(); // Handle cover modals.
+ twentytwenty.intrinsicRatioVideos.init(); // Retain aspect ratio of videos on window resize.
+ twentytwenty.modalMenu.init(); // Modal Menu.
+ twentytwenty.primaryMenu.init(); // Primary Menu.
+ twentytwenty.touchEnabled.init(); // Add class to body if device is touch-enabled.
} );
/* -----------------------------------------------------------------------------------------------
@@ -717,9 +717,11 @@ function twentytwentyMenuToggle( target, duration ) {
// The whole process happens without giving the browser a chance to render, so it's invisible.
target.classList.toggle( 'active' );
- // Step 4: prepare animation.
- // Position all the items with absolute offsets, at the same starting position.
- // Shouldn't result in any visual changes if done right.
+ /*
+ * Step 4: prepare animation.
+ * Position all the items with absolute offsets, at the same starting position.
+ * Shouldn't result in any visual changes if done right.
+ */
menu.classList.add( 'is-toggling' );
target.classList.toggle( 'active' );
menuItems.forEach( function( menuItem, index ) {
@@ -730,15 +732,19 @@ function twentytwentyMenuToggle( target, duration ) {
menuItem.style.transform = 'translate(' + initialPosition.x + 'px, ' + initialPosition.y + 'px)';
} );
- // The double rAF is unfortunately needed, since we're toggling CSS classes, and
- // the only way to ensure layout completion here across browsers is to wait twice.
- // This just delays the start of the animation by 2 frames and is thus not an issue.
+ /*
+ * The double rAF is unfortunately needed, since we're toggling CSS classes, and
+ * the only way to ensure layout completion here across browsers is to wait twice.
+ * This just delays the start of the animation by 2 frames and is thus not an issue.
+ */
requestAnimationFrame( function() {
requestAnimationFrame( function() {
- // Step 5: start animation by moving everything to final position.
- // All the layout work has already happened, while we were preparing for the animation.
- // The animation now runs entirely in CSS, using cheap CSS properties (opacity and transform)
- // that don't trigger the layout or paint stages.
+ /*
+ * Step 5: start animation by moving everything to final position.
+ * All the layout work has already happened, while we were preparing for the animation.
+ * The animation now runs entirely in CSS, using cheap CSS properties (opacity and transform)
+ * that don't trigger the layout or paint stages.
+ */
menu.classList.add( 'is-animating' );
menuItems.forEach( function( menuItem, index ) {
var finalPosition = finalPositions[ index ];
@@ -774,7 +780,7 @@ function twentytwentyMenuToggle( target, duration ) {
}
/**
- * traverses the DOM up to find elements matching the query
+ * Traverses the DOM up to find elements matching the query.
*
* @param {HTMLElement} target
* @param {string} query
@@ -783,7 +789,7 @@ function twentytwentyMenuToggle( target, duration ) {
function twentytwentyFindParents( target, query ) {
var parents = [];
- // recursively go up the DOM adding matches to the parents array
+ // Recursively go up the DOM adding matches to the parents array.
function traverse( item ) {
var parent = item.parentNode;
if ( parent instanceof HTMLElement ) {
diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php
index ef1f2e66c2..df95c56a37 100644
--- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php
+++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-non-latin-languages.php
@@ -26,7 +26,7 @@ if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
*/
public static function get_non_latin_css( $type = 'front-end' ) {
- // Fetch users locale.
+ // Fetch site locale.
$locale = get_bloginfo( 'language' );
// Define fallback fonts for non-latin languages.
diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
index 88ccf641f9..cc05187bcb 100644
--- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
+++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-script-loader.php
@@ -29,7 +29,7 @@ if ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {
* @return string Script HTML string.
*/
public function filter_script_loader_tag( $tag, $handle ) {
- foreach ( [ 'async', 'defer' ] as $attr ) {
+ foreach ( array( 'async', 'defer' ) as $attr ) {
if ( ! wp_scripts()->get_data( $handle, $attr ) ) {
continue;
}
diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php
index 4dcf4d59f4..6193d3cd68 100644
--- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php
+++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php
@@ -32,10 +32,10 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
if ( array_key_exists( $icon, $arr ) ) {
$repl = '\s*', '><', $svg ); // Remove white space between SVG tags.
+ $svg = preg_replace( '/>\s*', '><', $svg ); // Remove whitespace between SVG tags.
return $svg;
}
return null;
diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php
index 727817c75e..eda038e3c8 100644
--- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php
+++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php
@@ -33,7 +33,7 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Comment' ) ) {
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
?>
- < id="comment-" has_children ? 'parent' : '', $comment ); ?>>
+ < id="comment-" has_children ? 'parent' : '', $comment ); ?>>