Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
38 lines
844 B
JavaScript
38 lines
844 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.prependHTTPS = prependHTTPS;
|
|
var _prependHttp = require("./prepend-http");
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
/**
|
|
* Prepends "https://" to a url, if it looks like something that is meant to be a TLD.
|
|
*
|
|
* Note: this will not replace "http://" with "https://".
|
|
*
|
|
* @param {string} url The URL to test.
|
|
*
|
|
* @example
|
|
* ```js
|
|
* const actualURL = prependHTTPS( 'wordpress.org' ); // https://wordpress.org
|
|
* ```
|
|
*
|
|
* @return {string} The updated URL.
|
|
*/
|
|
function prependHTTPS(url) {
|
|
if (!url) {
|
|
return url;
|
|
}
|
|
|
|
// If url starts with http://, return it as is.
|
|
if (url.startsWith('http://')) {
|
|
return url;
|
|
}
|
|
url = (0, _prependHttp.prependHTTP)(url);
|
|
return url.replace(/^http:/, 'https:');
|
|
}
|
|
//# sourceMappingURL=prepend-https.js.map
|