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>
36 lines
815 B
JavaScript
36 lines
815 B
JavaScript
'use strict';
|
|
|
|
var Headers = function() {
|
|
this.clear();
|
|
};
|
|
|
|
Headers.prototype.ALLOWED_DUPLICATES = ['set-cookie', 'set-cookie2', 'warning', 'www-authenticate'];
|
|
|
|
Headers.prototype.clear = function() {
|
|
this._sent = {};
|
|
this._lines = [];
|
|
};
|
|
|
|
Headers.prototype.set = function(name, value) {
|
|
if (value === undefined) return;
|
|
|
|
name = this._strip(name);
|
|
value = this._strip(value);
|
|
|
|
var key = name.toLowerCase();
|
|
if (!this._sent.hasOwnProperty(key) || this.ALLOWED_DUPLICATES.indexOf(key) >= 0) {
|
|
this._sent[key] = true;
|
|
this._lines.push(name + ': ' + value + '\r\n');
|
|
}
|
|
};
|
|
|
|
Headers.prototype.toString = function() {
|
|
return this._lines.join('');
|
|
};
|
|
|
|
Headers.prototype._strip = function(string) {
|
|
return string.toString().replace(/^ */, '').replace(/ *$/, '');
|
|
};
|
|
|
|
module.exports = Headers;
|