BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upload.js 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Line 11
  2. function Categories() {
  3. let def = [
  4. 'javdb', // Accession Number
  5. 'audio', // Version
  6. 'title', // Torrent Title
  7. 'title_rj', // Organism
  8. 'title_jp', // Strain/Variety
  9. 'idols', // Authors(s)
  10. 'studio', // Department/Lab
  11. 'series', // Location
  12. 'year', // Year
  13. 'codec', // License
  14. // Platform changes below
  15. 'resolution', // Assembly Level
  16. // Format changes below
  17. 'archive', // Archive
  18. 'tags', // Tags
  19. 'cover', // Picture
  20. 'mirrors', // Mirrors
  21. 'screenshots', // Publications
  22. 'group_desc', // Torrent Group Description
  23. 'release_desc', // Torrent Description
  24. 'censored', // Aligned/Annotated
  25. 'anon', // Upload Anonymously
  26. ]
  27. let cats = [
  28. { // DNA
  29. 'media': {}, // Platform
  30. 'container': {}, // Format
  31. },
  32. { // RNA
  33. 'media': {}, // Platform
  34. 'container': {}, // Format
  35. },
  36. { // Proteins
  37. 'media': {}, // Platform
  38. 'container_prot': {}, // Format
  39. },
  40. { // Imaging
  41. 'media_manga': {}, // Platform
  42. 'container_games': {}, // Format
  43. },
  44. { // Extras
  45. 'media': {}, // Platform
  46. 'container_extra': {}, // Format
  47. }
  48. ]
  49. let active = {}
  50. for (let field of def) active[field] = {}
  51. let category = 0
  52. if ($('input[name="type"]').raw()) category = $('input[name="type"]').raw().value
  53. if ($('#categories').raw()) category = $('#categories').raw().value
  54. active = Object.assign(active, cats[category])
  55. let hide = el => {
  56. Array.from($(`#${el.id} input, #${el.id} select, #${el.id} textarea`)).forEach(inp => inp.disabled = true)
  57. $(el).ghide()
  58. }
  59. let show = el => {
  60. Array.from($(`#${el.id} input, #${el.id} select, #${el.id} textarea`)).forEach(inp => inp.disabled = false)
  61. $(el).gshow()
  62. }
  63. let trs = $('#dynamic_form tr')
  64. for (let tr of trs) {
  65. let field = tr.id.slice(0, -3)
  66. if (active[field]) {
  67. if (active[field].name) {
  68. tr.children[0].innerHTML = active[field].name
  69. }
  70. let notes = $(`#${tr.id} p.notes`).raw()
  71. if (notes) notes.innerHTML = active[field].notes || ''
  72. show(tr)
  73. } else {
  74. hide(tr)
  75. }
  76. }
  77. }
  78. // Line 91