plugin updates

This commit is contained in:
Tony Volpe
2024-06-17 14:48:11 -04:00
parent ecc5fbf831
commit 3751a5a1a6
1318 changed files with 91130 additions and 52250 deletions

View File

@@ -65,6 +65,8 @@
if ( ! allow ) {
// Reset cookies, and clear form data.
removeTrackingCookies();
} else if ( typeof sbjs === 'undefined' ) {
return; // Do nothing, as sourcebuster.js is not loaded.
} else {
// If not done yet, initialize sourcebuster.js which populates `sbjs.get` object.
sbjs.init( {
@@ -153,12 +155,16 @@
* but it's not yet supported in Safari.
*/
connectedCallback() {
let inputs = '';
this.innerHTML = '';
const inputs = new DocumentFragment();
for( const fieldName of this._fieldNames ) {
const value = stringifyFalsyInputValue( this.values[ fieldName ] );
inputs += `<input type="hidden" name="${params.prefix}${fieldName}" value="${value}"/>`;
const input = document.createElement( 'input' );
input.type = 'hidden';
input.name = `${params.prefix}${fieldName}`;
input.value = stringifyFalsyInputValue( ( this.values && this.values[ fieldName ] ) || '' );
inputs.appendChild( input );
}
this.innerHTML = inputs;
this.appendChild( inputs );
}
/**