`; }); html += `

View results

`; return html; } fetchAllCounts(callback) { log("Fetching counts for all polls"); const counters = []; this.polls.forEach(pollData => { pollData.pollOptions.forEach(option => { counters.push({ name: `${pollData.pollId}-${sanitizeString(option)}`, hit: "no" }); }); }); $.ajax({ url: "https://us-central1-adbusters-fronts.cloudfunctions.net/counters", type: "POST", data: JSON.stringify({ counters }), contentType: "application/json", dataType: "json", success: (response) => { this.polls.forEach(pollData => { pollData.pollOptions.forEach(option => { const counterName = `${pollData.pollId}-${sanitizeString(option)}`; pollData.counts[option] = response.counters[counterName].count; }); }); if (callback) { callback(); } }, error: (xhr, status, error) => { log(`Error fetching counts: ${error}`); if (callback) { callback(); } } }); } updateUI(pollData, clickedId, isVoting) { log(`Updating UI for poll: ${pollData.pollName}, clicked: ${clickedId}, isVoting: ${isVoting}`); if (pollData.isViewingResults) { $(`.${pollData.pollId}-box-image`).hide(); $(`.${pollData.pollId}-poll-result`).show(); $(`#${pollData.pollId}-view-results`).text('Change vote').show(); } else { $(`.${pollData.pollId}-box-image`).show(); $(`.${pollData.pollId}-poll-result`).hide(); $(`#${pollData.pollId}-view-results`).text('View results').show(); } pollData.pollOptions.forEach((option) => { const optionId = sanitizeString(option); const $result = $(`#${pollData.pollId}-${optionId}-result`); const $option = $(`#${pollData.pollId}-${optionId}`); // Apply the correct justify-content style based on isViewingResults $option.css('justify-content', pollData.isViewingResults ? 'space-between' : 'flex-start'); $result.css('color', ''); $option.find('h1').css('color', ''); if (isVoting) { if (option === clickedId) { pollData.counts[option]++; $result.css('color', 'darkred'); $option.find('h1').css('color', 'darkred'); } else if (option === pollData.votedOption) { pollData.counts[option]--; } } else if (option === pollData.votedOption) { $result.css('color', 'darkred'); $option.find('h1').css('color', 'darkred'); } $result.text(pollData.counts[option] + " votes"); }); if (isVoting) { pollData.canVote = false; pollData.pollOptions.forEach((option) => { const optionId = sanitizeString(option); $(`#${pollData.pollId}-${optionId}`).prop('disabled', true); }); } } toggleResultsView(pollData) { log(`Toggling results view for poll: ${pollData.pollName}`); pollData.isViewingResults = !pollData.isViewingResults; pollData.canVote = !pollData.isViewingResults; this.updateUI(pollData, pollData.votedOption, false); pollData.pollOptions.forEach((option) => { const optionId = sanitizeString(option); $(`#${pollData.pollId}-${optionId}`).prop('disabled', pollData.isViewingResults); }); } castVote(pollData, option) { log(`Attempting to cast vote for poll: ${pollData.pollName}, option: ${option}`); if (!pollData.canVote) return; if (pollData.hasVoted && option === pollData.votedOption) return; const isChangingVote = pollData.hasVoted; const oldVotedOption = pollData.votedOption; pollData.votedOption = option; pollData.hasVoted = true; pollData.isViewingResults = true; // Update UI first for immediate feedback this.updateUI(pollData, option, true); // Then send the vote to the server const counters = [{ name: `${pollData.pollId}-${sanitizeString(option)}`, hit: "yes" }]; if (isChangingVote) { counters.push({ name: `${pollData.pollId}-${sanitizeString(oldVotedOption)}`, hit: "no" }); } $.ajax({ url: "https://us-central1-adbusters-fronts.cloudfunctions.net/counters", type: "POST", data: JSON.stringify({ counters }), contentType: "application/json", dataType: "json", success: (response) => { log(`Vote cast successfully for ${pollData.pollName}: ${option}`); localStorage.setItem(pollData.pollId + '-hasVoted', 'true'); localStorage.setItem(pollData.pollId + '-votedOption', option); }, error: (xhr, status, error) => { log(`Error casting vote: ${error}`); // Revert the UI changes if the vote failed pollData.hasVoted = isChangingVote; pollData.votedOption = oldVotedOption; this.updateUI(pollData, oldVotedOption, false); } }); } initializePoll(pollData) { log(`Initializing poll: ${pollData.pollName}`); const pollHTML = this.createPollHTML(pollData); const $currentScript = $('script').filter(function() { return $(this).text().trim().indexOf(`window['${pollData.pollId}_instance'] = new PollData(`) !== -1; }).last(); if ($currentScript.length) { log(`Found script tag for poll: ${pollData.pollName}`); $(pollHTML).insertAfter($currentScript.parent()); log(`Inserted poll HTML for: ${pollData.pollName}`); } else { log(`Could not find script tag for poll: ${pollData.pollName}. HTML insertion failed.`); return; } $(`.${pollData.pollId}-poll-result`).hide(); $(`#${pollData.pollId}-view-results`).on('click', () => this.toggleResultsView(pollData)); pollData.pollOptions.forEach((option) => { const optionId = sanitizeString(option); $(`#${pollData.pollId}-${optionId}`).on('click', () => this.castVote(pollData, option)); }); log(`Poll ${pollData.pollName} HTML initialized`); } initializeAllPolls() { log("Initializing all polls"); if (this.isInitialized) { log("Polls already initialized. Skipping."); return; } this.polls.forEach((pollData) => { this.initializePoll(pollData); }); // Fetch all counts after initializing all polls this.fetchAllCounts(() => { this.polls.forEach((pollData) => { if (pollData.hasVoted) { this.updateUI(pollData, pollData.votedOption, false); } else { $(`#${pollData.pollId}-view-results`).text('View results').show(); } }); // Handle URL parameters for voting const urlParams = new URLSearchParams(window.location.search); const urlPollId = urlParams.get('poll'); const urlVote = urlParams.get('option'); if (urlPollId && urlVote) { const pollData = this.polls.get(sanitizeString(urlPollId)); if (pollData) { const matchingOption = pollData.pollOptions.find(option => sanitizeString(option) === sanitizeString(urlVote)); if (matchingOption) { this.castVote(pollData, matchingOption); window.history.replaceState({}, document.title, window.location.pathname); } } } this.isInitialized = true; log("All polls fully initialized"); }); } static getInstance() { if (!PollManager.instance) { PollManager.instance = new PollManager(); } return PollManager.instance; } } window.PollData = PollData; window.pollManager = PollManager.getInstance(); $(function() { log("Document ready, initializing polls"); window.pollManager.initializeAllPolls(); }); log("PollManager script initialization complete"); })(jQuery);
adbusters logo

