window.addEventListener('DOMContentLoaded', event => { // Navbar shrink function var navbarShrink = function () { const navbarCollapsible = document.body.querySelector('#mainNav'); if (!navbarCollapsible) { return; } if (window.scrollY === 0) { navbarCollapsible.classList.remove('navbar-shrink') } else { navbarCollapsible.classList.add('navbar-shrink') } }; // Shrink the navbar navbarShrink(); // Shrink the navbar when page is scrolled document.addEventListener('scroll', navbarShrink); // Activate Bootstrap scrollspy on the main nav element const mainNav = document.body.querySelector('#mainNav'); if (mainNav) { new bootstrap.ScrollSpy(document.body, { target: '#mainNav', rootMargin: '0px 0px -40%', }); }; // Collapse responsive navbar when toggler is visible const navbarToggler = document.body.querySelector('.navbar-toggler'); const responsiveNavItems = [].slice.call( document.querySelectorAll('#navbarResponsive .nav-link') ); responsiveNavItems.map(function (responsiveNavItem) { responsiveNavItem.addEventListener('click', () => { if (window.getComputedStyle(navbarToggler).display !== 'none') { navbarToggler.click(); } }); }); }); $("html, body").animate( { scrollTop: 0 }, 100 ); function processReport() { $("#process_report").prop('disabled', true); // Hide all progress bars initially $(".progress").addClass("d-none"); // Track progress totals by ID let totalProgress = {}; const newElements = $(".new-element"); const delay = 1000; // Delay between each reveal (adjust as you like) newElements.each(function (index, el) { setTimeout(() => { const $el = $(el); const progressId = $el.data("progress"); const progressValue = parseInt($el.data("progress-value")) || 0; // Hide corresponding landing image before showing new one $el.siblings('.landing-element').addClass("d-none"); // Reveal element with fade animation $el.removeClass("d-none").addClass("animate__animated animate__fadeInUp"); console.log($el.text()); if ($el.text().trim() == "NO ACTIVE PROMOTIONS") { $("#no-active-promotions").removeClass("d-none").addClass("animate__animated animate__fadeInUp"); } // Scroll to progress bar if exists if (progressId && $("#" + progressId).length) { $("html, body").animate( { scrollTop: $("#" + progressId).offset().top - 20 }, 200 ); } // Handle progress bar if (progressId && $("#" + progressId).length) { const $progress = $("#" + progressId); const $bar = $progress.find(".progress-bar"); const $parent = $el.closest('.row'); $progress.removeClass("d-none"); // Initialize or increment progress totalProgress[progressId] = Math.min( (totalProgress[progressId] || 0) + progressValue, 100 ); if (totalProgress[progressId] === 100) { $parent.find('.landing-element').addClass("d-none"); } // Instantly update progress bar $bar.css("width", totalProgress[progressId] + "%"); $bar.attr("aria-valuenow", totalProgress[progressId]); $bar.text(totalProgress[progressId] + "%"); } // ✅ After last element is processed if (index === newElements.length - 1) { setTimeout(() => { $(".progress").addClass("d-none"); // alert(1) window.scrollTo(0, document.body.scrollHeight); $("#publish").removeClass("d-none").addClass("animate__animated animate__fadeInUp"); const name = generateFileName(); console.log(name); $('.csrfile').text(name).removeClass('d-none'); }, 100); // Wait a moment before showing publish } }, delay * (index + 1)); }); } function captureImgs() { document.getElementById('loader-overlay').classList.add('show'); setTimeout(() => { $("#process_report").prop('disabled', false); document.getElementById('loader-overlay').classList.remove('show'); }, 10000); } $(document).ready(function () { function removeEditable() { $('[contenteditable]').removeAttr('contenteditable').removeClass('form-control'); } // On button click $('#disableEdit').on('click', function () { removeEditable(); }); // On pressing ESC key $(document).on('keydown', function (e) { if (e.key === 'Escape' || e.keyCode === 27) { removeEditable(); } }); $(document).on('click', '.edit-list-btn', function () { const $wrapper = $(this).closest('.editable-list-wrapper'); const $ul = $wrapper.find('.editable-list'); const $editBox = $wrapper.find('.list-edit'); const $textarea = $editBox.find('.list-editor'); const lines = $ul.find('li').map(function () { return $(this).text().trim(); }).get().join('\n'); $textarea.val(lines); $ul.addClass('d-none'); $(this).addClass('d-none'); $editBox.removeClass('d-none'); }); $(document).on('click', '.save-list', function () { const $editBox = $(this).closest('.list-edit'); const $wrapper = $editBox.closest('.editable-list-wrapper'); const $ul = $wrapper.find('.editable-list'); const $editBtn = $wrapper.find('.edit-list-btn'); const $textarea = $editBox.find('.list-editor'); const lines = $textarea.val().split('\n').map(l => l.trim()).filter(l => l); $ul.html(lines.map(l => `
  • ${l}
  • `).join('')); $editBox.addClass('d-none'); $ul.removeClass('d-none'); $editBtn.removeClass('d-none'); }); $(document).on('click', '.cancel-list', function () { const $editBox = $(this).closest('.list-edit'); const $wrapper = $editBox.closest('.editable-list-wrapper'); const $ul = $wrapper.find('.editable-list'); const $editBtn = $wrapper.find('.edit-list-btn'); $editBox.addClass('d-none'); $ul.removeClass('d-none'); $editBtn.removeClass('d-none'); }); $(document).on('click', '.edit-link-btn', function () { const $wrapper = $(this).closest('.editable-link-wrapper'); const $editBox = $wrapper.next('.link-edit'); const $link = $wrapper.find('.editable-link'); // Get current values const text = $link.text().trim(); const href = $link.attr('href'); // Populate inputs $editBox.find('.link-text').val(text); $editBox.find('.link-url').val(href); $wrapper.addClass('d-none'); $editBox.removeClass('d-none'); }); $(document).on('click', '.save-link', function () { const $editBox = $(this).closest('.link-edit'); const $wrapper = $editBox.prev('.editable-link-wrapper'); const $link = $wrapper.find('.editable-link'); // Get updated values const newText = $editBox.find('.link-text').val().trim(); const newHref = $editBox.find('.link-url').val().trim() || '#'; // Apply updates $link.text(newText).attr('href', newHref); $editBox.addClass('d-none'); $wrapper.removeClass('d-none'); }); $(document).on('click', '.cancel-link', function () { const $editBox = $(this).closest('.link-edit'); const $wrapper = $editBox.prev('.editable-link-wrapper'); $editBox.addClass('d-none'); $wrapper.removeClass('d-none'); }); let cropper; // make it global so we can destroy later const myModalEl = document.getElementById('cropImage'); myModalEl.addEventListener('shown.bs.modal', function (event) { 'use strict'; const console = window.console || { log: function () { } }; const $image = $('#crop_image'); // const $download = $('#download'); const $dataX = $('#dataX'); const $dataY = $('#dataY'); const $dataHeight = $('#dataHeight'); const $dataWidth = $('#dataWidth'); const $dataRotate = $('#dataRotate'); const $dataScaleX = $('#dataScaleX'); const $dataScaleY = $('#dataScaleY'); // If cropper already exists, destroy it before creating a new one if (cropper) { cropper.destroy(); cropper = null; } const options = { aspectRatio: NaN, viewMode: 1, preview: '.img-preview', zoomTo: 1, autoCropArea: 1, crop: function (e) { $dataX.val(Math.round(e.x)); $dataY.val(Math.round(e.y)); $dataHeight.val(Math.round(e.height)); $dataWidth.val(Math.round(e.width)); $dataRotate.val(e.rotate); $dataScaleX.val(e.scaleX); $dataScaleY.val(e.scaleY); }, }; // Tooltip $('[data-bs-toggle="tooltip"]').tooltip(); // Init Cropper $image .on({ 'build.cropper': function (e) { console.log(e.type); }, 'built.cropper': function (e) { console.log(e.type); }, }) .cropper(options); cropper = $image.data('cropper'); // Disable unavailable features if (!$.isFunction(document.createElement('canvas').getContext)) { $('button[data-method="getCroppedCanvas"]').prop('disabled', true); } if (typeof document.createElement('cropper').style.transition === 'undefined') { $('button[data-method="rotate"]').prop('disabled', true); $('button[data-method="scale"]').prop('disabled', true); } // Disable download if unsupported // if (typeof $download[0].download === 'undefined') { // $download.addClass('disabled'); // } // Handle method buttons $('.docs-buttons') .off('click') // prevent multiple bindings .on('click', '[data-method]', function () { const $this = $(this); let data = $this.data(); let $target, result; if ($this.prop('disabled') || $this.hasClass('disabled')) { return; } if ($image.data('cropper') && data.method) { data = $.extend({}, data); // clone a new object if (typeof data.target !== 'undefined') { $target = $(data.target); if (typeof data.option === 'undefined') { try { data.option = JSON.parse($target.val()); } catch (e) { console.log(e.message); } } } if (data.method === 'rotate') { $image.cropper('clear'); } result = $image.cropper(data.method, data.option, data.secondOption); if (data.method === 'rotate') { $image.cropper('crop'); } switch (data.method) { case 'scaleX': case 'scaleY': $(this).data('option', -data.option); break; case 'getCroppedCanvas': if (result) { const id = $('#crop_image_container_id').val(); console.log(id, $(id)); // Wrap the canvas inside a responsive div const canvasWrapper = $('
    ').css({ width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', overflow: 'hidden', padding: '5px', border: '2px solid #ddd', borderRadius: '8px' }); // Style the canvas to fit the div $(result).css({ width: '100%', height: 'auto', maxHeight: '100%', display: 'block', }); canvasWrapper.html(result); $(id).html(canvasWrapper); if (result) { const canvasData = result.toDataURL('image/jpeg'); // Send to PHP backend $.ajax({ url: 'save_cropped_image.php', type: 'POST', data: { image: canvasData, id: id }, success: function (response) { console.log('Server response:', response); // alert('Image saved successfully!'); }, error: function (xhr, status, error) { console.error('Upload failed:', error); // alert('Error saving image.'); } }); } // Optionally close the modal after cropping const modalInstance = bootstrap.Modal.getInstance(myModalEl); modalInstance.hide(); } break; } if ($.isPlainObject(result) && $target) { try { $target.val(JSON.stringify(result)); } catch (e) { console.log(e.message); } } } }); // Keyboard controls $(document.body) .off('keydown') .on('keydown', function (e) { if (!$image.data('cropper') || this.scrollTop > 300) { return; } switch (e.which) { case 37: e.preventDefault(); $image.cropper('move', -1, 0); break; case 38: e.preventDefault(); $image.cropper('move', 0, -1); break; case 39: e.preventDefault(); $image.cropper('move', 1, 0); break; case 40: e.preventDefault(); $image.cropper('move', 0, 1); break; } }); }); // Clean up when modal hides $('#cropImage').on('hidden.bs.modal', function () { if (cropper) { cropper.destroy(); cropper = null; } }); }) function publishReport() { $(".edit-list-btn, .edit-list, .crop-btn-overlay, .edit-titile").remove(); let htmlBody = `

    FULL-PAGE COMPARISON }

    Tuesday, October 28, 2025

    FINDINGS & ANALYSIS

     

     

    Logo

Description automatically generated

    A red and white sign

Description automatically generated with low confidence

    Logo

Description automatically generated

    ABOVE THE FOLD | APP

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    10/27 [ Mo ]

    10/24 [ Fr ]

    10/23 [ Th ]

    10/27 [ Mo ]

    10/24 [ Fr ]

    10/23 [ Th ]

    10/27 [ Mo ]

    10/24 [ Fr ]

    10/23 [ Th ]

    ABOVE THE FOLD | DESKTOP

     

     

     

     

     

     

    $1 flash deals NEW!, Customer-loved gifts under $50,

    Our Top 100+ costumes, Fright night, streamed right,

    Save up to 30% on exclusive deals

    Halloween’s this Friday!

    MacBook Pro 14” Supercharged by M5

    ETS SHARE OF HOMEPAGE 1

     

     

    NEW & POPULAR STORIES

     

     

    Finds from small businesses

    Toys

     

    Get decorating for Halloween

    Indoor decorations

    Outdoor decorations

    Party supplies

    up to 40% off

     

    Costumes for the family

    Men

    Women

    Kids

     

    Shop gifts by price

    Under $100

     

    Shop 4+ star gifts

    Electronics

    Toys

     

    Find gifts for everyone

    For kids

     

    Our current obsessions

    Electronics

    Check out the newest arrivals

    16" Christmas Jumbo Sequin Bow Wall Decor Silver

     

    New seasonal favorites

    New arrivals

    Vintage style from John Derian

     

    Christmas

    The Everything Christmas Market

     

    Featured categories

    New Arrivals

    Halloween

    Christmas

    Deal of the Day

    Pioneer 50" Class LED 4K UHD Smart Xumo TV

     

    Our featured offers

    Save up to $1,000 on select big-screen TVs

    AirPods Max (USB-C) Save $50

    Save up to $500 on select Windows devices

     

    Start here. Play your way to anywhere.

    Start here. Play your way to anywhere.

     

    Deals

    Monster deals on the tech you want

     

    Outlet Event

    Save up to 50% on clearance, open-box and refurbished items

     

    Best Buy Outlet

    Top-quality tech. Even better prices.

     

     

     

     

    ETS SPECIFIC PROMOTIONS

     

    BEST SELLERS IN COMPUTERS & ACCESSORIES

    • Ailun Screen Protector for iPad 11th A16 2025 11” / 10th Gen…
    • Apple iPad 11” A16 chip 11” Model Liquid Retina Display 128G…
    • Anker iPhone 17/16 Charger 2-Pack 20W Fast USB C Charge…
    • Stylus Pen for iPad 6th-11th Gen2X Fast Charge Active pencil...
    • MoKo for iPad A16 11th Gen Case 11 “ 2025 iPad 10th Gen Ca…
    • Anker USB C Charger Nano II 65W PPS 3-Port Fast Compact…

     

    BEST SELLERS IN BOOKS

    • Outlive
    • The Let Them Theory
    • Nobody's Girl
    • Read Your Mind
    • 1929: Inside the Greatest Crash in Wall Street History
    • The Widow
    • How to Test Negative for Stupid
    • Regretting You
    • To Rescue the American Spirit

     

    BEST SELLERS IN TOYS & GAMES

    • PartySticks Ultra Bright Glow Sticks Bulk Party Supplies 100…
    • PartyWoo Black Balloons 140 pcs Different Sizes Pack of 18 1…
    • Bezente Assorted Rainbow Latex Balloons 100 Pack 12 “ Rou…
    • Play Doh Bulk Handout 42-Pack of 1-Ounce Modeling Comp…
    • Play Doh Modeling Compound 10-Pack Case of Assorted Co…
    • HEX BOTS Wall Crawler Gecko with Official Wall Climber Tec…

     

                    NO ACTIVE PROMOTIONS

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    BEST SELLING ITEMS

    • Apple AirPods Pro 3 Wireless Active Noise Cancelling Earbu…
    • Pokémon Legends Z-A Nintendo Switch 2 Nintendo Switch 2
    • Apple 11” iPad A16 chip with Wi-Fi 128GB Blue
    • Microsoft 365 Personal 1 Person 12-Month Subscription Acti…
    • Switch 2 + Mario Kart World Bundle Nintendo Switch 2

     

    APP EXCLUSIVE – DROPS

     

    TRENDING DEALS

     

    ETS SPECIFIC TRENDING ITEMS

    • Apple MacBook Air 13” Laptop Apple M4 chip Built for Apple…
    • HP 14" Laptop Intel Processor N150 4GB Memory 128GB UFS…
    • HP Victus 15.6" 144Hz Full HD Gaming Laptop AMD Ryzen 7 7…
    • Lenovo IdeaPad 3i Chromebook 15.6" Full HD Laptop Intel C…
    • HP 15.6" Full HD Touch-Screen Laptop Intel Core i5 16GB Me…

    1.  The ETS “Share of Homepage” equals % of elements dedicated to ETS versus the total visible opportunities available for potential ETS promotion/item placement, on the competitors’ homepage.

    2.  All screengrabs are captured incognito in a signed-out state to mitigate influence of browser history, & cookies on the homepage render.

    ²³ ² AP  |  © WALMART 2025

    CONFIDENTIAL & PRIVILEGED

    FEEDBACK *

    `; // htmlBody = ` //

    Hello!

    //

    This is a test message with HTML formatting.

    //

    Visit our site for more info.

    // `; const email = "someone@example.com"; const subject = encodeURIComponent("HTML Email Example"); const body = encodeURIComponent(htmlBody); window.location.href = `mailto:${email}?subject=${subject}&body=${body}`; } function generateFileName() { const now = new Date(); // Get parts const day = String(now.getDate()).padStart(2, '0'); const month = now.toLocaleString('en-US', { month: 'short' }); // "Oct" const year = now.getFullYear(); // Combine in your desired format const fileName = `csr-${day}-${month}-${year}.xlsx`; return fileName; }