post.js 925 B

123456789101112131415161718192021222324252627282930
  1. function switchMenu(obj) {
  2. var el = document.getElementById(obj);
  3. if ( el.style.display != 'none' ) {
  4. el.style.display = 'none';
  5. } else {
  6. el.style.display = '';
  7. }
  8. }
  9. function add2tags(id) {
  10. var select = document.getElementById( id + '-tags');
  11. var input = document.getElementById( id + '-customtag');
  12. var newOption = document.createElement('option');
  13. newOption.value = input.value;
  14. newOption.innerText = input.value;
  15. newOption.selected = true;
  16. select.appendChild(newOption);
  17. input.value= '';
  18. }
  19. function add2aliases(id) {
  20. var select = document.getElementById( id + '-alias');
  21. var input = document.getElementById( id + '-customalias');
  22. var newOption = document.createElement('option');
  23. newOption.value = input.value;
  24. newOption.innerText = input.value;
  25. newOption.selected = true;
  26. select.appendChild(newOption);
  27. input.value= '';
  28. }