Contributing back some bug fixes
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 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. function DisplayTrans() {
  2. if (['Softsubs','Hardsubs'].indexOf($('select[name="sub"]').raw().value) != -1) {
  3. $('#subber').raw().parentNode.parentNode.style.display = 'table-row'
  4. } else {
  5. $('#subber').raw().parentNode.parentNode.style.display = 'none'
  6. }
  7. }
  8. function Categories() {
  9. let def = ['title', 'title_rj', 'title_jp', 'year', 'lang', 'censored', 'tags', 'cover', 'group_desc', 'release_desc', 'anon']
  10. let cats = [{
  11. 'javdb': {},
  12. 'idols': {name: 'Idol(s)'},
  13. 'studio': {name: 'Studio'},
  14. 'series': {name: 'Series'},
  15. 'media': {},
  16. 'container': {},
  17. 'codec': {},
  18. 'resolution': {},
  19. 'audio': {},
  20. 'sub': {},
  21. 'mediainfo': {},
  22. 'screenshots': {name: 'Screenshots'},
  23. 'group_desc': {notes: 'Contains information such as a description of the movie, a link to a JAV catalogue, etc.'},
  24. 'release_desc': {notes: 'Contains information such as encoder settings or watermarks'}
  25. }, {
  26. 'anidb': {},
  27. 'idols': {name: 'Artist/Studio'},
  28. 'studio': false,
  29. 'series': {name: 'Circle (Optional)'},
  30. 'media': {},
  31. 'container': {},
  32. 'codec': {},
  33. 'resolution': {},
  34. 'audio': {},
  35. 'sub': {},
  36. 'trans': {name: 'Translation Group (optional)'},
  37. 'mediainfo': {},
  38. 'tags': {notes: 'Remember to use the \'3d\' tag if your upload is 3DCG!'},
  39. 'screenshots': {name: 'Screenshots'},
  40. 'group_desc': {notes: 'Contains information such as a description of the anime, a link to AniDB, etc.'},
  41. 'release_desc': {notes: 'Contains information such as encoder settings or episode source differences'}
  42. }, {
  43. 'ehentai': {},
  44. 'idols': {name: 'Artist'},
  45. 'studio': {name: 'Publisher (Optional)'},
  46. 'series': {name: 'Circle (Optional)'},
  47. 'pages': {},
  48. 'media_manga': {},
  49. 'archive_manga': {},
  50. 'trans': {name: 'Translation Group (optional)'},
  51. 'screenshots': {name: 'Samples'},
  52. 'group_desc': {notes: 'Contains information such as a description of the doujin.'},
  53. 'release_desc': {notes: 'Contains information such as formatting information.'}
  54. }, {
  55. 'idols': {name: 'Developer'},
  56. 'series': {name: 'Circle (Optional)'},
  57. 'studio': {name: 'Publisher (Optional)'},
  58. 'dlsite': {},
  59. 'media_games': {},
  60. 'container_games': {},
  61. 'archive': {},
  62. 'trans': {name: 'Translation/Release Group (optional)'},
  63. 'tags': {notes: 'Tags you should consider, if appropriate: <strong>visual.novel</strong>, <strong>nukige</strong>'},
  64. 'screenshots': {name: 'Screenshots', notes: '<strong class="important_text">Promotional materials from a game\'s store page are NOT screenshots</strong>'},
  65. 'group_desc': {notes: 'Contains information such as a description of the game, its mechanics, etc.'},
  66. 'release_desc': {notes: 'Contains information such as <strong>version</strong>, install instructions, patching instructions, etc.'}
  67. }, {
  68. 'idols': {name: 'Creators/Authors (Optional)'},
  69. 'studio': {name: 'Publisher (Optional)'},
  70. 'year': false,
  71. 'lang': false,
  72. 'dlsite': {},
  73. 'screenshots': {name: 'Screenshots'},
  74. 'release_desc': false
  75. }]
  76. let active = {}
  77. for (let field of def) active[field] = {}
  78. let category = 0
  79. if ($('input[name="type"]').raw()) category = $('input[name="type"]').raw().value
  80. if ($('#categories').raw()) category = $('#categories').raw().value
  81. active = Object.assign(active, cats[category])
  82. let hide = el => {
  83. Array.from($(`#${el.id} input, #${el.id} select, #${el.id} textarea`)).forEach(inp => inp.disabled = true)
  84. $(el).ghide()
  85. }
  86. let show = el => {
  87. Array.from($(`#${el.id} input, #${el.id} select, #${el.id} textarea`)).forEach(inp => inp.disabled = false)
  88. $(el).gshow()
  89. }
  90. let trs = $('#dynamic_form tr')
  91. for (let tr of trs) {
  92. let field = tr.id.slice(0,-3)
  93. if (active[field]) {
  94. if (active[field].name) {
  95. tr.children[0].innerHTML = active[field].name
  96. }
  97. let notes = $(`#${tr.id} p.notes`).raw()
  98. if (notes) notes.innerHTML = active[field].notes||''
  99. show(tr)
  100. } else {
  101. hide(tr)
  102. }
  103. }
  104. }
  105. function Bitrate() {
  106. $('#other_bitrate').raw().value = '';
  107. if ($('#bitrate').raw().options[$('#bitrate').raw().selectedIndex].value == 'Other') {
  108. $('#other_bitrate_span').gshow();
  109. } else {
  110. $('#other_bitrate_span').ghide();
  111. }
  112. }
  113. function AltBitrate() {
  114. if ($('#other_bitrate').raw().value >= 320) {
  115. $('#vbr').raw().disabled = true;
  116. $('#vbr').raw().checked = false;
  117. } else {
  118. $('#vbr').raw().disabled = false;
  119. }
  120. }
  121. function add_tag() {
  122. if ($('#tags').raw().value == "") {
  123. $('#tags').raw().value = $('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value;
  124. } else if ($('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value == '---') {
  125. } else {
  126. $('#tags').raw().value = $('#tags').raw().value + ', ' + $('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value;
  127. }
  128. }
  129. var LogCount = 1;
  130. function AddLogField() {
  131. if (LogCount >= 200) {
  132. return;
  133. }
  134. var LogField = document.createElement("input");
  135. LogField.type = "file";
  136. LogField.id = "file";
  137. LogField.name = "logfiles[]";
  138. LogField.size = 50;
  139. var x = $('#logfields').raw();
  140. x.appendChild(document.createElement("br"));
  141. x.appendChild(LogField);
  142. LogCount++;
  143. }
  144. function RemoveLogField() {
  145. if (LogCount == 1) {
  146. return;
  147. }
  148. var x = $('#logfields').raw();
  149. for (i = 0; i < 2; i++) {
  150. x.removeChild(x.lastChild);
  151. }
  152. LogCount--;
  153. }
  154. var ExtraLogCount = 1;
  155. function AddExtraLogField(id) {
  156. if (LogCount >= 200) {
  157. return;
  158. }
  159. var LogField = document.createElement("input");
  160. LogField.type = "file";
  161. LogField.id = "file_" + id;
  162. LogField.name = "logfiles_" + id + "[]";
  163. LogField.size = 50;
  164. var x = $('#logfields_' + id).raw();
  165. x.appendChild(document.createElement("br"));
  166. x.appendChild(LogField);
  167. LogCount++;
  168. }
  169. function RemoveLogField() {
  170. if (LogCount == 1) {
  171. return;
  172. }
  173. var x = $('#logfields').raw();
  174. for (i = 0; i < 2; i++) {
  175. x.removeChild(x.lastChild);
  176. }
  177. LogCount--;
  178. }
  179. var FormatCount = 0;
  180. function AddFormat() {
  181. if (FormatCount >= 10) {
  182. return;
  183. }
  184. FormatCount++;
  185. $('#extras').raw().value = FormatCount;
  186. var NewRow = document.createElement("tr");
  187. NewRow.id = "new_torrent_row"+FormatCount;
  188. NewRow.setAttribute("style","border-top-width: 5px; border-left-width: 5px; border-right-width: 5px;");
  189. var NewCell1 = document.createElement("td");
  190. NewCell1.setAttribute("class","label");
  191. NewCell1.innerHTML = "Extra Torrent File";
  192. var NewCell2 = document.createElement("td");
  193. var TorrentField = document.createElement("input");
  194. TorrentField.type = "file";
  195. TorrentField.id = "extra_torrent_file"+FormatCount;
  196. TorrentField.name = "extra_torrent_files[]";
  197. TorrentField.size = 50;
  198. NewCell2.appendChild(TorrentField);
  199. NewRow.appendChild(NewCell1);
  200. NewRow.appendChild(NewCell2);
  201. NewRow = document.createElement("tr");
  202. NewRow.id = "new_format_row"+FormatCount;
  203. NewRow.setAttribute("style","border-left-width: 5px; border-right-width: 5px;");
  204. NewCell1 = document.createElement("td");
  205. NewCell1.setAttribute("class","label");
  206. NewCell1.innerHTML = "Extra Format / Bitrate";
  207. NewCell2 = document.createElement("td");
  208. tmp = '<select id="releasetype" name="extra_formats[]"><option value="">---</option>';
  209. var formats=["Saab","Volvo","BMW"];
  210. for (var i in formats) {
  211. tmp += '<option value="'+formats[i]+'">'+formats[i]+"</option>\n";
  212. }
  213. tmp += "</select>";
  214. var bitrates=["1","2","3"];
  215. tmp += '<select id="releasetype" name="extra_bitrates[]"><option value="">---</option>';
  216. for (var i in bitrates) {
  217. tmp += '<option value="'+bitrates[i]+'">'+bitrates[i]+"</option>\n";
  218. }
  219. tmp += "</select>";
  220. NewCell2.innerHTML = tmp;
  221. NewRow.appendChild(NewCell1);
  222. NewRow.appendChild(NewCell2);
  223. NewRow = document.createElement("tr");
  224. NewRow.id = "new_description_row"+FormatCount;
  225. NewRow.setAttribute("style","border-bottom-width: 5px; border-left-width: 5px; border-right-width: 5px;");
  226. NewCell1 = document.createElement("td");
  227. NewCell1.setAttribute("class","label");
  228. NewCell1.innerHTML = "Extra Release Description";
  229. NewCell2 = document.createElement("td");
  230. NewCell2.innerHTML = '<textarea name="extra_release_desc[]" id="release_desc" cols="60" rows="4"></textarea>';
  231. NewRow.appendChild(NewCell1);
  232. NewRow.appendChild(NewCell2);
  233. }
  234. function RemoveFormat() {
  235. if (FormatCount == 0) {
  236. return;
  237. }
  238. $('#extras').raw().value = FormatCount;
  239. var x = $('#new_torrent_row'+FormatCount).raw();
  240. x.parentNode.removeChild(x);
  241. x = $('#new_format_row'+FormatCount).raw();
  242. x.parentNode.removeChild(x);
  243. x = $('#new_description_row'+FormatCount).raw();
  244. x.parentNode.removeChild(x);
  245. FormatCount--;
  246. }
  247. var ArtistCount = 1;
  248. function AddArtistField() {
  249. window.getSelection().removeAllRanges()
  250. ArtistCount = $('input[name="idols[]"]').length;
  251. if (ArtistCount >= 200) {
  252. return;
  253. }
  254. var ArtistField = document.createElement("input");
  255. ArtistField.type = "text";
  256. ArtistField.id = "idols_" + ArtistCount;
  257. ArtistField.name = "idols[]";
  258. ArtistField.size = 45;
  259. var x = $('#idolfields').raw();
  260. x.appendChild(document.createElement("br"));
  261. x.appendChild(ArtistField);
  262. x.appendChild(document.createTextNode('\n'));
  263. if ($("#idol").data("gazelle-autocomplete")) {
  264. $(ArtistField).live('focus', function() {
  265. $(ArtistField).autocomplete({
  266. serviceUrl : 'artist.php?action=autocomplete'
  267. });
  268. });
  269. }
  270. ArtistCount++;
  271. }
  272. function RemoveArtistField() {
  273. window.getSelection().removeAllRanges()
  274. ArtistCount = $('input[name="idols[]"]').length;
  275. if (ArtistCount == 1) {
  276. return;
  277. }
  278. var x = $('#idolfields').raw();
  279. for (i = 0; i < 3; i++) {
  280. x.removeChild(x.lastChild);
  281. }
  282. ArtistCount--;
  283. }
  284. function AddScreenshotField() {
  285. var sss = $('[name="screenshots[]"]')
  286. if (sss.length >= 10) return
  287. var ScreenshotField = document.createElement("input");
  288. ScreenshotField.type = "text";
  289. ScreenshotField.id = "ss_" + sss.length;
  290. ScreenshotField.name = "screenshots[]";
  291. ScreenshotField.size = 45;
  292. var a = document.createElement("a")
  293. a.className = "brackets"
  294. a.innerHTML = "−"
  295. a.onclick = function(){RemoveScreenshotField(this)}
  296. var x = $('#screenshots').raw()
  297. var y = document.createElement("div")
  298. y.appendChild(ScreenshotField);
  299. y.appendChild(document.createTextNode('\n'));
  300. y.appendChild(a);
  301. x.appendChild(y);
  302. }
  303. function RemoveScreenshotField(el) {
  304. var sss = $('[name="screenshots[]"]')
  305. el.parentElement.remove()
  306. }
  307. function CheckVA () {
  308. if ($('#artist').raw().value.toLowerCase().trim().match(/^(va|various(\sa|a)rtis(t|ts)|various)$/)) {
  309. $('#vawarning').gshow();
  310. } else {
  311. $('#vawarning').ghide();
  312. }
  313. }
  314. function CheckYear() {
  315. var media = $('#media').raw().options[$('#media').raw().selectedIndex].text;
  316. if (media == "---" || media == "Vinyl" || media == "Soundboard" || media == "Cassette") {
  317. media = "old";
  318. }
  319. var year = $('#year').val();
  320. var unknown = $('#unknown').prop('checked');
  321. if (year < 1982 && year != '' && media != "old" && !unknown) {
  322. $('#yearwarning').gshow();
  323. $('#remaster').raw().checked = true;
  324. $('#remaster_true').gshow();
  325. } else if (unknown) {
  326. $('#remaster').raw().checked = true;
  327. $('#yearwarning').ghide();
  328. $('#remaster_true').gshow();
  329. } else {
  330. $('#yearwarning').ghide();
  331. }
  332. }
  333. function ToggleUnknown() {
  334. if ($('#unknown').raw().checked) {
  335. $('#remaster_year').raw().value = "";
  336. $('#remaster_title').raw().value = "";
  337. $('#remaster_record_label').raw().value = "";
  338. $('#remaster_catalogue_number').raw().value = "";
  339. if ($('#groupremasters').raw()) {
  340. $('#groupremasters').raw().selectedIndex = 0;
  341. $('#groupremasters').raw().disabled = true;
  342. }
  343. $('#remaster_year').raw().disabled = true;
  344. $('#remaster_title').raw().disabled = true;
  345. $('#remaster_record_label').raw().disabled = true;
  346. $('#remaster_catalogue_number').raw().disabled = true;
  347. } else {
  348. $('#remaster_year').raw().disabled = false;
  349. $('#remaster_title').raw().disabled = false;
  350. $('#remaster_record_label').raw().disabled = false;
  351. $('#remaster_catalogue_number').raw().disabled = false;
  352. if ($('#groupremasters').raw()) {
  353. $('#groupremasters').raw().disabled = false;
  354. }
  355. }
  356. }
  357. function GroupRemaster() {
  358. var remasters = json.decode($('#json_remasters').raw().value);
  359. var index = $('#groupremasters').raw().options[$('#groupremasters').raw().selectedIndex].value;
  360. if (index != "") {
  361. $('#remaster_year').raw().value = remasters[index][1];
  362. $('#remaster_title').raw().value = remasters[index][2];
  363. $('#remaster_record_label').raw().value = remasters[index][3];
  364. $('#remaster_catalogue_number').raw().value = remasters[index][4];
  365. }
  366. }
  367. function AnidbAutofill() {
  368. var map = { artist: 'idols_0',
  369. title: 'title',
  370. title_jp: 'title_jp',
  371. year: 'year',
  372. description: 'album_desc' }
  373. var aid = $('#anidb').raw().value
  374. $.getJSON('/ajax.php?action=anidb&aid='+aid, function(data) {
  375. if (data.status != "success") return
  376. for (i in data.response) {
  377. if (map[i] && !($('#'+map[i]).raw().value)) {
  378. $('#'+map[i]).raw().value = data.response[i]
  379. }
  380. }
  381. })
  382. }
  383. function JavAutofill() {
  384. var map = { cn: 'javdb',
  385. idols: 'idols',
  386. title: 'title',
  387. title_jp: 'title_jp',
  388. year: 'year',
  389. studio: 'studio',
  390. image: 'image',
  391. tags: 'tags',
  392. description: 'album_desc' }
  393. var cn = $('#javdb_tr #catalogue').raw().value.toUpperCase()
  394. $.getJSON('/ajax.php?action=javfill&cn='+cn, function(data) {
  395. if (data.status != "success") {
  396. $('#catalogue').raw().value = 'Failed'
  397. return
  398. } else {
  399. $('#catalogue').raw().value = data.response.cn
  400. }
  401. for (i in data.response) {
  402. if (Array.isArray(data.response[i])) {
  403. for (j in data.response[i]) {
  404. if (i == 'idols') {
  405. if (!($('#'+map[i]+'_'+j).raw())) {
  406. AddArtistField()
  407. }
  408. $('#'+map[i]+'_'+j).raw().value = data.response[i][j]
  409. }
  410. if (map[i] == 'tags' && !($('#'+map[i]).raw().value)) {
  411. $('#'+map[i]).raw().value = data.response[i].join(', ')
  412. }
  413. }
  414. }
  415. if (map[i] && $('#'+map[i]).raw() && !($('#'+map[i]).raw().value)) {
  416. $('#'+map[i]).raw().value = data.response[i]
  417. }
  418. }
  419. if (data.response.screens.length) {
  420. $('#album_desc').raw().value = ('[spoiler=Automatically located thumbs][img]'+data.response.screens.join('[/img][img]')+'[/img][/spoiler]\n\n') + $('#album_desc').raw().value
  421. }
  422. })
  423. }
  424. function DoujAutofill() {
  425. var map = { artists: 'idols',
  426. title: 'title',
  427. title_jp: 'title_jp',
  428. year: 'year',
  429. tags: 'tags',
  430. lang: 'lang',
  431. cover: 'image',
  432. circle: 'series',
  433. pages: 'pages',
  434. description: 'release_desc' }
  435. var nh = $('#ehentai_tr #catalogue').raw().value
  436. $.getJSON('/ajax.php?action=doujin&url='+nh, function(data) {
  437. if (data.status != "success") {
  438. $('#catalogue').raw().value = 'Failed'
  439. return
  440. }
  441. for (i in data.response) {
  442. if (Array.isArray(data.response[i])) {
  443. for (j in data.response[i]) {
  444. if (i == 'artists') {
  445. if (!($('#'+map[i]+'_'+j).raw())) {
  446. AddArtistField()
  447. }
  448. $('#'+map[i]+'_'+j).raw().value = data.response[i][j]
  449. }
  450. if (map[i] == 'tags' && !($('#'+map[i]).raw().value)) {
  451. $('#'+map[i]).raw().value = data.response[i].join(', ')
  452. }
  453. }
  454. }
  455. if (map[i] && $('#'+map[i]).raw() && (!($('#'+map[i]).raw().value) || $('#'+map[i]).raw().value == '---')) {
  456. $('#'+map[i]).raw().value = data.response[i]
  457. }
  458. }
  459. })
  460. }
  461. function SetResolution() {
  462. if ($('#ressel').raw().value != 'Other') {
  463. $('#resolution').raw().value = $('#ressel').raw().value
  464. $('#resolution').ghide()
  465. } else {
  466. $('#resolution').raw().value = ''
  467. $('#resolution').gshow()
  468. $('#resolution').raw().readOnly = false
  469. }
  470. }
  471. function MediaInfoExtract() {
  472. const mi = $('#mediainfo').raw().value
  473. function getval(mi, key) {
  474. var match = mi.match(new RegExp('^'+key+'\\s*:\\s*(.*)', 'mi'))
  475. return (match && match[1]) ? match[1] : false
  476. }
  477. ['container', 'codec', 'resolution', 'audioformat', 'lang'].forEach((sel) => {
  478. if (sel == 'resolution') {
  479. var width = getval(mi, 'Width')
  480. var height = getval(mi, 'Height')
  481. if (!(width && height)) { return }
  482. width = width.match(/[0-9 ]+/)[0].replace(/ /g, '')
  483. height = height.match(/[0-9 ]+/)[0].replace(/ /g, '')
  484. var ressel = $('[name=ressel]').raw()
  485. if (width == '680' && height == '480') { ressel.value = 'SD' }
  486. else if (height == '480') { ressel.value = '480p' }
  487. else if (height == '720') { ressel.value = '720p' }
  488. else if (height == '1080' && getval(mi, 'Scan type' == 'Interlaced')) { ressel.value = '1080i' }
  489. else if (height == '1080') { ressel.value = '1080p' }
  490. else if (width == '3840') { ressel.value = '4K' }
  491. else {
  492. ressel.value = 'Other'
  493. $('[name=resolution]').raw().value = width+'x'+height
  494. }
  495. } else if (sel == 'lang') {
  496. var val1 = getval(mi.slice(mi.search(/^Audio$/m)), 'Language')
  497. var val2 = getval(mi.slice(mi.search(/^Audio\nID.*[^1]/m)), 'Language')
  498. var val = (val2 && val2 != val1 && (val1+val2 == 'EnglishJapanese' || val1+val2 == 'JapaneseEnglish')) ? 'Dual Language' : val1
  499. if (val) { $('[name=lang]').raw().value = val }
  500. } else if (sel == 'container') {
  501. var containerTable = {'Matroska': 'MKV','MPEG-4': 'MP4','AVI': 'AVI','OGG': 'OGM','Windows Media': 'WMV'}
  502. var cont = getval(mi, 'Format')
  503. if (containerTable[cont]) { $('[name=container]').raw().value = containerTable[cont] }
  504. } else if (sel == 'codec') {
  505. var codecTable = {'WMV1':'WMV','VC-1':'WMV','HEVC':'HEVC'}
  506. var codec = getval(mi.slice(mi.search(/^Video$/m)), 'Format')
  507. var formatProfile = getval(mi.slice(mi.search(/^Video$/m)), 'Format profile')
  508. var codecID = getval(mi, 'Codec ID')
  509. var codel = $('[name=codec]').raw()
  510. if (codec == 'AVC') {
  511. codel.value = (formatProfile.includes('High 10')) ? '10-bit h264' : 'h264'
  512. }
  513. else if (codec == 'MPEG-4 Visual') {
  514. codel.value = (codecID == 'XVID') ? 'XVID' : 'DIVX'
  515. }
  516. else if (codecTable[codec]) {
  517. codel.value = codecTable[codec]
  518. }
  519. }
  520. })
  521. }
  522. function initAutofill() {
  523. $('[autofill]').each(function(i, el) {
  524. el.addEventListener('click', function(event) {
  525. ({'douj':DoujAutofill, 'anime':AnidbAutofill, 'jav':JavAutofill})[el.attributes['autofill'].value]()
  526. })
  527. })
  528. }
  529. $(function() {
  530. Categories();
  531. initAutofill();
  532. $(document).on('click', '.add_artist_button', AddArtistField);
  533. $(document).on('click', '.remove_artist_button', RemoveArtistField);
  534. })