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
960 B
JavaScript
38 lines
960 B
JavaScript
export const INITIAL_BOUNDS = {
|
|
width: 200,
|
|
height: 170
|
|
};
|
|
const VIDEO_EXTENSIONS = ['avi', 'mpg', 'mpeg', 'mov', 'mp4', 'm4v', 'ogg', 'ogv', 'webm', 'wmv'];
|
|
|
|
/**
|
|
* Gets the extension of a file name.
|
|
*
|
|
* @param filename The file name.
|
|
* @return The extension of the file name.
|
|
*/
|
|
export function getExtension(filename = '') {
|
|
const parts = filename.split('.');
|
|
return parts[parts.length - 1];
|
|
}
|
|
|
|
/**
|
|
* Checks if a file is a video.
|
|
*
|
|
* @param filename The file name.
|
|
* @return Whether the file is a video.
|
|
*/
|
|
export function isVideoType(filename = '') {
|
|
if (!filename) return false;
|
|
return filename.startsWith('data:video/') || VIDEO_EXTENSIONS.includes(getExtension(filename));
|
|
}
|
|
|
|
/**
|
|
* Transforms a fraction value to a percentage value.
|
|
*
|
|
* @param fraction The fraction value.
|
|
* @return A percentage value.
|
|
*/
|
|
export function fractionToPercentage(fraction) {
|
|
return Math.round(fraction * 100);
|
|
}
|
|
//# sourceMappingURL=utils.js.map
|