wp/wp-includes/js/wp-api.js
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
       
     1 /**
       
     2  * @output wp-includes/js/wp-api.js
       
     3  */
       
     4 
     1 (function( window, undefined ) {
     5 (function( window, undefined ) {
     2 
     6 
     3 	'use strict';
     7 	'use strict';
     4 
     8 
     5 	/**
     9 	/**
   139 	 * @return {[type]} [description]
   143 	 * @return {[type]} [description]
   140 	 */
   144 	 */
   141 	wp.api.utils.getRootUrl = function() {
   145 	wp.api.utils.getRootUrl = function() {
   142 		return window.location.origin ?
   146 		return window.location.origin ?
   143 			window.location.origin + '/' :
   147 			window.location.origin + '/' :
   144 			window.location.protocol + '/' + window.location.host + '/';
   148 			window.location.protocol + '//' + window.location.host + '/';
   145 	};
   149 	};
   146 
   150 
   147 	/**
   151 	/**
   148 	 * Helper for capitalizing strings.
   152 	 * Helper for capitalizing strings.
   149 	 */
   153 	 */
  1169 					/**
  1173 					/**
  1170 					 * When the server returns the schema model data, store the data in a sessionCache so we don't
  1174 					 * When the server returns the schema model data, store the data in a sessionCache so we don't
  1171 					 * have to retrieve it again for this session. Then, construct the models and collections based
  1175 					 * have to retrieve it again for this session. Then, construct the models and collections based
  1172 					 * on the schema model data.
  1176 					 * on the schema model data.
  1173 					 *
  1177 					 *
  1174 					 * @callback
  1178 					 * @ignore
  1175 					 */
  1179 					 */
  1176 					success: function( newSchemaModel ) {
  1180 					success: function( newSchemaModel ) {
  1177 
  1181 
  1178 						// Store a copy of the schema model in the session cache if available.
  1182 						// Store a copy of the schema model in the session cache if available.
  1179 						if ( ! _.isUndefined( sessionStorage ) && ( _.isUndefined( wpApiSettings.cacheSchema ) || wpApiSettings.cacheSchema ) ) {
  1183 						if ( ! _.isUndefined( sessionStorage ) && ( _.isUndefined( wpApiSettings.cacheSchema ) || wpApiSettings.cacheSchema ) ) {