ЙажаСценарий / Говнокод #26442 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
// sorry, I don't want to use any JS templater
// so I'll concatenate html as strings, which is the worst practice
// but my IntelliJ IDEA highlights html in strings well :)
// and I write this code just4fun
//
// but to respect production I'll leave here something that will never be fixed
// TODO: rewrite in Angular.js
//
// done!

// ...

// u still read this spaghetti?

let evaluate = (s) => {
    completion = [];
    hist = [];

    let tokens = s.split(' ').filter((s) => s !== '');

    if (!tokens[0]) return;
    histfile.push(s);

    if (tokens[0] === 'clear') clear();
    else if (tokens[0] === 'aplay') aplay();
    else if (tokens[0] === 'man') try {
        template(tokens.slice(0, 2).join('_'))();
    } catch {
        stdout('No manual entry for <span class="red">' + tokens[1] + '</span>')
    }

Сайт-визитка на plain js для подкаста в виде эмулятора терминала с пасхалками
https://deveeps.prost.host/

Запостил: vistefan vistefan, (Updated )

Комментарии (67) RSS

Добавить комментарий

Я, guest, находясь в здравом уме и твердой памяти, торжественно заявляю:

    А не использовать ли нам bbcode?


    8