Skip to content
Snippets Groups Projects
Select Git revision
  • 9aea82817e8fe63338c88b565d690f25255d8de1
  • 3.9 default
  • develop
  • 6.0
  • 5.0
  • 4.0
  • scrutinizer-patch-4
  • scrutinizer-patch-3
  • scrutinizer-patch-2
  • scrutinizer-patch-1
  • 3.7
  • 3.8
  • 3.6
  • 3.9_backported
  • 3.8_backported
  • 3.7_backported
  • 3.5
  • 3.6_backported
  • 3.5_backported
  • 3.4
  • 3.3_backported
  • 6.0.4
  • 6.0.3
  • 5.0.7
  • 6.0.2
  • 6.0.1
  • 5.0.6
  • 6.0.0
  • 5.0.5
  • 6.0.0-rc
  • 5.0.4
  • 6.0.0-beta
  • 5.0.3
  • 4.0.6
  • 5.0.2
  • 5.0.1
  • 4.0.5
  • 5.0.0
  • 4.0.4
  • 5.0.0-rc2
  • 5.0.0-rc1
41 results

CMailFile.class.php

Blame
  • example.js 944 B
    // Prices in cents:
    const PIZZA_PRICE = 1499;
    const BEVERAGE_PRICE = 199;
    
    const pizzaSlider = document.querySelector('#pizza-slider');
    const beverageSlider = document.querySelector('#beverage-slider');
    const output = document.querySelector('#output');
    const totalSpan = document.querySelector('#total');
    
    document.querySelector('#pizza-caption').textContent = 'How many pizzas?';
    document.querySelector('#beverage-caption').textContent = 'How many beverages?';
    pizzaSlider.value = '1';
    beverageSlider.value = '2';
    
    function updateTotal() {
      const total = Number(pizzaSlider.value) * PIZZA_PRICE + Number(beverageSlider.value) * BEVERAGE_PRICE;
      if (total === 0) {
        output.style.visibility = 'hidden';
      } else {
        output.style.visibility = 'visible';
      }
      totalSpan.textContent = `${(total / 100).toFixed(2)}`;
    }
    updateTotal();
    pizzaSlider.addEventListener('input', updateTotal);
    beverageSlider.addEventListener('input', updateTotal);