/* Copyright (C) 2012-2013 Denver Gingerich, ** Copyright (C) 2013-2014 Bradley M. Kuhn, ** Copyright (C) 2016 Brett Smith. ** License: GPLv3-or-later ** Find a copy of GPL at https://sfconservancy.org/GPLv3 */ 'use strict'; function qs (selector, parent) { return document.querySelector(selector); } function qsa (selector, parent) { return document.querySelectorAll(selector); } function hide(el) { el.style.display = 'none'; } function show(el) { el.style.display = ''; } function showVideoInnerHTML (event) { let video = event.target.parentNode; let div = document.createElement('div'); div.classList = video.classList; div.innerHTML = video.innerHTML; video.parentNode.replaceChild(div, video); } function toggleShirtSize (form) { let wantShirt = form.elements['on0'].value === 'wantGiftYes'; let shirtSizeSelector = form.elements['os0']; shirtSizeSelector.disabled = !wantShirt; form.elements['no_shipping'].value = wantShirt ? '2' : '0'; if (wantShirt) { show(shirtSizeSelector); } else { hide(shirtSizeSelector); } } /* When the browser doesn't support any video source, replace it with the HTML inside the