Mindbomb - ${videoTitle}

`; // Collect elements to keep const elementsToKeep = []; // Save the title and link elements if (titleElement) elementsToKeep.push(titleElement); if (linkElement) elementsToKeep.push(linkElement); // Save any style elements container.querySelectorAll('style').forEach(style => { elementsToKeep.push(style); }); // Clear the container container.innerHTML = ''; // Add the player container.appendChild(playerContainer); // Add back the saved elements elementsToKeep.forEach(el => { if (el.id === 'video-embed-title-id' || el.id === 'video-embed-link-id' || el.classList.contains('video-embed-title-id') || el.classList.contains('video-embed-link-id')) { el.style.display = 'none'; } container.appendChild(el); }); // Style the container container.style.cssText = "display: block !important; width: 100% !important; min-height: 200px !important; position: relative !important; overflow: visible !important;"; // Style the parent container const parentDiv = container.parentNode; if (parentDiv) { parentDiv.style.cssText = "width: 100% !important; height: auto !important; display: block !important; position: relative !important;"; } // Set up click handlers const player = container.querySelector(`.youtube-embed-wrapper[data-instance="${containerId}"]`); if (player) { const thumbnail = player.querySelector('.youtube-thumbnail'); const playButton = player.querySelector('.youtube-play-button'); const iframe = player.querySelector('.youtube-iframe'); const titleCard = player.querySelector('.youtube-title-card'); const thumbnailOverlay = player.querySelector('.youtube-thumbnail-overlay'); // Function to play the video function playVideo(e) { if (e) { e.preventDefault(); e.stopPropagation(); } // Hide elements thumbnail.style.cssText = "display: none !important;"; playButton.style.cssText = "display: none !important;"; titleCard.style.cssText = "display: none !important;"; if (thumbnailOverlay) { thumbnailOverlay.style.cssText = "display: none !important;"; } // Show and load iframe iframe.style.cssText = "position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; display: block !important; z-index: 3 !important;"; iframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1&rel=0`; } // Add click handlers thumbnail.addEventListener('click', playVideo); playButton.addEventListener('click', playVideo); if (thumbnailOverlay) { thumbnailOverlay.addEventListener('click', playVideo); } // Ensure correct dimensions player.style.width = '100%'; player.style.aspectRatio = '16/9'; } }); } // Run the initialization if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })();

Spread the curse of the blackspot

When the sun gets low and the kids are high on sugar, grab your Sharpie and hit the streets.

Start by drawing a blackspot on the knuckle of your punching hand.

Then, leave a blackspot on every big bank, every corporate logo, every hungry ghost feeding on the human spirit . . .  Let the mystery and dread of this symbol send a chill down their spine . . .

The old world is dying, a new one is about to be born, now go out and slay some monsters.

Send us any pics you take along the way.

Our Iconic Design Anarchy Cover

Nominated by the NYTimes for their 25 Most Influential Magazine Covers

Dare differently . . .

Palestine’s Mandela
Moment Is Here

Join the Bottoms Up Majority

Email Signup Form

As soon as we have fifty thousand members signed up, we will hold a communal brainstorm and decide what the next step in our evolution should be.

OUR PROMISE TO YOU:

We'll hire the most decent, smart and competent humans to run every leadership position in every government department. We'll make being a civil servant one of the most prestigious and desirable jobs any young person could ever aspire to — a values-based calling.

We'll make sure that every court case wraps up within a year. Same with health care: no civilized country makes its citizens suffer waiting interminably to be attended to.

Trump fired 300,000 federal workers; we go in the opposite direction, we'll hire a million and make it work.

Don't think this can't be done. The fact is that it's never really been tried.

Any party that gives this kind of intimate person-to-person service to its citizens — and does it well — is sure to win the next election.

Western WEIRDness

Hot off the press is the newest report of the Global Flourishing Study — an ongoing project managed by Harvard and Baylor which checks in with hundreds of thousands of folks in 22 countries to see how they're doing. "Flourishing" might best be described as truly crushing this thing called life. You're happy, you're healthy, you're at peace. Once again this year, the Scandinavian countries came out on top.

The big surprise was who came out on the bottom: Japan, the UK, and the United States. Countries with among the highest GDP in the world.

WTF?

Read more