Oppaitime'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 19KB

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