@@ -191,6 +191,8 @@ let domContentLoad = (again = false) => {
191191
192192 let elementsArray_time = document . getElementsByTagName ( "timed" ) ;
193193 Array . from ( elementsArray_time ) . forEach ( function ( elem ) {
194+
195+ setTimers ( elem ) ;
194196 if ( elem . classList . contains ( "time-inactive" ) )
195197 return ;
196198 if ( elem . classList . contains ( "time-active" ) ) {
@@ -199,7 +201,7 @@ let domContentLoad = (again = false) => {
199201 }
200202 else if ( elem . classList . contains ( "time-inactive" ) ) {
201203 auto = false ;
202- }
204+ }
203205 } ) ;
204206
205207 let elementsArray_dyn = document . getElementsByTagName ( "dyn" ) ;
@@ -218,6 +220,8 @@ let domContentLoad = (again = false) => {
218220 processCartTags ( ) ;
219221 processOrderConfirmationTags ( ) ;
220222 processColumnsTags ( ) ;
223+
224+
221225 let elements_Carousel = document . getElementsByTagName ( "carousel" ) ;
222226 Array . from ( elements_Carousel ) . forEach ( function ( elem ) {
223227 if ( ! elem . classList . contains ( "turn-auto" ) )
@@ -279,30 +283,19 @@ let domContentLoad = (again = false) => {
279283 var ev = elemv . getAttribute ( "event" ) ;
280284 if ( ! ev ) {
281285 elemv . addEventListener ( "click" , function ( ) {
282- pipes ( elemv , auto ) ;
286+ pipes ( elemv , false ) ;
283287 } ) ;
284288 return ;
285289 }
286290 var rv = ev . split ( ";" ) ;
287291 Array . from ( rv ) . forEach ( ( v ) => {
288292 elemv . addEventListener ( v , function ( ) {
289- pipes ( elemv , auto ) ;
293+ pipes ( elemv , false ) ;
290294 } ) ;
291295 } ) ;
292296 } ) ;
293297}
294298
295- /**
296- * columns-component.js - Multi-column layout component for dotPipe.js
297- * This handles the <columns> custom element for creating responsive multi-column layouts
298- * with dynamic content loading
299- */
300-
301- // Initialize columns component functionality when DOM is loaded
302- document . addEventListener ( "DOMContentLoaded" , function ( ) {
303- // Process all columns tags
304- processColumnsTags ( ) ;
305- } ) ;
306299
307300/**
308301 * Process all columns tags in the document
@@ -4281,8 +4274,30 @@ function parseCSVLine(line) {
42814274 } ) ;
42824275}
42834276
4284- // Usage example to generate a nonce
4285- function generateNonce ( ) {
4277+ /**
4278+ * Calculates the SHA-256 hash of a string
4279+ * @param {string } message - The input string
4280+ * @returns {Promise<string> } - The SHA-256 hash as a hex string
4281+ */
4282+ async function sha256 ( message ) {
4283+ // Convert the message string to an array of bytes
4284+ const msgBuffer = new TextEncoder ( ) . encode ( message ) ;
4285+
4286+ // Hash the message using the SubtleCrypto API
4287+ const hashBuffer = await crypto . subtle . digest ( 'SHA-256' , msgBuffer ) ;
4288+
4289+ // Convert the hash buffer to a hex string
4290+ const hashArray = Array . from ( new Uint8Array ( hashBuffer ) ) ;
4291+ const hashHex = hashArray . map ( b => b . toString ( 16 ) . padStart ( 2 , '0' ) ) . join ( '' ) ;
4292+
4293+ return hashHex ;
4294+ }
4295+
4296+ /**
4297+ * Generates a secure nonce using SHA-256
4298+ * @returns {Promise<string> } - A 16-character nonce
4299+ */
4300+ async function generateNonce ( ) {
42864301 const randomBytes = new Uint8Array ( 16 ) ;
42874302 crypto . getRandomValues ( randomBytes ) ;
42884303 return sha256 ( randomBytes . join ( '' ) ) . then ( hash => hash . slice ( 0 , 16 ) ) ;
0 commit comments