Subversion Repositories SmartDukaan

Rev

Rev 35709 | Rev 36234 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35709 Rev 35757
Line 1... Line 1...
1
<html lang="en">
1
<html lang="en">
2
<head>
2
<head>
3
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
3
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
4
    <meta http-equiv="refresh" content="360">
-
 
5
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
4
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
6
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
5
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
7
    <style>
6
    <style>
8
        html, body {
7
        html, body {
9
            margin-top: 10px;
8
            margin-top: 10px;
Line 267... Line 266...
267
    });
266
    });
268
 
267
 
269
 
268
 
270
</script>
269
</script>
271
 
270
 
-
 
271
<script>
-
 
272
    // Smart page refresh - pauses when modal is open or audio is playing
-
 
273
    (function () {
-
 
274
        var REFRESH_INTERVAL = 360000; // 360 seconds = 6 minutes
-
 
275
 
-
 
276
        function isAnyModalOpen() {
-
 
277
            // Check if any Bootstrap modal is currently shown
-
 
278
            return $('.modal.show').length > 0 || $('.modal.in').length > 0;
-
 
279
        }
-
 
280
 
-
 
281
        function isAnyAudioPlaying() {
-
 
282
            // Check if any audio element is currently playing
-
 
283
            var audioElements = document.querySelectorAll('audio');
-
 
284
            for (var i = 0; i < audioElements.length; i++) {
-
 
285
                if (!audioElements[i].paused) {
-
 
286
                    return true;
-
 
287
                }
-
 
288
            }
-
 
289
            return false;
-
 
290
        }
-
 
291
 
-
 
292
        function canRefresh() {
-
 
293
            return !isAnyModalOpen() && !isAnyAudioPlaying();
-
 
294
        }
-
 
295
 
-
 
296
        function smartRefresh() {
-
 
297
            if (canRefresh()) {
-
 
298
                location.reload();
-
 
299
            }
-
 
300
            // If can't refresh now, check again in 10 seconds
-
 
301
            // This ensures refresh happens soon after modal closes or audio stops
-
 
302
        }
-
 
303
 
-
 
304
        // Set up the refresh interval
-
 
305
        setInterval(function () {
-
 
306
            if (canRefresh()) {
-
 
307
                location.reload();
-
 
308
            }
-
 
309
        }, REFRESH_INTERVAL);
-
 
310
    })();
-
 
311
</script>
-
 
312
 
272
</body>
313
</body>
273
</html>
314
</html>
274
315