Skip to content

Commit 9a85d58

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 8c98828 + e9729b0 commit 9a85d58

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/js/_enqueues/wp/api.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
}
9999

100100
/**
101-
* Parse date into ISO8601 format.
101+
* Parse date into ISO 8601 format.
102102
*
103103
* @param {Date} date.
104104
*/
@@ -306,7 +306,7 @@
306306
/**
307307
* Mixin for all content that is time stamped.
308308
*
309-
* This mixin converts between mysql timestamps and JavaScript Dates when syncing a model
309+
* This mixin converts between MySQL timestamps and JavaScript Dates when syncing a model
310310
* to or from the server. For example, a date stored as `2015-12-27T21:22:24` on the server
311311
* gets expanded to `Sun Dec 27 2015 14:22:24 GMT-0700 (MST)` when the model is fetched.
312312
*
@@ -361,7 +361,7 @@
361361
* Build a helper function to retrieve related model.
362362
*
363363
* @param {string} parentModel The parent model.
364-
* @param {number} modelId The model ID if the object to request
364+
* @param {number} modelId The model ID of the object to request.
365365
* @param {string} modelName The model name to use when constructing the model.
366366
* @param {string} embedSourcePoint Where to check the embedded object for _embed data.
367367
* @param {string} embedCheckField Which model field to check to see if the model has data.
@@ -423,7 +423,7 @@
423423
*/
424424
buildCollectionGetter = function( parentModel, collectionName, embedSourcePoint, embedIndex ) {
425425
/**
426-
* Returns a promise that resolves to the requested collection
426+
* Returns a promise that resolves to the requested collection.
427427
*
428428
* Uses the embedded data if available, otherwise fetches the
429429
* data from the server.
@@ -467,7 +467,7 @@
467467
// Create the new getObjects collection.
468468
getObjects = new wp.api.collections[ collectionName ]( properties, classProperties );
469469

470-
// If we didn’t have embedded getObjects, fetch the getObjects data.
470+
// If we don’t have embedded getObjects, fetch the getObjects data.
471471
if ( _.isUndefined( getObjects.models[0] ) ) {
472472
getObjects.fetch( {
473473
success: function( getObjects ) {
@@ -497,7 +497,7 @@
497497
*/
498498
setHelperParentPost = function( collection, postId ) {
499499

500-
// Attach post_parent id to the collection.
500+
// Attach parent post ID to the collection.
501501
_.each( collection.models, function( model ) {
502502
model.set( 'parent_post', postId );
503503
} );
@@ -754,7 +754,7 @@
754754
return model;
755755
}
756756

757-
// Go thru the parsable date fields, if our model contains any of them it gets the TimeStampedMixin.
757+
// Go through the parsable date fields. If our model contains any of them, it gets the TimeStampedMixin.
758758
_.each( parseableDates, function( theDateKey ) {
759759
if ( ! _.isUndefined( model.prototype.args[ theDateKey ] ) ) {
760760
hasDate = true;
@@ -1168,7 +1168,7 @@
11681168
sessionStorage.getItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ) )
11691169
) {
11701170

1171-
// Used a cached copy of the schema model if available.
1171+
// Use a cached copy of the schema model if available.
11721172
model.schemaModel.set( model.schemaModel.parse( JSON.parse( sessionStorage.getItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ) ) ) ) );
11731173
} else {
11741174
model.schemaModel.fetch( {
@@ -1187,7 +1187,7 @@
11871187
sessionStorage.setItem( 'wp-api-schema-model' + model.get( 'apiRoot' ) + model.get( 'versionString' ), JSON.stringify( newSchemaModel ) );
11881188
} catch ( error ) {
11891189

1190-
// Fail silently, fixes errors in safari private mode.
1190+
// Fail silently, to avoid errors in Safari private mode.
11911191
}
11921192
}
11931193
},
@@ -1207,7 +1207,7 @@
12071207
* Set up the model and collection name mapping options. As the schema is built, the
12081208
* model and collection names will be adjusted if they are found in the mapping object.
12091209
*
1210-
* Localizing a variable wpApiSettings.mapping will over-ride the default mapping options.
1210+
* Localizing a variable wpApiSettings.mapping will override the default mapping options.
12111211
*
12121212
*/
12131213
mapping = wpApiSettings.mapping || {
@@ -1242,7 +1242,7 @@
12421242
modelRegex = new RegExp( '(?:.*[+)]|\/(' + modelEndpoints.join( '|' ) + '))$' );
12431243

12441244
/**
1245-
* Iterate thru the routes, picking up models and collections to build. Builds two arrays,
1245+
* Iterate through the routes, picking up models and collections to build. Builds two arrays,
12461246
* one for models and one for collections.
12471247
*/
12481248
modelRoutes = [];
@@ -1288,7 +1288,7 @@
12881288
parentName = wp.api.utils.extractRoutePart( modelRoute.index, 1, routeModel.get( 'versionString' ), false ),
12891289
routeEnd = wp.api.utils.extractRoutePart( modelRoute.index, 1, routeModel.get( 'versionString' ), true );
12901290

1291-
// Clear the parent part of the route if it's actually the version string.
1291+
// Clear the parent part of the route if it is actually the version string.
12921292
if ( parentName === routeModel.get( 'versionString' ) ) {
12931293
parentName = '';
12941294
}
@@ -1304,7 +1304,7 @@
13041304
modelClassName = mapping.models[ modelClassName ] || modelClassName;
13051305
loadingObjects.models[ modelClassName ] = wp.api.WPApiBaseModel.extend( {
13061306

1307-
// Return a constructed url based on the parent and id.
1307+
// Return a constructed URL based on the parent and ID.
13081308
url: function() {
13091309
var url =
13101310
routeModel.get( 'apiRoot' ) +
@@ -1347,7 +1347,7 @@
13471347
modelClassName = mapping.models[ modelClassName ] || modelClassName;
13481348
loadingObjects.models[ modelClassName ] = wp.api.WPApiBaseModel.extend( {
13491349

1350-
// Function that returns a constructed url based on the ID.
1350+
// Function that returns a constructed URL based on the ID.
13511351
url: function() {
13521352
var url = routeModel.get( 'apiRoot' ) +
13531353
routeModel.get( 'versionString' ) +
@@ -1409,7 +1409,7 @@
14091409
collectionClassName = mapping.collections[ collectionClassName ] || collectionClassName;
14101410
loadingObjects.collections[ collectionClassName ] = wp.api.WPApiBaseCollection.extend( {
14111411

1412-
// Function that returns a constructed url passed on the parent.
1412+
// Function that returns a constructed URL passed on the parent.
14131413
url: function() {
14141414
return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) +
14151415
parentName + '/' +
@@ -1448,7 +1448,7 @@
14481448
collectionClassName = mapping.collections[ collectionClassName ] || collectionClassName;
14491449
loadingObjects.collections[ collectionClassName ] = wp.api.WPApiBaseCollection.extend( {
14501450

1451-
// For the url of a root level collection, use a string.
1451+
// For the URL of a root level collection, use a string.
14521452
url: function() {
14531453
return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) + routeName;
14541454
},

0 commit comments

Comments
 (0)